|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.domain.DomainObject
com.arsdigita.domain.ObservableDomainObject
com.arsdigita.kernel.ACSObject
com.arsdigita.kernel.Party
com.arsdigita.kernel.Group
Represents a group.
Field Summary | |
static String |
BASE_DATA_OBJECT_TYPE
Every instance of group must encapsulate a data object whose object type is either this base type or a subtype of this base type. |
static String |
versionId
|
Fields inherited from class com.arsdigita.kernel.ACSObject |
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE |
Constructor Summary | |
Group()
Default constructor. |
|
Group(BigDecimal id)
Constructor in which the contained DataObject is retrieved
from the persistent storage mechanism with an OID
specified by id and Group.BASE_DATA_OBJECT_TYPE . |
|
Group(DataObject groupData)
|
|
Group(ObjectType type)
Constructor in which the contained DataObject is
initialized with a new DataObject with an
ObjectType specified by type. |
|
Group(OID oid)
Constructor in which the contained DataObject is retrieved
from the persistent storage mechanism with an OID
specified by oid. |
|
Group(String typeName)
Constructor in which the contained DataObject is
initialized with a new DataObject with an
ObjectType specified by the string
typeName. |
Method Summary | |
void |
addMember(User user)
Adds a user to this group. |
void |
addMemberOrSubgroup(Party party)
Adds a member/subgroup to this group. |
void |
addSubgroup(Group subgroup)
Adds a subgroup to this group. |
void |
addSupergroup(Group supergroup)
Adds a supergroup to this group (that is, adds this group as a subgroup of the specified group). |
protected void |
beforeSave()
|
void |
clearMembers()
Removes all direct members from this group. |
void |
clearSubgroups()
Removes all direct subgroups from this group. |
void |
clearSupergroups()
Removes this group from all groups of which this is a direct subgroup. |
long |
countAllMembers()
Returns a count of this group's members (direct plus indirect). |
long |
countAllSubgroups()
Returns a count of this group's subgroups (direct plus indirect). |
long |
countMembers()
Returns a count of this group's direct members. |
long |
countSubgroups()
Returns a count of this group's direct subgroups. |
Role |
createRole(String roleName)
Creates a new role with the specified name in this group. |
void |
delete()
Deletes this group. |
PartyCollection |
getAllContainedParties()
Returns a collection of parties that are directly or indirectly members or subgroups of this group. |
PartyCollection |
getAllMembers()
Returns a collection of users that are either directly or indirectly members of this group. |
UserCollection |
getAllMemberUsers()
Returns a collection of users that are either directly or indirectly members of this group. |
GroupCollection |
getAllSubgroups()
Returns a collection of groups that are subgroups of this group directly or indirectly. |
GroupCollection |
getAllSupergroups()
Returns a collection of groups that are directly or indirectly supergroups of this group. |
protected String |
getBaseDataObjectType()
Returns the base data object type for this domain object class. |
PartyCollection |
getContainedParties()
Returns a collection of parties that are directly members or subgroups of this group. |
PartyCollection |
getMembers()
Returns a collection of parties that are direct members of this group. |
UserCollection |
getMemberUsers()
Returns a collection of users that are direct members of this group. |
String |
getName()
Gets the name of this group. |
RoleCollection |
getOrderedRoles()
Returns a collection of roles in this group ordered by name. |
Role |
getRole(String name)
Returns the role with the specified name, or null if no such role exists for this group. |
RoleCollection |
getRoles()
Returns a collection of roles in this group. |
GroupCollection |
getSubgroups()
Returns a collection of groups that are direct subgroups of this group. |
GroupCollection |
getSupergroups()
Returns a collection of groups that are direct supergroups of this group (that is, groups of which this is a subgroup). |
boolean |
hasDirectMember(Party party)
Checks whether a user is a direct member of this group. |
boolean |
hasDirectMemberOrSubgroup(Party party)
Checks whether a party is a member of this group (if the party is a User), or a subgroup of this group (if the party is a Group). |
boolean |
hasDirectSubgroup(Group subgroup)
Checks whether a group is a direct subgroup of this group. |
boolean |
hasMember(Party party)
Checks whether a user is directly or indirectly a member of this group. |
boolean |
hasSubgroup(Group subgroup)
Checks whether a group is a subgroup of this group (either directly or indirectly). |
boolean |
isEmpty()
Checks whether this group has any members or subgroups. |
void |
removeMember(User user)
Removes a user from this group. |
void |
removeMemberOrSubgroup(Party party)
Removes a member/subgroup from this group. |
void |
removeSubgroup(Group subgroup)
Removes a subgroup from this group. |
void |
removeSupergroup(Group supergroup)
Removes a supergroup from this group (that is, removes this group as a subgroup of the specified group). |
static GroupCollection |
retrieveAll()
Retrieves all groups. |
void |
setName(String name)
Sets the name of this group. |
Methods inherited from class com.arsdigita.kernel.Party |
addEmailAddress, getAlternateEmails, getDisplayName, getEmailAddresses, getPrimaryEmail, getURI, removeEmailAddress, retrieveAllParties, setPrimaryEmail, setURI |
Methods inherited from class com.arsdigita.kernel.ACSObject |
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, isContainerModified, setID, setID |
Methods inherited from class com.arsdigita.domain.ObservableDomainObject |
addObserver, getObservers |
Methods inherited from class com.arsdigita.domain.DomainObject |
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
public static final String BASE_DATA_OBJECT_TYPE
Constructor Detail |
public Group(DataObject groupData)
public Group()
DataObject
is
initialized with a new DataObject
with an
ObjectType
of "Group".
Party.Party(String)
,
DataObject
,
ObjectType
public Group(String typeName)
DataObject
is
initialized with a new DataObject
with an
ObjectType
specified by the string
typeName.
typeName
- the name of the ObjectType
of the
contained DataObject
Party.Party(ObjectType)
,
DataObject
,
ObjectType
public Group(ObjectType type)
DataObject
is
initialized with a new DataObject
with an
ObjectType
specified by type.
type
- the ObjectType
of the created objectParty.Party(ObjectType)
,
DataObject
,
ObjectType
public Group(OID oid) throws DataObjectNotFoundException
DataObject
is retrieved
from the persistent storage mechanism with an OID
specified by oid.
oid
- the OID
for the retrieved
DataObject
Party.Party(OID)
,
DataObject
,
OID
public Group(BigDecimal id) throws DataObjectNotFoundException
DataObject
is retrieved
from the persistent storage mechanism with an OID
specified by id and Group.BASE_DATA_OBJECT_TYPE
.
id
- the id
for the retrieved
DataObject
Party.Party(OID)
,
BASE_DATA_OBJECT_TYPE
,
DataObject
,
OID
Method Detail |
protected String getBaseDataObjectType()
DomainObject
getBaseDataObjectType
in class Party
public String getName()
getName
in class Party
public void setName(String name)
name
- this group's namepublic PartyCollection getMembers()
NOTE: Any prior calls to addMember() or removeMember() will not affect the resulting collection unless save() has been called after adding or removing the member(s).
public UserCollection getMemberUsers()
NOTE: Any prior calls to addMember() or removeMember() will not affect the resulting collection unless save() has been called after adding or removing the member(s).
public void addMember(User user)
user
- the user to add to this grouppublic void removeMember(User user)
user
- the user to remove from this grouppublic boolean hasDirectMember(Party party)
true
if the user is a direct member of group;
false
otherwise.public long countMembers()
public boolean hasDirectSubgroup(Group subgroup)
subgroup
- the subgroup to check
true
if the specified group is a direct
subgroup of this group; false
otherwise.public long countSubgroups()
public boolean isEmpty()
false
if this group has any members or
subgroups; true
otherwise.public void clearMembers()
PersistenceException
- if members could not be cleared
because of a database or persistence exception.public void clearSubgroups() throws PersistenceException
PersistenceException
- if subgroups could not be cleared
because of a database or persistence exception.public void clearSupergroups() throws PersistenceException
PersistenceException
- if supergroups could not be cleared
because of a database or persistence exception.delete()
public GroupCollection getSubgroups()
NOTE: Any prior calls to addSubgroup() or removeSubgroup() will not affect the resulting collection unless save() has been called after adding or removing the subgroup(s).
public void addSubgroup(Group subgroup)
subgroup
- the subgroup to add to this grouppublic void removeSubgroup(Group subgroup)
subgroup
- the subgroup to remove from this grouppublic GroupCollection getSupergroups()
NOTE: Any prior calls to addSupergroup() or removeSupergroup() will not affect the resulting collection unless save() has been called after adding or removing the supergroup(s).
public void addSupergroup(Group supergroup)
This has the same effect as calling supergroup.addSubgroup(this), except in that case the change persists when the supergroup is saved. For example:
groupA.addSubgroup(groupB); groupA.save();is equivalent to
groupB.addSupergroup(groupA); groupB.save();
supergroup
- the supergroup to add to this grouppublic void removeSupergroup(Group supergroup)
This has the same effect as calling supergroup.removeSubgroup(this), except in that case, the change persists when the supergroup is saved. For example:
groupA.removeSubgroup(groupB); groupA.save();is equivalent to
groupB.removeSupergroup(groupA); groupB.save();
supergroup
- the supergroup to remove from this grouppublic PartyCollection getContainedParties()
NOTE: Any prior calls to membership or subgroup methods will not affect the resulting collection until save() has been called.
public GroupCollection getAllSubgroups()
NOTE: any prior calls to addSubgroup() or removeSubgroup() will not affect the resulting collection unless save() has been called after adding or removing the subgroup(s).
public GroupCollection getAllSupergroups()
NOTE: Any prior calls to addSupergroup() or removeSupergroup() will not affect the resulting collection unless save() has been called after adding or removing the supergroup(s).
public PartyCollection getAllContainedParties()
NOTE: Any prior calls to membership or subgroup methods will not affect the resulting collection until save() has been called.
public PartyCollection getAllMembers()
Currently, this is the same as getAllMemberUsers(). However, in the future we may allow other types of parties to be members of groups (specifically, we may allow groups to be members of groups).
NOTE: Any prior calls to addMember() or removeMember() will not affect the resulting collection unless save() has been called after adding or removing the member(s).
PartyCollection
public UserCollection getAllMemberUsers()
NOTE: Any prior calls to addMember() or removeMember() will not affect the resulting collection unless save() has been called after adding or removing the member(s).
UserCollection
public boolean hasMember(Party party)
true
if the user is a direct or indirect member;
false
otherwise.public long countAllMembers()
public boolean hasSubgroup(Group subgroup)
subgroup
- the subgroup to check
true
if the specified group is a direct
or indirect subgroup of this group; false
otherwise.public long countAllSubgroups()
public boolean hasDirectMemberOrSubgroup(Party party)
party
- the user/group to check
true
if the specified party is a user that
is a direct member of this group, or if the specified party is
a group that is a direct subgroup of this group;
false
otherwise.public void addMemberOrSubgroup(Party party)
party
- the party to add to this grouppublic void removeMemberOrSubgroup(Party party)
party
- the party to remove from this grouppublic Role createRole(String roleName)
roleName
- the name for the role to be added to this group
Role
public RoleCollection getRoles()
NOTE: Any prior calls to createRole() will not affect the resulting collection unless save() has been called after adding or removing the role(s).
public Role getRole(String name)
NOTE: any prior calls to createRole() will not affect the resulting collection unless save() has been called after adding or removing the role(s).
name
- the name of the role to retrieve
public RoleCollection getOrderedRoles()
NOTE: Any prior calls to createRole() will not affect the resulting collection unless save() has been called after adding or removing the role(s).
protected void beforeSave() throws PersistenceException
beforeSave
in class ACSObject
PersistenceException
public void delete() throws PersistenceException
delete
in class DomainObject
PersistenceException
DataObject.delete()
public static GroupCollection retrieveAll()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |