Class Group
- java.lang.Object
-
- org.apache.directory.fortress.core.model.FortEntity
-
- org.apache.directory.fortress.core.model.Group
-
- All Implemented Interfaces:
Serializable
public class Group extends FortEntity implements Serializable
All entities (User, Role, Permission, Policy, SDSet, etc...) are used to carry data between Fortress's layers starting with the (1) Manager layer down thru middle (2) Process layer and it's processing rules into (3) DAO layer where persistence with the LDAP server occurs. The clients must instantiate an Fortress entity before use and must provide enough information to uniquely identity target record for reads.Group Schema
The Fortress Group entity is a composite of 2 different LDAP Schema object classes:
1. groupOfNames Structural Object Class is used to manage groups within LDAP.
------------------------------------------ objectClasses: ( 2.5.6.9 NAME 'groupOfNames' DESC 'RFC2256: a group of names (DNs)' SUP top STRUCTURAL MUST ( member $ cn ) MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) ) ------------------------------------------
2. configGroup STRUCTURAL Object Class is used to store groups and their relationships to users or roles.
------------------------------------------ LDAP Configuration Group Structural Object Class objectClass ( ftObId:8 NAME 'configGroup' DESC 'LDAP Configuration Group' S SUP groupOfNames MUST ( configProtocol $ ftType ) MAY configParameter ) ------------------------------------------
- Author:
- Apache Directory Project
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Group.Type
enum for User or Role data sets.
-
Field Summary
-
Fields inherited from class org.apache.directory.fortress.core.model.FortEntity
adminSession, contextId, modCode, modId, sequenceId
-
-
Constructor Summary
Constructors Constructor Description Group()
Default constructor used byFortressAntTask
defaults to type USER.Group(String name)
Generate instance of group to be loaded as ldap object.Group(String name, String description)
Generate instance of group to be loaded as ldap object.Group(String name, String description, Group.Type type)
Generate instance of group to be loaded as ldap object with node type.Group(String name, Group.Type type)
Generate instance of group to be loaded as ldap object with node type.Group(Group.Type type)
Constructor for base type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(String key, String value)
Add name/value pair to list of properties associated with PermObj.boolean
equals(Object o)
String
getDescription()
Get the description for the domain component.List<String>
getMembers()
Return the membersString
getName()
Get the second level qualifier on the domain component.Properties
getProperties()
Return the collection of name/value pairs to attributes associated with PermObj.String
getProperty(String key)
Get a name/value pair attribute from list of properties associated with PermObj.List<String>
getPropList()
Props
getProps()
Gets the value of the Props property.String
getProtocol()
Get protocol qualifier for this entity.List<UserRole>
getRoles()
List of roles for given groups if they were populated.Group.Type
getType()
Get the required type of Group - 'USER' Or 'ROLE'.int
hashCode()
boolean
isMemberDn()
Set if userDn's are loaded in dn format.void
setDescription(String description)
Set the description for the domain component.void
setMember(String userId)
Add a single userId as member of this entity.void
setMemberDn(boolean memberDn)
Set to 'true' if members are in dn format.void
setMembers(List<String> members)
Set members onto this entity using a List of userIds.void
setMembersWithCsv(String members)
Set a member on this entity using a comma delimited String.void
setName(String name)
Set the second level qualifier on the domain component.void
setProperties(Properties properties)
Replace teh collection of name/value pairs to attributes associated with Group entity.void
setPropertiesWithCsv(String properties)
Add new collection of name=value pairs to attributes associated with Group.void
setProps(Props props)
Sets the value of the Props property.void
setProtocol(String protocol)
Set the protocol qualifier for this entity.void
setRoles(List<UserRole> roles)
Setter for auxiliary 'roles' field.void
setType(Group.Type type)
Set the required type of Group - 'USER' Or 'ROLE'.String
toString()
-
Methods inherited from class org.apache.directory.fortress.core.model.FortEntity
getAdminSession, getContextId, getModCode, getModId, getSequenceId, setAdminSession, setContextId, setModCode, setSequenceId
-
-
-
-
Constructor Detail
-
Group
public Group()
Default constructor used byFortressAntTask
defaults to type USER.
-
Group
public Group(Group.Type type)
Constructor for base type.
-
Group
public Group(String name)
Generate instance of group to be loaded as ldap object.- Parameters:
name
- maps to 'cn' attribute in group object class.
-
Group
public Group(String name, Group.Type type)
Generate instance of group to be loaded as ldap object with node type.- Parameters:
name
- maps to 'cn' attribute in group object class.
-
Group
public Group(String name, String description)
Generate instance of group to be loaded as ldap object.- Parameters:
name
- maps to 'cn' attribute in group object class.description
- maps to 'description' attribute in group object class.
-
Group
public Group(String name, String description, Group.Type type)
Generate instance of group to be loaded as ldap object with node type.- Parameters:
name
- maps to 'cn' attribute in group object class.description
- maps to 'description' attribute in group object class.
-
-
Method Detail
-
getType
public Group.Type getType()
Get the required type of Group - 'USER' Or 'ROLE'.- Returns:
- type that determines what node maps to.
-
setType
public void setType(Group.Type type)
Set the required type of Group - 'USER' Or 'ROLE'.- Parameters:
type
- determines what set the node contains.
-
getName
public String getName()
Get the second level qualifier on the domain component. This attribute is required.- Returns:
- name maps to 'dcObject' object class.
-
setName
public void setName(String name)
Set the second level qualifier on the domain component. This attribute is required.- Parameters:
name
- maps to 'dcObject' object class.
-
getDescription
public String getDescription()
Get the description for the domain component. This value is not required or constrained but is validated on reasonability.- Returns:
- field maps to 'o' attribute on 'dcObject'.
-
setDescription
public void setDescription(String description)
Set the description for the domain component. This value is not required or constrained but is validated on reasonability.- Parameters:
description
- maps to 'o' attribute on 'dcObject'.
-
getProtocol
public String getProtocol()
Get protocol qualifier for this entity.- Returns:
- protocol.
-
setProtocol
public void setProtocol(String protocol)
Set the protocol qualifier for this entity.- Parameters:
protocol
- contains protocol qualifier for this entity.
-
setMember
public void setMember(String userId)
Add a single userId as member of this entity.- Parameters:
userId
-
-
getMembers
public List<String> getMembers()
Return the members- Returns:
- List of type String containing userIds.
-
setMembersWithCsv
public void setMembersWithCsv(String members)
Set a member on this entity using a comma delimited String.- Parameters:
members
- String contains one or more userids in comma delimited format.
-
setMembers
public void setMembers(List<String> members)
Set members onto this entity using a List of userIds.- Parameters:
members
- List of type String contains userIds to be associated as members of this group.
-
addProperty
public void addProperty(String key, String value)
Add name/value pair to list of properties associated with PermObj. These values are not constrained by Fortress. Properties are optional.- Parameters:
key
- contains property name and maps to 'ftProps' attribute in 'ftProperties' aux object class.value
-
-
getProperty
public String getProperty(String key)
Get a name/value pair attribute from list of properties associated with PermObj. These values are not constrained by Fortress. Properties are optional.- Parameters:
key
- contains property name and maps to 'ftProps' attribute in 'ftProperties' aux object class.- Returns:
- value containing name/value pair that maps to 'ftProps' attribute in 'ftProperties' aux object class.
-
setProperties
public void setProperties(Properties properties)
Replace teh collection of name/value pairs to attributes associated with Group entity. These values are not constrained by Fortress. Properties are optional.- Parameters:
properties
- contains collection of name/value pairs and maps to 'ftProps' attribute in 'ftProperties' aux object class.
-
setPropertiesWithCsv
public void setPropertiesWithCsv(String properties)
Add new collection of name=value pairs to attributes associated with Group. These values are not constrained by Fortress. Properties are optional.- Parameters:
properties
- contains name=value pairs that are comma delmited.
-
getProperties
public Properties getProperties()
Return the collection of name/value pairs to attributes associated with PermObj. These values are not constrained by Fortress. Properties are optional.- Returns:
- Properties contains collection of name/value pairs and maps to 'ftProps' attribute in 'ftProperties' aux object class.
-
getProps
public Props getProps()
Gets the value of the Props property. This method is used by Fortress Core and Rest and should not be called by external programs.- Returns:
Props
-
setProps
public void setProps(Props props)
Sets the value of the Props property. This method is used by Fortress Core and Rest and should not be called by external programs.- Parameters:
props
- allowed object isProps
-
isMemberDn
public boolean isMemberDn()
Set if userDn's are loaded in dn format.- Returns:
- true indicates members are in dn format.
-
setMemberDn
public void setMemberDn(boolean memberDn)
Set to 'true' if members are in dn format.- Parameters:
memberDn
- boolean value, set to 'true' if distinguished name (dn) format, 'false' if relative distinguished name (rdn) format.
-
getRoles
public List<UserRole> getRoles()
List of roles for given groups if they were populated. Empty list otherwise.- Returns:
-
setRoles
public void setRoles(List<UserRole> roles)
Setter for auxiliary 'roles' field.- Parameters:
roles
- list of roles to be set
-
-