sharpster.daemon.sharemanagement
Class ShareMap

java.lang.Object
  |
  +--sharpster.daemon.sharemanagement.ShareMap

public class ShareMap
extends java.lang.Object

Class to contain cross references between files and users.


Constructor Summary
ShareMap()
          Constructor
 
Method Summary
 boolean add(net.jxta.id.ID userID, net.jxta.id.ID fileID, int access, sharpster.common.PluginData pluginData)
          Creates a share between a user and a file using the specified access and plugin data.
 net.jxta.id.ID[] getAllShares(net.jxta.id.ID userID)
          Get all files that are shared to a specified user.
 int getShareAccess(net.jxta.id.ID userID, net.jxta.id.ID fileID)
          Returns the access rights for a given share (specified by a user and a file).
 sharpster.common.PluginData getSharePluginData(net.jxta.id.ID userID, net.jxta.id.ID fileID)
          Returns the plugin data for a given share (specified by a user and a file).
 boolean loadFromFile(java.lang.String filepath)
          Saves the share information to the given file.
 boolean remove(net.jxta.id.ID userID, net.jxta.id.ID fileID)
          Remove the share that are specified by the userID and the fileID.
 void removeAllFiles(net.jxta.id.ID fileID)
          Remove all shares that are using the specified file.
 boolean saveToFile(java.lang.String filepath)
          Saves the share information to the given file.
 boolean shareExists(net.jxta.id.ID userID, net.jxta.id.ID fileID)
          Checks if a reference between a user and a file exist (if the share exists).
 void synchronizeShares(sharpster.daemon.filemanagement.FileManager fm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShareMap

public ShareMap()
Constructor

Method Detail

add

public boolean add(net.jxta.id.ID userID,
                   net.jxta.id.ID fileID,
                   int access,
                   sharpster.common.PluginData pluginData)
Creates a share between a user and a file using the specified access and plugin data.


removeAllFiles

public void removeAllFiles(net.jxta.id.ID fileID)
Remove all shares that are using the specified file.


synchronizeShares

public void synchronizeShares(sharpster.daemon.filemanagement.FileManager fm)

remove

public boolean remove(net.jxta.id.ID userID,
                      net.jxta.id.ID fileID)
Remove the share that are specified by the userID and the fileID.


getAllShares

public net.jxta.id.ID[] getAllShares(net.jxta.id.ID userID)
Get all files that are shared to a specified user.


shareExists

public boolean shareExists(net.jxta.id.ID userID,
                           net.jxta.id.ID fileID)
Checks if a reference between a user and a file exist (if the share exists).


getShareAccess

public int getShareAccess(net.jxta.id.ID userID,
                          net.jxta.id.ID fileID)
Returns the access rights for a given share (specified by a user and a file).


getSharePluginData

public sharpster.common.PluginData getSharePluginData(net.jxta.id.ID userID,
                                                      net.jxta.id.ID fileID)
Returns the plugin data for a given share (specified by a user and a file).


saveToFile

public boolean saveToFile(java.lang.String filepath)
Saves the share information to the given file.


loadFromFile

public boolean loadFromFile(java.lang.String filepath)
Saves the share information to the given file.