Java Doc for EntityGroupImpl.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » groups » 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 » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal.groups 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jasig.portal.groups.GroupMemberImpl
      org.jasig.portal.groups.EntityGroupImpl

All known Subclasses:   org.jasig.portal.groups.EntityTestingGroupImpl,  org.jasig.portal.groups.LockableEntityGroupImpl,
EntityGroupImpl
public class EntityGroupImpl extends GroupMemberImpl implements IEntityGroup(Code)
Reference implementation for IEntityGroup.

Groups do not keep references to their members but instead cache member keys. The members are cached externally. The rules for controlling access to the key caches are a bit obscure, but you should understand them before writing code that updates groups. Access to the caches themselves is synchronized via the cache getters and setters. All requests to get group members and to add or remove group members ultimately go through these methods. The mutating methods, addMember() and removeMember() however, do a copy-on-write. That is, they first make a copy of the cache, add or remove the member key, and then replace the original cache with the copy. This permits multiple read and write threads to run concurrently without throwing ConcurrentModificationExceptions. But it still leaves open the danger of data races because nothing in this class guarantees serialized write access. You must impose this from without, either via explicit locking (GroupService.getLockableGroup()) or by synchronizing access from the caller.
author:
   Dan Ellentuck
version:
   $Revision: 36518 $
See Also:   org.jasig.portal.groups.IEntityGroup



Field Summary
protected  IIndividualGroupServicelocalGroupService
    

Constructor Summary
public  EntityGroupImpl(String groupKey, Class entityType)
    

Method Summary
public  voidaddMember(IGroupMember gm)
     Adds IGroupMember gm to our member Map and conversely, adds this to gm's group Map, after checking that the addition does not violate group rules.
protected  booleanareMemberKeysInitialized()
    
protected  voidclearPendingUpdates()
     Clear out caches for pending adds and deletes of group members.
public  booleancontains(IGroupMember gm)
     Checks if GroupMember gm is a member of this.
public  booleandeepContains(IGroupMember gm)
     Checks recursively if GroupMember gm is a member of this.
public  voiddelete()
     Delegates to the factory.
public  booleanequals(Object obj)
    
public  HashMapgetAddedMembers()
    
public  java.util.IteratorgetAllEntities()
     Returns an Iterator over the Set of this IEntityGroup's recursively-retrieved members that are IEntities.
public  java.util.IteratorgetAllMembers()
     Returns an Iterator over the Set of recursively-retrieved IGroupMembers that are members of this IEntityGroup.
protected  CompositeEntityIdentifiergetCompositeEntityIdentifier()
     Returns the EntityIdentifier cast to a CompositeEntityIdentifier so that its service nodes can be pushed and popped.
public  java.lang.StringgetCreatorID()
    
public  java.lang.StringgetDescription()
    
public  java.util.IteratorgetEntities()
     Returns an Iterator over this IEntityGroup's members that are IEntities.
public  EntityIdentifiergetEntityIdentifier()
    
public  StringgetEntityKey()
     Returns the key of the underyling entity.
public  java.lang.ClassgetEntityType()
     Returns the entity type of this groups's leaf members.
public  StringgetGroupID()
    
public  java.lang.ClassgetLeafType()
     Returns the entity type of this groups's members.
protected  IIndividualGroupServicegetLocalGroupService()
    
public  StringgetLocalKey()
     Returns the key from the group service of origin.
protected  java.util.IteratorgetMemberEntities()
     Returns an Iterator over the entities in our member Collection.
public  IEntityGroupgetMemberGroupNamed(String name)
     Returns the named member IEntityGroup.
protected  java.util.IteratorgetMemberGroups()
     Returns an Iterator over the groups in our member Collection.
public  java.util.IteratorgetMembers()
     Returns an Iterator over the GroupMembers in our member Collection.
public  java.lang.StringgetName()
    
public  HashMapgetRemovedMembers()
    
protected  GroupServicegetService()
    
public  NamegetServiceName()
     Returns the Name of the group service of origin.
public  ClassgetType()
     Returns this object's type for purposes of caching and locking, as opposed to the underlying entity type.
