|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the methods that allow the agents to manipulate the roots, the groups and establish associations between roots and groups (to control which groups will read or write an specific root) stored in a database. The methods defined in this interface can be classified in three groups:
Method Summary | |
void |
associate(String threadName,
String groupName,
String agentName)
Associates a thread with an agent and its group. |
void |
createGroup(String groupName,
long time)
Creates a new group and specifies the lifetime of the agents that will belong to the group. |
void |
createRoot(String rootName)
Creates an empty root in the database. |
void |
deleteGroup(String groupName)
Deletes an existing group. |
void |
deleteRoot(String rootName)
Deletes an existing group of the database. |
Object |
get(String rootName)
Gets a root content. |
String |
getAgentName(String threadName)
Gets the name of the agent associated to the specified thread. |
String |
getGroup(String threadName)
Gets the name of the group associated to the specified thread. |
String[] |
getGroups()
Gets the names of all the groups stored in the database. |
String[] |
getGroupsToRead(String rootName)
Gets the names of the groups with read permission to a specific root. |
String[] |
getGroupsToWrite(String rootName)
Gets the names of the groups with write and delete permissions to a specific root. |
String[] |
getRoots()
Gets the names of all the roots stored in the database. |
String[] |
getRootsToRead(String groupName)
Gets the names of the roots that this group has permission to read. |
String[] |
getRootsToWrite(String groupName)
Gets the names of the roots that this group has permission to write and delete. |
long |
getTime(String groupName)
Gets the lifetime of the agents that belongs to this group. |
void |
initialize()
Initializes the database with the firsts groups. |
boolean |
isGroup(String groupName)
Tests if this group name already exists in the database. |
boolean |
isReadable(String rootName,
String groupName)
Tests if a group has permission to read a root. |
boolean |
isRoot(String rootName)
Tests if a root exists in the database. |
boolean |
isWriteable(String rootName,
String groupName)
Tests if a group has permission to write and delete a root. |
void |
removeAssociation(String threadName)
Removes the association between an agent and a thread. |
void |
set(String rootName,
Object root)
Updates a root content. |
void |
setGroupToRead(String rootName,
String groupToRead)
Gives permission for a group to read a specified root. |
void |
setGroupToWrite(String rootName,
String groupToWrite)
Gives permission for a group to write and delete a specified root. |
Method Detail |
public void initialize()
public void createGroup(String groupName, long time)
groupName
- the group nametime
- the lifetime of the agents that belongs to this group.public void deleteGroup(String groupName)
groupName
- the name of the group to be deletedpublic String[] getRootsToRead(String groupName)
groupName
- the group namepublic String[] getRootsToWrite(String groupName)
groupName
- the group namepublic long getTime(String groupName)
groupName
- the group namepublic boolean isGroup(String groupName)
groupName
- the group nametrue
if the group already exists, false
otherwise.public String[] getGroups()
public void createRoot(String rootName)
rootName
- the name of the root to be createdpublic void deleteRoot(String rootName)
rootName
- the name of the root to be deletedpublic Object get(String rootName)
rootName
- the root namepublic void set(String rootName, Object root)
rootName
- the name of the root to be updated.root
- the contents to be stored.public void setGroupToRead(String rootName, String groupToRead)
rootName
- the root namegroupToRead
- the group namepublic void setGroupToWrite(String rootName, String groupToWrite)
rootName
- the root namegroupToRead
- the group namepublic String[] getRoots()
public boolean isRoot(String rootName)
rootName
- the root nametrue
if the roor already exists, false
otherwise.public String[] getGroupsToRead(String rootName)
rootName
- the root namepublic String[] getGroupsToWrite(String rootName)
rootName
- the root namepublic boolean isReadable(String rootName, String groupName)
rootName
- the root namegroupName
- the group nametrue
if the group has permission to read the root, false
otherwise.public boolean isWriteable(String rootName, String groupName)
rootName
- the root namegroupName
- the group nametrue
if the group has permission to write and delete the root, false
otherwise.public void associate(String threadName, String groupName, String agentName)
threadName
- the thread namegroupName
- the group nameagentName
- the agent namepublic String getGroup(String threadName)
threadName
- the thread namepublic String getAgentName(String threadName)
threadName
- the thread namepublic void removeAssociation(String threadName)
threadName
- the name of the thread to be excluded
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |