| org.cougaar.core.service.community.CommunityService
All known Subclasses: org.cougaar.community.test.CommunityServiceTestImpl, org.cougaar.community.AbstractCommunityService, org.cougaar.community.DefaultCommunityServiceImpl,
CommunityService | public interface CommunityService extends Service(Code) | | This service provides access to community capabilities.
Most operations are performed asynchronously in which case a
callback is used to return status and results. In addition to
the asynchronous callback, the getCommunity and searchCommunity
methods may also return results immediately if the operation
can be completed using locally cached data. In these cases the
callback is not invoked. When required, callbacks are always
invoked from within a blackboard transaction.
|
Field Summary | |
final public static int | AGENT | final public static int | COMMUNITY |
Method Summary | |
void | addListener(CommunityChangeListener l) Add listener for CommunityChangeEvents. | void | createCommunity(String communityName, Attributes attrs, CommunityResponseListener crl) Request to create a community. | void | findCommunity(String communityName, FindCommunityCallback fccb, long timeout) Invokes callback when specified community is found.
Parameters: communityName - Name of community Parameters: fccb - Callback invoked after community is found or timeouthas lapsed Parameters: timeout - Length of time (in milliseconds) to wait forcommunity to be located. | Community | getCommunity(String communityName, CommunityResponseListener crl) Request to get a Community object. | String[] | getParentCommunities(boolean allLevels) Returns an array of community names of all communities of which caller is
a member.
Parameters: allLevels - Set to false if the list should contain only thosecommunities in which the caller is explicitlyreferenced. | void | joinCommunity(String communityName, String entityName, int entityType, Attributes entityAttrs, boolean createIfNotFound, Attributes newCommunityAttrs, CommunityResponseListener crl) Request to join a named community. | void | leaveCommunity(String communityName, String entityName, CommunityResponseListener crl) Request to leave named community. | void | listAllCommunities(CommunityResponseListener crl) Lists all communities in bound in White Pages. | Collection | listAllCommunities() Lists all communities in Name Server. | Collection | listParentCommunities(String member, CommunityResponseListener crl) Requests a collection of community names identifying the communities that
contain the specified member. | Collection | listParentCommunities(String member, String filter, CommunityResponseListener crl) Requests a collection of community names identifying the communities that
contain the specified member and satisfy a given set of attributes. | Collection | listParentCommunities(String member) Requests a collection of community names identifying the communities that
contain the specified member. | Collection | listParentCommunities(String member, String filter) Requests a collection of community names identifying the communities that
contain the specified member and satisfy a given set of attributes. | void | modifyAttributes(String communityName, String entityName, ModificationItem[] mods, CommunityResponseListener crl) Request to modify an Entity's attributes. | void | removeListener(CommunityChangeListener l) Remove listener for CommunityChangeEvents. | Collection | search(String communityName, String filter) Performs attribute based search of community entities. | Collection | searchCommunity(String communityName, String searchFilter, boolean recursiveSearch, int resultQualifier, CommunityResponseListener crl) Initiates a community search operation. |
AGENT | final public static int AGENT(Code) | | |
COMMUNITY | final public static int COMMUNITY(Code) | | |
createCommunity | void createCommunity(String communityName, Attributes attrs, CommunityResponseListener crl)(Code) | | Request to create a community. If the specified community does not
exist it will be created and the caller will become the community
manager. It the community already exists a descriptor is obtained
from its community manager and returned in the response.
Parameters: communityName - Name of community to create Parameters: attrs - Attributes to associate with new community Parameters: crl - Listener to receive response |
findCommunity | void findCommunity(String communityName, FindCommunityCallback fccb, long timeout)(Code) | | Invokes callback when specified community is found.
Parameters: communityName - Name of community Parameters: fccb - Callback invoked after community is found or timeouthas lapsed Parameters: timeout - Length of time (in milliseconds) to wait forcommunity to be located. A value of -1 disablesthe timeout. |
getCommunity | Community getCommunity(String communityName, CommunityResponseListener crl)(Code) | | Request to get a Community object. If community is found in local cache
a reference is returned by method call. If the community
is not found in the cache a null value is returned and the Community
object is requested from community's manager. After the Community
object has been obtained from the community manager the supplied
CommunityResponseListener callback is invoked to notify the requester.
Note that the supplied callback is not invoked if a non-null value is
returned.
Parameters: communityName - Community of interest Parameters: crl - Listener to receive response after remote fetch Community instance if found in cache or null if notfound |
getParentCommunities | String[] getParentCommunities(boolean allLevels)(Code) | | Returns an array of community names of all communities of which caller is
a member.
Parameters: allLevels - Set to false if the list should contain only thosecommunities in which the caller is explicitlyreferenced. If true the list will also include thosecommunities in which the caller is implicitly a memberas a result of community nesting. Array of community names See Also: CommunityService.listParentCommunities(String,CommunityResponseListener) |
joinCommunity | void joinCommunity(String communityName, String entityName, int entityType, Attributes entityAttrs, boolean createIfNotFound, Attributes newCommunityAttrs, CommunityResponseListener crl)(Code) | | Request to join a named community. If the specified community does not
exist it may be created in which case the caller becomes the community
manager. It the community doesn't exist and the caller has set the
"createIfNotFound flag to false the join request will be queued until the
community is found.
Parameters: communityName - Community to join Parameters: entityName - New member name Parameters: entityType - Type of member entity to create (AGENT or COMMUNITY) Parameters: entityAttrs - Attributes for new member Parameters: createIfNotFound - Create community if it doesn't exist Parameters: newCommunityAttrs - Attributes for created community (used ifcreateIfNotFound set to true, otherwise ignored) Parameters: crl - Listener to receive response |
leaveCommunity | void leaveCommunity(String communityName, String entityName, CommunityResponseListener crl)(Code) | | Request to leave named community.
Parameters: communityName - Community to leave Parameters: entityName - Entity to remove from community Parameters: crl - Listener to receive response |
listAllCommunities | void listAllCommunities(CommunityResponseListener crl)(Code) | | Lists all communities in bound in White Pages. Results are returned
in CommunityResponseListener callback. The crl.getContent() method
returns a Collection of community names found in white pages.
|
listParentCommunities | Collection listParentCommunities(String member, CommunityResponseListener crl)(Code) | | Requests a collection of community names identifying the communities that
contain the specified member. If the member name is null the immediate
parent communities for calling agent are returned. If member is
the name of a nested community the names of all immediate parent communities
is returned. The results are returned directly if the member name is
null or if a copy of the specified community is available in local cache.
Otherwise, the results will be returned in the CommunityResponseListener
callback in which case the method returns a null value.
Parameters: member - Member name Parameters: crl - Listener to receive results if remote lookup is required A collection of community names if operation can be resolved usingdata from local cache, otherwise null |
listParentCommunities | Collection listParentCommunities(String member, String filter, CommunityResponseListener crl)(Code) | | Requests a collection of community names identifying the communities that
contain the specified member and satisfy a given set of attributes.
The results are returned directly if the member name is
null or if a copy of the specified community is available in local cache.
Otherwise, the results will be returned in the CommunityResponseListener
callback in which case the method returns a null value.
Parameters: member - Member name Parameters: filter - Search filter defining community attributes Parameters: crl - Listener to receive results A collection of community names if operation can be resolved usingdata from local cache, otherwise null |
modifyAttributes | void modifyAttributes(String communityName, String entityName, ModificationItem[] mods, CommunityResponseListener crl)(Code) | | Request to modify an Entity's attributes.
Parameters: communityName - Name of community Parameters: entityName - Name of affected Entity or null if modifyingcommunity attributes Parameters: mods - Attribute modifications Parameters: crl - Listener to receive response |
search | Collection search(String communityName, String filter)(Code) | | Performs attribute based search of community entities. This is a general
purpose search operation using a JNDI search filter. This method is
non-blocking. An empty Collection will be returned if the local cache is
empty. Updated search results can be obtained by using the addListener
method to receive change notifications.
Parameters: communityName - Name of community to search Parameters: filter - JNDI search filter Collection of MessageAddress objects |
searchCommunity | Collection searchCommunity(String communityName, String searchFilter, boolean recursiveSearch, int resultQualifier, CommunityResponseListener crl)(Code) | | Initiates a community search operation. The serach is performed against
the specified community or all communities of the calling agent
if the communityName argument is null. The results of the search are
immediately returned as part of the method call if the search can be
resolved using locally cached data. However, if the search requires
interaction with a remote community manager a null value is returned by
the method call and the search results are returned via the
CommunityResponseListener callback after the remote operation has been
completed. In the case where the search can be satisified using local
data (i.e., the method returns a non-null value) the
CommunityResponseListener is not invoked.
Parameters: communityName - Name of community to search or null to globallysearch parent communities of calling agent Parameters: searchFilter - JNDI compliant search filter Parameters: recursiveSearch - True for recursive search into nested communities[false = search top community only] Parameters: resultQualifier - Type of entities to return in result [ALL_ENTITIES,AGENTS_ONLY, or COMMUNITIES_ONLY] Parameters: crl - Callback object to receive search results Collection of Entity objects matching searchcriteria if available in local cache. A null valueis returned if cache doesn't contained namedcommunity. |
|
|