public  booleanhasAdds()
     Answers if there are any added memberships not yet committed to the database.
public  booleanhasDeletes()
     Answers if there are any deleted memberships not yet committed to the database.
public  booleanhasMembers()
    
public  inthashCode()
     Generates a hash code for the receiver.
public  booleanisDirty()
     Answers if there are any added or deleted memberships not yet committed to the database.
public  booleanisEditable()
     Answers if this IEntityGroup can be changed or deleted.
public  booleanisGroup()
    
protected  voidprimAddMember(IGroupMember gm)
     Adds the IGroupMember key to the appropriate member key cache by copying the cache, adding to the copy, and then replacing the original with the copy.
protected  java.util.SetprimGetAllEntities(Set entities)
     Returns the Set of IEntities in our member Collection and, recursively, in the Collections of our members.
Parameters:
  entities - a Set that IEntity-GroupMembers are added to.
protected  java.util.SetprimGetAllMembers(Set s)
     Returns the Set of IGroupMembers in our member Collection and, recursively, in the Collections of our members.
Parameters:
  s - java.lang.Set - a Set that members are added to.
protected  voidprimRemoveMember(IGroupMember gm)
     Removes the IGroupMember key from the appropriate key cache, by copying the cache, removing the key from the copy and replacing the original with the copy.
public  voidprimSetName(java.lang.String newName)
    
public  voidremoveMember(IGroupMember gm)
     Removes IGroupMember gm from our member Map and, conversely, remove this from gm's group Map.
public  voidsetCreatorID(java.lang.String newCreatorID)
    
public  voidsetDescription(java.lang.String newDescription)
    
public  voidsetLocalGroupService(IIndividualGroupService newIndividualGroupService)
    
public  voidsetName(java.lang.String newName)
     We used to check duplicate sibling names but no longer do.
public  voidsetServiceName(Name newServiceName)
     Sets the service Name of the group service of origin.
public  StringtoString()
     Returns a String that represents the value of this object.
public  voidupdate()
     Delegate to the factory.
public  voidupdateMembers()
     Delegate to the factory.

Field Detail
localGroupService
protected IIndividualGroupService localGroupService(Code)




Constructor Detail
EntityGroupImpl
public EntityGroupImpl(String groupKey, Class entityType) throws GroupsException(Code)
EntityGroupImpl




Method Detail
addMember
public void addMember(IGroupMember gm) throws GroupsException(Code)
Adds IGroupMember gm to our member Map and conversely, adds this to gm's group Map, after checking that the addition does not violate group rules. Remember that we have added it so we can update the database if necessary.
Parameters:
  gm - org.jasig.portal.groups.IGroupMember



areMemberKeysInitialized
protected boolean areMemberKeysInitialized()(Code)
boolean



clearPendingUpdates
protected void clearPendingUpdates()(Code)
Clear out caches for pending adds and deletes of group members.



contains
public boolean contains(IGroupMember gm) throws GroupsException(Code)
Checks if GroupMember gm is a member of this. boolean
Parameters:
  gm - org.jasig.portal.groups.IGroupMember



deepContains
public boolean deepContains(IGroupMember gm) throws GroupsException(Code)
Checks recursively if GroupMember gm is a member of this. boolean
Parameters:
  gm - org.jasig.portal.groups.IGroupMember



delete
public void delete() throws GroupsException(Code)
Delegates to the factory.



equals
public boolean equals(Object obj)(Code)

Parameters:
  obj - the Object to compare with true if these Objects are equal; false otherwise.
See Also:   java.util.Hashtable



getAddedMembers
public HashMap getAddedMembers()(Code)
java.util.HashMap



getAllEntities
public java.util.Iterator getAllEntities() throws GroupsException(Code)
Returns an Iterator over the Set of this IEntityGroup's recursively-retrieved members that are IEntities. java.util.Iterator



getAllMembers
public java.util.Iterator getAllMembers() throws GroupsException(Code)
Returns an Iterator over the Set of recursively-retrieved IGroupMembers that are members of this IEntityGroup. java.util.Iterator



getCompositeEntityIdentifier
protected CompositeEntityIdentifier getCompositeEntityIdentifier()(Code)
Returns the EntityIdentifier cast to a CompositeEntityIdentifier so that its service nodes can be pushed and popped. CompositeEntityIdentifier



