Class UserGroupProfileEntity
- java.lang.Object
-
- org.silverpeas.core.admin.user.model.GroupDetail
-
- org.silverpeas.core.webapi.profile.UserGroupProfileEntity
-
- All Implemented Interfaces:
Serializable
,Comparable<Group>
,Group
,WebEntity
public class UserGroupProfileEntity extends GroupDetail implements WebEntity
The profile of the user group web entity in the WEB. It is a web entity representing a group of users that can be serialized into a given media type (JSON, XML). It is a decorator that decorates a Group object with additional properties concerning its exposition in the WEB.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UserGroupProfileEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Group o)
boolean
equals(Object obj)
static UserGroupProfileEntity
fromGroup(Group group)
Decorates the specified user group with the required WEB exposition features.static UserGroupProfileEntity[]
fromGroups(List<? extends Group> groups, URI groupsURI)
Decorates the specified user groups with required WEB exposition features.URI
getChildrenUri()
Gets the URI at which its direct children groups can be retrieved.String
getDescription()
Get the group descriptionString
getDomainId()
Get the domain id where the group is storedString
getDomainName()
String
getId()
Get the group idString
getName()
Get the group nameint
getNbUsers()
Gets the number of direct users in this group; the users from its subgroups aren't counted.URI
getParentUri()
Gets the URI of its parent group.String
getRule()
Gets the synchronization rule that is applied to this group.String
getSpecificId()
Get the group specific idList<Group>
getSubGroups()
Gets the direct subgroups of this user group.String
getSuperGroupId()
Get the father group idint
getTotalNbUsers()
Gets the total number of users in this group and in its subgroups.URI
getURI()
Gets the URI at which this web entity is published and can be accessed.String[]
getUserIds()
Get the list of users in the groupURI
getUsersUri()
int
hashCode()
boolean
isRoot()
Is this group is a root one?boolean
isSynchronized()
Is this group synchronized from a remote domain service?void
setDescription(String newDescription)
Set the group descriptionvoid
setDomainId(String newDomainId)
Set the domain id where the group is storedvoid
setId(String newId)
Set the group idvoid
setName(String newName)
Set the group namevoid
setRule(String rule)
void
setSpecificId(String newSpecificId)
Set the group specific idvoid
setSuperGroupId(String newSuperGroupId)
Set the father group idvoid
setUserIds(String[] sUserIds)
Set the list of users in the groupUserGroupProfileEntity
withAsUri(URI groupUri)
-
Methods inherited from class org.silverpeas.core.admin.user.model.GroupDetail
getAllUsers, getCreationDate, getOrganisationController, getSaveDate, getState, getStateSaveDate, isRemovedState, isValidState, setCreationDate, setSaveDate, setState, setStateSaveDate, setTotalNbUsers
-
-
-
-
Method Detail
-
fromGroup
public static UserGroupProfileEntity fromGroup(Group group)
Decorates the specified user group with the required WEB exposition features.- Parameters:
group
- the user group to decorate.- Returns:
- a web entity representing the specified group profile.
-
fromGroups
public static UserGroupProfileEntity[] fromGroups(List<? extends Group> groups, URI groupsURI)
Decorates the specified user groups with required WEB exposition features.- Parameters:
groups
- a list of user groups to decorate.groupsURI
- the URI at which the specified groups are defined.- Returns:
- a list of web entities representing the specified group profiles.
-
withAsUri
public UserGroupProfileEntity withAsUri(URI groupUri)
-
getParentUri
public URI getParentUri()
Gets the URI of its parent group.- Returns:
- the URI of its parent group or null if this group is a root one.
-
getChildrenUri
public URI getChildrenUri()
Gets the URI at which its direct children groups can be retrieved.- Returns:
- the URI at which its subgroups can be get.
-
getUsersUri
public URI getUsersUri()
-
getDescription
public String getDescription()
Description copied from interface:Group
Get the group description- Specified by:
getDescription
in interfaceGroup
- Overrides:
getDescription
in classGroupDetail
- Returns:
- the group description.
-
getId
public String getId()
Description copied from class:GroupDetail
Get the group id- Specified by:
getId
in interfaceGroup
- Overrides:
getId
in classGroupDetail
- Returns:
- the group unique identifier.
-
getName
public String getName()
Description copied from interface:Group
Get the group name- Specified by:
getName
in interfaceGroup
- Overrides:
getName
in classGroupDetail
- Returns:
- the group name.
-
getNbUsers
public int getNbUsers()
Description copied from interface:Group
Gets the number of direct users in this group; the users from its subgroups aren't counted. To count also the users in its subgroups, please use theorg.silverpeas.core.admin.user.model.Group#getTotalNbUsers
method instead.- Specified by:
getNbUsers
in interfaceGroup
- Overrides:
getNbUsers
in classGroupDetail
- Returns:
- the number of direct users.
-
getTotalNbUsers
public int getTotalNbUsers()
Description copied from interface:Group
Gets the total number of users in this group and in its subgroups. Users that are in several groups are counted only once.Depending on the requester, the total number of users can omit some users by their state (usually the users whose their account is deactivated). By default, all the users whose the account is deleted aren't taken into account.
- Specified by:
getTotalNbUsers
in interfaceGroup
- Overrides:
getTotalNbUsers
in classGroupDetail
- Returns:
- the total number of distinct users in its group and subgroups.
-
getSpecificId
public String getSpecificId()
Description copied from class:GroupDetail
Get the group specific id- Overrides:
getSpecificId
in classGroupDetail
-
setDescription
public void setDescription(String newDescription)
Description copied from class:GroupDetail
Set the group description- Overrides:
setDescription
in classGroupDetail
-
setId
public void setId(String newId)
Description copied from class:GroupDetail
Set the group id- Overrides:
setId
in classGroupDetail
-
setName
public void setName(String newName)
Description copied from class:GroupDetail
Set the group name- Overrides:
setName
in classGroupDetail
-
getDomainId
public String getDomainId()
Description copied from interface:Group
Get the domain id where the group is stored- Specified by:
getDomainId
in interfaceGroup
- Overrides:
getDomainId
in classGroupDetail
- Returns:
- the user domain identifier.
-
getSuperGroupId
public String getSuperGroupId()
Description copied from interface:Group
Get the father group id- Specified by:
getSuperGroupId
in interfaceGroup
- Overrides:
getSuperGroupId
in classGroupDetail
- Returns:
- the identifier of the group parent of this group. Null the group has no parent.
-
setDomainId
public void setDomainId(String newDomainId)
Description copied from class:GroupDetail
Set the domain id where the group is stored- Overrides:
setDomainId
in classGroupDetail
-
setSpecificId
public void setSpecificId(String newSpecificId)
Description copied from class:GroupDetail
Set the group specific id- Overrides:
setSpecificId
in classGroupDetail
-
setSuperGroupId
public void setSuperGroupId(String newSuperGroupId)
Description copied from class:GroupDetail
Set the father group id- Overrides:
setSuperGroupId
in classGroupDetail
-
getDomainName
public String getDomainName()
-
getSubGroups
public List<Group> getSubGroups()
Description copied from interface:Group
Gets the direct subgroups of this user group.- Specified by:
getSubGroups
in interfaceGroup
- Overrides:
getSubGroups
in classGroupDetail
- Returns:
- a list with its direct subgroups. If this group hasn't children group, then the returned list is empty.
-
setUserIds
public void setUserIds(String[] sUserIds)
Description copied from class:GroupDetail
Set the list of users in the group- Overrides:
setUserIds
in classGroupDetail
-
setRule
public void setRule(String rule)
- Overrides:
setRule
in classGroupDetail
-
isSynchronized
public boolean isSynchronized()
Description copied from interface:Group
Is this group synchronized from a remote domain service?- Specified by:
isSynchronized
in interfaceGroup
- Overrides:
isSynchronized
in classGroupDetail
- Returns:
- true if this group is synchronized, false otherwise.
-
isRoot
public boolean isRoot()
Description copied from interface:Group
Is this group is a root one? A root group is a group that has no father group.- Specified by:
isRoot
in interfaceGroup
- Overrides:
isRoot
in classGroupDetail
- Returns:
- true if this group is a root one, false otherwise.
-
getUserIds
public String[] getUserIds()
Description copied from interface:Group
Get the list of users in the group- Specified by:
getUserIds
in interfaceGroup
- Overrides:
getUserIds
in classGroupDetail
- Returns:
- the identifiers of the users in this group.
-
getRule
public String getRule()
Description copied from interface:Group
Gets the synchronization rule that is applied to this group.- Specified by:
getRule
in interfaceGroup
- Overrides:
getRule
in classGroupDetail
- Returns:
- a synchronization rule or null if no such rule is defined for this group.
-
compareTo
public int compareTo(Group o)
- Specified by:
compareTo
in interfaceComparable<Group>
- Overrides:
compareTo
in classGroupDetail
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classGroupDetail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classGroupDetail
-
-