public class GroupRecord extends Object implements Comparable<GroupRecord>, Cloneable, Serializable
groupOfNames
or posixGroup
), sortable by cn
. The following properties
only apply to groupOfNames
-style groups: memberDNs
, membershipHidden
,
owners
, ownerDNs
, applications
. Some of these will throw exceptions
if used inappropriately, others will just be ignored by LdapService
.Modifier and Type | Class and Description |
---|---|
static class |
GroupRecord.Type
Types of record, corresponding to LDAP objectClasses.
|
Constructor and Description |
---|
GroupRecord() |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
int |
compareTo(GroupRecord o) |
boolean |
equals(Object o) |
Map<String,String> |
getApplications()
Gets an immutable view of the map of application data, which may be empty but will never
be
null . |
Map<String,String> |
getApplicationsCopy()
Gets a copy of the map of application data, which may be empty but will never be
null . |
String |
getCn() |
String |
getDescription() |
String |
getDistinguishedName() |
int |
getGidNumber()
Returns the
gidNumber (posixGroup s only). |
SortedSet<String> |
getMemberDNs()
Gets an immutable view of the set of member distinguished names, which may be empty but will
never be
null . |
SortedSet<String> |
getMemberDNsCopy()
Gets a copy of the set of member distinguished names, which may be empty but will never
be
null . |
SortedSet<String> |
getMembers()
Gets a mutable copy of the set of member usernames, which may be empty but will never be
null . |
SortedSet<String> |
getOwnerDNs()
Gets an immutable view of the set of owner distinguished names,
which may be empty but will never be
null . |
SortedSet<String> |
getOwnerDNsCopy()
Gets a copy of the set of owner distinguished names, which may be empty but will never be
null . |
SortedSet<String> |
getOwners()
Gets a mutable copy of the set of owner usernames, which may be empty but will never be
null . |
GroupRecord.Type |
getRecordType() |
int |
hashCode() |
boolean |
isMembershipHidden() |
boolean |
isMembersOmitted() |
void |
setApplications(Map<String,String> applications)
Sets the
Map of application data key-value pairs. |
void |
setCn(String cn) |
void |
setDescription(String description) |
void |
setDistinguishedName(String distinguishedName) |
void |
setGidNumber(int gidNumber)
Sets the
gidNumber (posixGroup s only). |
void |
setMemberDNs(Set<String> memberDNs)
Sets the set of member distinguished names.
|
void |
setMembers(Set<String> memberUsernames)
Sets the set of members from usernames.
|
void |
setMembershipHidden(boolean membershipHidden) |
void |
setMembersOmitted(boolean membersOmitted) |
void |
setOwnerDNs(Set<String> ownerDNs)
Sets the set of owner distinguished names.
|
void |
setOwners(Set<String> owners)
Sets the set of owners from usernames.
|
void |
setRecordType(GroupRecord.Type recordType) |
String |
toString() |
public GroupRecord.Type getRecordType()
public void setRecordType(GroupRecord.Type recordType)
public String getDistinguishedName()
public void setDistinguishedName(String distinguishedName)
public String getCn()
public void setCn(String cn)
public int getGidNumber()
gidNumber
(posixGroup
s only).gidNumber
, or zero if unsetpublic void setGidNumber(int gidNumber)
gidNumber
(posixGroup
s only).gidNumber
- the gidNumber
to set, or zeroIllegalStateException
- if attempting to set non-zero for a non-POSIX grouppublic String getDescription()
public void setDescription(String description)
public boolean isMembershipHidden()
public void setMembershipHidden(boolean membershipHidden)
public boolean isMembersOmitted()
true
if the membership of the group has been omitted from this
GroupRecord
instancepublic void setMembersOmitted(boolean membersOmitted)
membersOmitted
- set to true
to indicate that the membership of the group has
been omitted from this GroupRecord
instancepublic SortedSet<String> getMemberDNs()
null
.IllegalStateException
- if the recordType
is unset or POSIX
public SortedSet<String> getMemberDNsCopy()
null
.IllegalStateException
- if the recordType
is unset or POSIX
public SortedSet<String> getMembers()
null
.IllegalStateException
- if the recordType
is unset or if unable to convert a DN
to a username (groupOfNames
only)public void setMemberDNs(Set<String> memberDNs)
Set
object provided. Limited checking of the DN format is performed.memberDNs
- a Set
of member distinguished names, or null
IllegalArgumentException
- if the format of a DN is detected as invalidIllegalStateException
- if the recordType
is unset or POSIX
public void setMembers(Set<String> memberUsernames)
Set
provided.memberUsernames
- a set of member usernames, or null
IllegalStateException
- if the recordType
is unsetIllegalArgumentException
- if invalid usernames are passedpublic SortedSet<String> getOwnerDNs()
null
.public SortedSet<String> getOwnerDNsCopy()
null
.public SortedSet<String> getOwners() throws NamingException
null
.NamingException
- if unable to convert a DN to a usernamepublic void setOwnerDNs(Set<String> ownerDNs) throws InvalidNameException
Set
object provided. Limited checking of the DN format is performed.ownerDNs
- a Set
of owner distinguished names, or null
InvalidNameException
- if the format of a DN is detected as invalidpublic void setOwners(Set<String> owners)
owners
- A set of owner usernames, or null
public Map<String,String> getApplications()
null
.public Map<String,String> getApplicationsCopy()
null
.public void setApplications(Map<String,String> applications)
Map
of application data key-value pairs. A copy is taken so there is no ongoing
dependency on the Map
object provided.applications
- a Map
of application data, or null
to clearIllegalArgumentException
- if application strings don't comply to the required formatpublic int compareTo(GroupRecord o)
compareTo
in interface Comparable<GroupRecord>
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2018. All rights reserved.