getCreatorID
public java.lang.String getCreatorID()(Code)
java.lang.String



getDescription
public java.lang.String getDescription()(Code)
java.lang.String



getEntities
public java.util.Iterator getEntities() throws GroupsException(Code)
Returns an Iterator over this IEntityGroup's members that are IEntities. java.util.Iterator



getEntityIdentifier
public EntityIdentifier getEntityIdentifier()(Code)
EntityIdentifier



getEntityKey
public String getEntityKey()(Code)
Returns the key of the underyling entity. java.lang.String



getEntityType
public java.lang.Class getEntityType()(Code)
Returns the entity type of this groups's leaf members. java.lang.Class
See Also:   org.jasig.portal.EntityTypes



getGroupID
public String getGroupID()(Code)
String



getLeafType
public java.lang.Class getLeafType()(Code)
Returns the entity type of this groups's members. java.lang.Class
See Also:   org.jasig.portal.EntityTypes



getLocalGroupService
protected IIndividualGroupService getLocalGroupService()(Code)
IIndividualGroupService



getLocalKey
public String getLocalKey()(Code)
Returns the key from the group service of origin. String



getMemberEntities
protected java.util.Iterator getMemberEntities() throws GroupsException(Code)
Returns an Iterator over the entities in our member Collection. java.util.Iterator



getMemberGroupNamed
public IEntityGroup getMemberGroupNamed(String name) throws GroupsException(Code)
Returns the named member IEntityGroup. org.jasig.portal.groups.IEntityGroup
Parameters:
  name - java.lang.String



getMemberGroups
protected java.util.Iterator getMemberGroups() throws GroupsException(Code)
Returns an Iterator over the groups in our member Collection. java.util.Iterator



getMembers
public java.util.Iterator getMembers() throws GroupsException(Code)
Returns an Iterator over the GroupMembers in our member Collection. java.util.Iterator



getName
public java.lang.String getName()(Code)
java.lang.String



getRemovedMembers
public HashMap getRemovedMembers()(Code)
java.util.HashMap



getService
protected GroupService getService() throws GroupsException(Code)
IGroupService



getServiceName
public Name getServiceName()(Code)
Returns the Name of the group service of origin. javax.naming.Nme



getType
public Class getType()(Code)
Returns this object's type for purposes of caching and locking, as opposed to the underlying entity type. java.lang.Class



hasAdds
public boolean hasAdds()(Code)
Answers if there are any added memberships not yet committed to the database. boolean



hasDeletes
public boolean hasDeletes()(Code)
Answers if there are any deleted memberships not yet committed to the database. boolean



hasMembers
public boolean hasMembers() throws GroupsException(Code)
boolean



hashCode
public int hashCode()(Code)
Generates a hash code for the receiver. This method is supported primarily for hash tables, such as those provided in java.util. an integer hash code for the receiver
See Also:   java.util.Hashtable



isDirty
public boolean isDirty()(Code)
Answers if there are any added or deleted memberships not yet committed to the database. boolean



isEditable
public boolean isEditable() throws GroupsException(Code)
Answers if this IEntityGroup can be changed or deleted. boolean
exception:
  GroupsException -



isGroup
public boolean isGroup()(Code)
boolean



primAddMember
protected void primAddMember(IGroupMember gm) throws GroupsException(Code)
Adds the IGroupMember key to the appropriate member key cache by copying the cache, adding to the copy, and then replacing the original with the copy. At this point, gm does not yet have this in its containing group cache. That cache entry is not added until update(), when changes are committed to the store.
Parameters:
  gm - org.jasig.portal.groups.IGroupMember



primGetAllEntities
protected java.util.Set primGetAllEntities(Set entities) throws GroupsException(Code)
Returns the Set of IEntities in our member Collection and, recursively, in the Collections of our members.
Parameters:
  entities - a Set that IEntity-GroupMembers are added to. java.util.Set



primGetAllMembers
protected java.util.Set primGetAllMembers(Set s) throws GroupsException(Code)
Returns the Set of IGroupMembers in our member Collection and, recursively, in the Collections of our members.
Parameters:
  s - java.lang.Set - a Set that members are added to. java.util.Set



