Java Doc for AbstractCommunityService.java in  » Science » Cougaar12_4 » org » cougaar » community » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.community 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.community.AbstractCommunityService

All known Subclasses:   org.cougaar.community.test.CommunityServiceTestImpl,  org.cougaar.community.DefaultCommunityServiceImpl,
AbstractCommunityService
abstract public class AbstractCommunityService implements CommunityService,java.io.Serializable(Code)
Base class for implementations of CommunityService API. Methods that are used for remote operations are abstract enabling the use of different communication mechanisms.


Field Summary
protected  StringagentName
    
protected static  CommunityCachecache
    
protected  CommunityManagercommunityManager
    
protected  CommunityUpdateListenercommunityUpdateListener
    
protected  Loggerlog
    
protected  MembershipWatchermembershipWatcher
    
protected  CommunityMembershipsmyCommunities
    


Method Summary
public  voidaddListener(CommunityChangeListener l)
     Add listener for CommunityChangeEvents.
protected  voidaddParentAttribute(Community community, String parent)
     Adds "Parent=XXX" attribute to nested community.
public  voidcreateCommunity(String communityName, Attributes attrs, CommunityResponseListener crl)
     Request to create a community.
abstract public  voidfindCommunity(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 timeout has lapsed
Parameters:
  timeout - Length of time (in milliseconds) to wait for community to belocated.
abstract protected  StringgetAgentName()
    
public  CommunitygetCommunity(String communityName, CommunityResponseListener crl)
     Request to get a Community instance from local cache.
protected  CollectiongetMatches(String communityName, String filter)
     Returns a collection of MessageAddress objects for all agents from specified community that match search filter.
public  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 those communities inwhich the caller is explicitly referenced.
protected  voidhandleResponse(String communityName, CommunityResponse resp, Set listeners)
     Handle response to community request returned by manager.
public  voidjoinCommunity(String communityName, String entityName, int entityType, Attributes entityAttrs, boolean createIfNotFound, Attributes newCommunityAttrs, long timeout, CommunityResponseListener crl)
     Request to join a named community.
public  voidjoinCommunity(String communityName, String entityName, int entityType, Attributes entityAttrs, boolean createIfNotFound, Attributes newCommunityAttrs, CommunityResponseListener crl)
     Request to join a named community.
public  voidleaveCommunity(String communityName, String entityName, CommunityResponseListener crl)
     Request to leave named community.
public  voidleaveCommunity(String communityName, String entityName, long timeout, CommunityResponseListener crl)
     Request to leave named community.
abstract public  CollectionlistAllCommunities()
    
abstract public  voidlistAllCommunities(CommunityResponseListener crl)
    
public  CollectionlistParentCommunities(String member, String filter, CommunityResponseListener crl)
     Requests a collection of community names identifying the communities that contain the specified member.
public  CollectionlistParentCommunities(String member)
     Requests a collection of community names identifying the communities that contain the specified member.
public  CollectionlistParentCommunities(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.
public  voidmodifyAttributes(String communityName, String entityName, ModificationItem[] mods, CommunityResponseListener crl)
     Request to modify an Entity's attributes.
abstract protected  voidqueueCommunityRequest(String communityName, int requestType, Entity entity, ModificationItem[] attrMods, CommunityResponseListener crl, long timeout, long delay)
    
public  voidremoveListener(CommunityChangeListener l)
     Remove listener for CommunityChangeEvents.
protected  voidremoveParentAttribute(Community community, String parent)
     Removes "Parent=XXX" attribute from nested community.
public  Collectionsearch(String communityName, String filter)
     Performs attribute based search of community entities.
public  CollectionsearchCommunity(String communityName, String searchFilter, boolean recursiveSearch, int resultQualifier, CommunityResponseListener crl)
     Initiates a community search operation.
abstract protected  voidsendResponse(CommunityResponse resp, Set listeners)
    

Field Detail
agentName
protected String agentName(Code)



cache
protected static CommunityCache cache(Code)



communityManager
protected CommunityManager communityManager(Code)



communityUpdateListener
protected CommunityUpdateListener communityUpdateListener(Code)



log
protected Logger log(Code)



membershipWatcher
protected MembershipWatcher membershipWatcher(Code)



myCommunities
protected CommunityMemberships myCommunities(Code)





Method Detail
addListener
public void addListener(CommunityChangeListener l)(Code)
Add listener for CommunityChangeEvents.
Parameters:
  l - Listener



addParentAttribute
protected void addParentAttribute(Community community, String parent)(Code)
Adds "Parent=XXX" attribute to nested community.
Parameters:
  community - Community
Parameters:
  parent - String



createCommunity
public 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 Community reference is obtained from its community manager and returned.
Parameters:
  communityName - Name of community to create
Parameters:
  attrs - Attributes to associate with new community
Parameters:
  crl - Listener to receive response



findCommunity
abstract public 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 timeout has lapsed
Parameters:
  timeout - Length of time (in milliseconds) to wait for community to belocated. A value of -1 disables the timeout.



getAgentName
abstract protected String getAgentName()(Code)



getCommunity
public Community getCommunity(String communityName, CommunityResponseListener crl)(Code)
Request to get a Community instance from local cache. If community is found in 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 reference is requested from the community manager. After the Community instance 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 not found



getMatches
protected Collection getMatches(String communityName, String filter)(Code)
Returns a collection of MessageAddress objects for all agents from specified community that match search filter.
Parameters:
  communityName - String
Parameters:
  filter - String Collection Collection of MessageAddress objects



getParentCommunities
public 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 those communities inwhich the caller is explicitly referenced. If true the list willalso include those communities in which the caller is implicitly amember as a result of community nesting. Array of community names



handleResponse
protected void handleResponse(String communityName, CommunityResponse resp, Set listeners)(Code)
Handle response to community request returned by manager.
Parameters:
  resp - CommunityResponse from manager
Parameters:
  listeners - CommunityResponseListeners to be notified



joinCommunity
public void joinCommunity(String communityName, String entityName, int entityType, Attributes entityAttrs, boolean createIfNotFound, Attributes newCommunityAttrs, long timeout, 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, otherwise wait
Parameters:
  newCommunityAttrs - Attributes for created community (used if createIfNotFound set totrue, otherwise ignored)
Parameters:
  crl - Listener to receive response



joinCommunity
public 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, otherwise wait
Parameters:
  newCommunityAttrs - Attributes for created community (used if createIfNotFound set totrue, otherwise ignored)
Parameters:
  crl - Listener to receive response



leaveCommunity
public 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



leaveCommunity
public void leaveCommunity(String communityName, String entityName, long timeout, CommunityResponseListener crl)(Code)
Request to leave named community.
Parameters:
  communityName - Community to leave
Parameters:
  entityName - Entity to remove from community
Parameters:
  timeout - How long to attempt operation before giving up
Parameters:
  crl - Listener to receive response



listAllCommunities
abstract public Collection listAllCommunities()(Code)



listAllCommunities
abstract public void listAllCommunities(CommunityResponseListener crl)(Code)



listParentCommunities
public Collection listParentCommunities(String member, String filter, 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 (either null or name of a nested community)
Parameters:
  crl - Listner 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
public Collection listParentCommunities(String member)(Code)
Requests a collection of community names identifying the communities that contain the specified member.
Parameters:
  member - Member name A collection of community names



listParentCommunities
public Collection listParentCommunities(String member, String filter)(Code)
Requests a collection of community names identifying the communities that contain the specified member and satisfy a given set of attributes.
Parameters:
  member - Member name
Parameters:
  filter - Search filter defining community attributes A collection of community names



modifyAttributes
public 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 modifying community attributes
Parameters:
  mods - Attribute modifications
Parameters:
  crl - Listener to receive response



queueCommunityRequest
abstract protected void queueCommunityRequest(String communityName, int requestType, Entity entity, ModificationItem[] attrMods, CommunityResponseListener crl, long timeout, long delay)(Code)



removeListener
public void removeListener(CommunityChangeListener l)(Code)
Remove listener for CommunityChangeEvents.
Parameters:
  l - Listener



removeParentAttribute
protected void removeParentAttribute(Community community, String parent)(Code)
Removes "Parent=XXX" attribute from nested community.
Parameters:
  community - Community
Parameters:
  parent - String



search
public 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
public Collection searchCommunity(String communityName, String searchFilter, boolean recursiveSearch, int resultQualifier, CommunityResponseListener crl)(Code)
Initiates a community search operation. 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
Parameters:
  searchFilter - JNDI compliant search filter
Parameters:
  recursiveSearch - True for recursive search into nested communities [false = searchtop 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 search criteria if availablein local cache. A null value is returned if cache doesn't containednamed community.



sendResponse
abstract protected void sendResponse(CommunityResponse resp, Set listeners)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.