Package com.kheops.jmap.server.security
Class Group
java.lang.Object
com.kheops.jmap.server.security.Group
- All Implemented Interfaces:
com.k2.security.acl.Group
,Serializable
,Comparable<Group>
,Principal
- Direct Known Subclasses:
AclGroup
public class Group
extends Object
implements com.k2.security.acl.Group, Serializable, Comparable<Group>
This class encapsulates the concept of group of users.
It implements Group and Comparable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds the specified member to the group.int
Compares this object with the specified group for order.boolean
Checks if an object instance is equal to the current group.Returns a UserInfo instance for ths group.User[]
Gets the members of the groupgetName()
Gets the name of the groupint
hashCode()
Gets the hashCode of the name of the group plus a prefix indicating that it's a group (needed to differentiate it from a user with the same name)boolean
Returns true if the passed principal is a member of the group.members()
Returns an enumeration of the members in the group.boolean
removeMember
(Principal user) Removes the specified member from the group.toString()
Overrides the toString methodvoid
-
Constructor Details
-
Group
Constructs a new instance of Group having the specified name
-
-
Method Details
-
getName
Gets the name of the group -
toString
Overrides the toString method -
addMember
Adds the specified member to the group.- Specified by:
addMember
in interfacecom.k2.security.acl.Group
- Parameters:
principal
- the user to add to this group.- Returns:
- true if the member was successfully added, false if the principal was already a member.
-
removeMember
Removes the specified member from the group.- Specified by:
removeMember
in interfacecom.k2.security.acl.Group
- Parameters:
user
- the principal to remove from this group.- Returns:
- true if the principal was removed, or false if the principal was not a member.
-
isMember
Returns true if the passed principal is a member of the group. This method does a recursive search, so if a principal belongs to a group which is a member of this group, true is returned.- Specified by:
isMember
in interfacecom.k2.security.acl.Group
- Parameters:
member
- the principal whose membership is to be checked.- Returns:
- true if the principal is a member of this group, false otherwise.
-
members
Returns an enumeration of the members in the group. The returned objects can be instances of either Principal or Group (which is a subclass of Principal).- Specified by:
members
in interfacecom.k2.security.acl.Group
- Returns:
- an enumeration of the group members.
-
getMembers
Gets the members of the group- Returns:
- User array containing all the users of the group
-
getGroupInfo
Returns a UserInfo instance for ths group. Only username will be initialized in returned instance.- Returns:
- a new UserInfo instance for this group
-
hashCode
public int hashCode()Gets the hashCode of the name of the group plus a prefix indicating that it's a group (needed to differentiate it from a user with the same name) -
equals
Checks if an object instance is equal to the current group. The object must be an instance of Group and have an equivalent name in order to be considered equal -
compareTo
Compares this object with the specified group for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.It overrides the compareTo from the Comparable interface If the object is null, the method returns -1
- Specified by:
compareTo
in interfaceComparable<Group>
- Parameters:
group
- the group to ne compared with.- Returns:
- the corresponding integer value
- See Also:
-
validateObjectImpl
public void validateObjectImpl()
-