primRemoveMember
protected void primRemoveMember(IGroupMember gm) throws GroupsException(Code)
Removes the IGroupMember key from the appropriate key cache, by copying the cache, removing the key from the copy and replacing the original with the copy. At this point, gm still has this in its containing groups cache. That cache entry is not removed until update(), when changes are committed to the store.
Parameters:
  gm - org.jasig.portal.groups.IGroupMember



primSetName
public void primSetName(java.lang.String newName)(Code)

Parameters:
  newName - java.lang.String



removeMember
public void removeMember(IGroupMember gm) throws GroupsException(Code)
Removes IGroupMember gm from our member Map and, conversely, remove this from gm's group Map. Remember that we have removed it so we can update the database, if necessary.
Parameters:
  gm - org.jasig.portal.groups.IGroupMember



setCreatorID
public void setCreatorID(java.lang.String newCreatorID)(Code)

Parameters:
  newCreatorID - java.lang.String



setDescription
public void setDescription(java.lang.String newDescription)(Code)

Parameters:
  newDescription - java.lang.String



setLocalGroupService
public void setLocalGroupService(IIndividualGroupService newIndividualGroupService) throws GroupsException(Code)

Parameters:
  newIndividualGroupService - IIndividualGroupService



setName
public void setName(java.lang.String newName) throws GroupsException(Code)
We used to check duplicate sibling names but no longer do.
Parameters:
  newName - java.lang.String



setServiceName
public void setServiceName(Name newServiceName) throws GroupsException(Code)
Sets the service Name of the group service of origin.



toString
public String toString()(Code)
Returns a String that represents the value of this object. a string representation of the receiver



update
public void update() throws GroupsException(Code)
Delegate to the factory.



updateMembers
public void updateMembers() throws GroupsException(Code)
Delegate to the factory.



Methods inherited from org.jasig.portal.groups.GroupMemberImpl
public void addGroup(IEntityGroup eg) throws GroupsException(Code)(Java Doc)
protected Set castAndCopyHashSet(Set s)(Code)(Java Doc)
public boolean contains(IGroupMember gm) throws GroupsException(Code)(Java Doc)
public boolean deepContains(IGroupMember gm) throws GroupsException(Code)(Java Doc)
public java.util.Iterator getAllContainingGroups() throws GroupsException(Code)(Java Doc)
public java.util.Iterator getAllEntities() throws GroupsException(Code)(Java Doc)
public java.util.Iterator getAllMembers() throws GroupsException(Code)(Java Doc)
protected String getCacheKey()(Code)(Java Doc)
protected ICompositeGroupService getCompositeGroupService() throws GroupsException(Code)(Java Doc)
public java.util.Iterator getContainingGroups() throws GroupsException(Code)(Java Doc)
public java.util.Iterator getEntities() throws GroupsException(Code)(Java Doc)
public java.lang.String getKey()(Code)(Java Doc)
public IEntityGroup getMemberGroupNamed(String name) throws GroupsException(Code)(Java Doc)
public java.util.Iterator getMembers() throws GroupsException(Code)(Java Doc)
public java.lang.Class getType()(Code)(Java Doc)
public EntityIdentifier getUnderlyingEntityIdentifier()(Code)(Java Doc)
public boolean hasMembers() throws GroupsException(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isDeepMemberOf(IGroupMember gm) throws GroupsException(Code)(Java Doc)
public boolean isEntity()(Code)(Java Doc)
public boolean isGroup()(Code)(Java Doc)
protected boolean isKnownEntityType(Class anEntityType) throws GroupsException(Code)(Java Doc)
public boolean isMemberOf(IGroupMember gm) throws GroupsException(Code)(Java Doc)
protected java.util.Set primGetAllContainingGroups(IGroupMember member, Set s) throws GroupsException(Code)(Java Doc)
public void removeGroup(IEntityGroup eg) throws GroupsException(Code)(Java Doc)
protected void setGroupKeysInitialized(boolean newGroupKeysInitialized)(Code)(Java Doc)

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.