com.day.cq.security.impl
Class CrxGroup

java.lang.Object
  extended by org.apache.sling.adapter.SlingAdaptable
      extended by com.day.cq.security.impl.CrxAuthorizable
          extended by com.day.cq.security.impl.CrxGroup
All Implemented Interfaces:
Authorizable, Group, org.apache.sling.api.adapter.Adaptable
Direct Known Subclasses:
CRXUserManager.EveryOne

public class CrxGroup
extends CrxAuthorizable
implements Group

See Also:
Group, UserManager

Field Summary
 
Fields inherited from class com.day.cq.security.impl.CrxAuthorizable
log
 
Fields inherited from interface com.day.cq.security.Authorizable
PROPERTY_DESCRIPTION, PROPERTY_EMAIL, PROPERTY_ID, PROPERTY_NAME, PROPERTY_PRINCIPAL
 
Method Summary
 boolean addMember(Authorizable authorizable)
          The implementation is no required to check for circular membership definition.
 String getID()
          The ID is a unique identifier within the UserManager this User has been acquired from.
The following must be true:
 String getName()
          A human readable Name.
 boolean isMember(Authorizable authorizable)
          Checks if the given Authorizable is a member of the current Group.
 Iterator<Authorizable> members()
          Return all Authorizables that are direct members of this Group.
 boolean removeMember(Authorizable authorizable)
          
 
Methods inherited from class com.day.cq.security.impl.CrxAuthorizable
adaptTo, equals, getEffectivePrivilege, getHomePath, getPrincipal, getPrivilege, getPrivileges, getProperty, getPropertyNames, grantPrivilege, hashCode, hasPermission, hasPermissionOn, isUser, memberOf, remove, removeProperty, revokePrivilege, setProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.day.cq.security.Authorizable
getHomePath, getPrincipal, getPrivilege, getPrivileges, getProperty, getPropertyNames, grantPrivilege, hasPermission, hasPermissionOn, isUser, memberOf, remove, removeProperty, revokePrivilege, setProperty
 
Methods inherited from interface org.apache.sling.api.adapter.Adaptable
adaptTo
 

Method Detail

getID

public String getID()
The ID is a unique identifier within the UserManager this User has been acquired from.
The following must be true:
  String id = "userId"
  User u = userManger.get(id);
  u.extractID().equals(id);
 

Specified by:
getID in interface Authorizable
Returns:
the ID of this User.
See Also:
UserManager.get(String)

getName

public String getName()
A human readable Name. E.g. Implementations may return the full name of a User

Specified by:
getName in interface Authorizable
Returns:
full name of this authorizable

isMember

public boolean isMember(Authorizable authorizable)
Checks if the given Authorizable is a member of the current Group. This check will validate to true for transitive group membership. Example: if Authorizable A is a direct member of Group G2 and G2 is a direct member of Group G1, than G1.isMember(A) == true. But G1.remove(A) == false as A only can be removed from G2

Specified by:
isMember in interface Group
Parameters:
authorizable - in question
Returns:
true if the given authorizable is member of this group.

members

public Iterator<Authorizable> members()
Return all Authorizables that are direct members of this Group. No transitive membership is contained, thus a call to each returned Authorizables memberOf-method contains this Group.

Specified by:
members in interface Group
Returns:
Iterator containing all direct Members of this Group

addMember

public boolean addMember(Authorizable authorizable)
The implementation is no required to check for circular membership definition.

Specified by:
addMember in interface Group
Parameters:
authorizable - to add as a Member
Returns:
true if the Authorizable has not been contained beforehand

removeMember

public boolean removeMember(Authorizable authorizable)

Specified by:
removeMember in interface Group
Parameters:
authorizable - to remove
Returns:
true if the Authorizable has been member before


Copyright © 2008 Day Management AG. All Rights Reserved.