|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.digitalis.utils.ldap.impl.AbstractLDAPUtils
public abstract class AbstractLDAPUtils
Defines a set operations common to all LDAP implementations.
Field Summary | |
---|---|
protected static String |
CN_TAG
The "CN=" constant string. |
protected LDAPConfigurations |
ldapConfigurations
The LDAP configurations. |
protected static String |
NON_AVAILABLE
The 'N/A' constant string. |
Constructor Summary | |
---|---|
AbstractLDAPUtils()
|
Method Summary | |
---|---|
void |
addGroup(LDAPGroup newGroup)
Adds a new group to the LDAP tree. |
void |
addGroupAttribute(String commonName,
String attributeName,
Object value)
Adds an attribute to a given group. |
void |
addUser(LDAPUser newUser)
Adds a new user to the LDAP tree. |
void |
addUserAttribute(String loginName,
String attributeName,
Object value)
Adds an attribute to a given user. |
void |
addUserToGroup(String groupCN,
String userLogin)
Adds a user from a given group. |
protected abstract String |
calculateDistinguishedName(String commonName,
String mainGroupCommonName)
Calculates an entity's distinguished name. |
abstract void |
changePassword(String loginName,
String newPassword)
Changes the password for a given user. |
protected LDAPGroup |
convertFromAttributesToLDAPGroup(Attributes attributes,
String distinguishedName)
Converts an Attributes object into an LDAPGroup. |
protected LDAPUser |
convertFromAttributesToLDAPUser(Attributes attributes,
String distinguishedName)
Converts an Attributes object into an LDAPUser. |
protected LDAPUser |
convertFromAttributesToLDAPUser(Attributes attributes,
String distinguishedName,
boolean convertAttributes)
Converts an Attributes object into an LDAPUser. |
protected LDAPGroup |
convertFromSearchResultToLDAPGroup(SearchResult searchResult)
Converts a SearchResult object into an LDAPGroup. |
protected LDAPUser |
convertFromSearchResultToLDAPUser(SearchResult searchResult)
Converts a SearchResult object into an LDAPUser. |
protected LDAPUser |
convertFromSearchResultToLDAPUser(SearchResult searchResult,
boolean convertAttributes)
Converts a SearchResult object into an LDAPUser. |
protected Map<String,Object> |
convertFromSearchResultToMap(SearchResult searchResult)
Converts a search result into a map. |
int |
countAllfUsers(String groupId)
Count allf users. |
int |
countAllGroups()
Counts all groups in the LDAP directory |
int |
countAllGroupsOfUser(String loginName)
Counts all groups of a user |
int |
countAllUsers()
Counts all users in the LDAP directory |
int |
countUsers(Map<String,String> attributes)
Count users in the LDAP directory which match the provided attributes |
List<SearchResult> |
doLDAPCount(LdapContext context,
String baseNode,
String searchCriteria)
Performs a lightweight search on LDAP, for counting purposes. |
List<SearchResult> |
doLDAPSearchMultipleReturns(LdapContext context,
String baseNode,
String searchCriteria)
Performs an LDAP tree search that can return multiple values. |
List<SearchResult> |
doLDAPSearchMultipleReturnsPaging(LdapContext context,
String baseNode,
String searchCriteria,
int rowsPerPage,
Integer pageToReturn)
Performs an LDAP tree search that can return multiple values. |
Set<LDAPGroup> |
findAllGroups()
Returns the list of all groups. |
Set<LDAPUser> |
findAllUsers()
Returns the list of all users. |
LDAPGroup |
findGroupByCommonName(String cn)
Returns the group with a given common name. |
LDAPGroup |
findGroupByDistinguishedName(String dn)
Returns the group with a given distinguished name. |
Set<LDAPGroup> |
findGroups(int rowsPerPage,
int pageToReturn)
Finds a subset of all the groups, according to the parameters |
Set<LDAPGroup> |
findGroupsOfUser(String loginName)
Returns the list of a given user's groups. |
Set<LDAPGroup> |
findGroupsOfUserPagination(String loginName,
int rowsPerPage,
int pageToReturn)
Returns the list of a given user's groups, with pagination |
LDAPUser |
findUserByDistinguishedName(String dn)
Returns the user with a given distinguished name. |
LDAPUser |
findUserByLogin(String loginName)
Returns the user with a given login name. |
LDAPUser |
findUserByLogin(String loginName,
boolean convertAttributes)
Returns the user with a given login name. |
Set<LDAPUser> |
findUsers(int rowsPerPage,
int pageToReturn)
Finds a subset of all the users, according to the parameters |
Set<LDAPUser> |
findUsersByAttribute(String attribute,
String value)
Returns the list of users with a given attribute value. |
Set<LDAPUser> |
findUsersByAttributes(Map<String,String> attributes)
Finds a set of LDAP users that match all of the specified criteria |
Set<LDAPUser> |
findUsersByAttributes(Map<String,String> attributes,
int rowsPerPage,
int pageToReturn)
Finds a set of LDAP users that match all of the specified criteria |
Set<LDAPUser> |
findUsersByEmail(String value)
Returns the list of users with a given email attribute value. |
Map<String,LDAPUser> |
findUsersInGroup(String groupCN)
Checks if a given user belongs to a given group. |
protected Attributes |
getAttributesForGroupAddition(LDAPGroup newGroup)
Prepares the LDAP attributes for group addition. |
protected Attributes |
getAttributesForUserAddition(LDAPUser newUser)
Prepares the LDAP attributes for user addition. |
protected SearchResult |
getByDistinguishedName(String distinguishedName)
Finds an entity by distinguished name. |
protected SearchResult |
getByLogin(String loginName)
Finds an user by login name. |
Set<LDAPGroup> |
getChildGroupsByCN(String commonName)
Returns the list of groups that belong to a parent group given its common name. |
Set<LDAPGroup> |
getChildGroupsByDN(String distinguishedName)
Returns the list of groups that belong to a parent group given its distinguished name. |
protected static String |
getCNFromDN(String distinguishedName)
Extracts the common name from the distinguished name. |
protected String |
getCommonName()
Returns the standard LDAP name for the 'cn' attribute. |
LDAPConfigurations |
getConfigurations()
Inspector for the LDAP configurations object. |
protected String |
getDescriptionAttributeName()
Returns the standard LDAP name for the 'description' attribute. |
protected String |
getDisplayNameAttributeName()
Returns the standard LDAP name for the 'displayName' attribute. |
protected String |
getGivenNameAttributeName()
Returns the standard LDAP name for the 'givenName' attribute. |
Object |
getGroupAttribute(String attributeName,
String commonName)
Returns a given attribute or null of it doesn't exists. |
String |
getGroupAttributeName()
Gets the name attribute name |
Map<String,Object> |
getGroupAttributes(String commonName)
Returns the attribute map. |
protected SearchResult |
getGroupByCommonName(String cn)
Finds an entity by common name. |
protected LDAPGroup |
getGroupByDistinguishedName(String distinguishedName)
Finds a group by distinguished name. |
protected abstract String |
getGroupClassName()
Returns the standard LDAP name for the 'group' attribute. |
protected String |
getGroupIdentifierName()
Returns the group identifier name. |
abstract String |
getGroupParentGroupAttributeName()
Returns the implementation dependent name for the LDAP attribute that stores the group's parent group. |
protected LdapContext |
getLDAPContext()
Returns the LDAP context to use for search and modification operations. |
protected static pt.digitalis.log.ILogWrapper |
getLogger()
Inspector for the 'logger' attribute. |
String |
getMailAttributeName()
Returns the standard LDAP name for the 'e-mail' attribute. |
String |
getNameAttributeName()
Returns the standard LDAP name for the 'name' attribute. |
String |
getNonAvailableValue()
Get the Non Available Message. |
protected String |
getObjectClassName()
Returns the 'objectClass' attribute name. |
protected String |
getPasswordAttributeName()
Returns the standard LDAP name for the 'password' attribute. |
protected LdapContext |
getSecureLDAPContext()
Returns the LDAP context to use for search and modification operations with a secure connection. |
protected String |
getSurnameAttributeName()
Returns the standard LDAP name for the 'surname' attribute. |
Object |
getUserAttribute(String attributeName,
String loginName)
Returns a given attribute or null of it doesn't exists. |
Map<String,Object> |
getUserAttributes(String loginName)
Returns the attribute map. |
protected LDAPUser |
getUserByDistinguishedName(String distinguishedName)
Finds an user by distinguished name. |
protected abstract String |
getUserClassName()
Returns the standard LDAP name for the 'user' attribute. |
protected String |
getUserIdentifierName()
Returns the user identifier name. |
protected SearchResult |
getUserInGroup(String userLogin,
String groupCN)
Finds a user with a given login name on a given group. |
String |
getUserLoginAttributeName()
Gets the user login attribute name |
String |
getUserParentGroupAttributeName()
Returns the parent group attribute name. |
boolean |
groupContainsAttribute(String attributeName,
String commonName)
Group contains attribute. |
boolean |
groupExists(String groupCN)
Checks if a given group exists on the LDAP tree. |
boolean |
isIdentityValid(String loginName,
String suppliedPassword)
Checks if the supplied password matches the one defined for a user with a given ID. |
boolean |
isReadOnly()
Get the ldap readOnly configuration value. |
boolean |
isUserInGroup(String groupCN,
String userLogin)
Checks if a given user belongs to a given group. |
protected void |
modifyAttributes(String distinguishedName,
ModificationItem[] mods,
boolean secure)
Modifies the passed attributes of an entity with the given DN. |
static byte[] |
parseControls(Control[] controls)
Parses the controls. |
void |
removeGroup(String groupCN)
Removes an existing group from the LDAP tree. |
void |
removeGroupAttribute(String commonName,
String attributeName)
Removes an attribute from a given group. |
void |
removeUser(String loginName)
Removes an existing user from the LDAP tree. |
void |
removeUserAttribute(String loginName,
String attributeName)
Removes an attribute from a given user. |
void |
removeUserFromGroup(String groupCN,
String userLogin)
Removes a user from a given group. |
void |
resetConfigurations()
Resets the LDAP configurations. |
void |
setGroupAttribute(String commonName,
String attributeName,
Object value)
Sets a given attribute value. |
void |
setLogger(pt.digitalis.log.ILogWrapper logger)
Set the API logger |
void |
setUserAttribute(String loginName,
String attributeName,
Object value)
Sets the a given attribute value. |
void |
updateGroup(LDAPGroup groupToUpdate,
String groupCN)
Updates an existing group on the LDAP tree. |
void |
updateUser(LDAPUser userToUpdate,
String userLogin)
Updates an existing user on the LDAP tree. |
boolean |
userContainsAttribute(String id,
String loginName)
Checks if a given attribute belongs to the entity. |
boolean |
userExists(String loginName)
Checks if a user exists on the LDAP tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface pt.digitalis.utils.ldap.ILDAPUtils |
---|
getUnchangeableLDAPAttributes |
Field Detail |
---|
protected static final String CN_TAG
protected static final String NON_AVAILABLE
protected LDAPConfigurations ldapConfigurations
Constructor Detail |
---|
public AbstractLDAPUtils()
Method Detail |
---|
protected static final String getCNFromDN(String distinguishedName)
distinguishedName
- the distinguished name to process
protected static pt.digitalis.log.ILogWrapper getLogger()
public static byte[] parseControls(Control[] controls) throws NamingException
controls
- the controls
NamingException
- the naming exceptionpublic void addGroup(LDAPGroup newGroup) throws LDAPOperationException
ILDAPUtils
addGroup
in interface ILDAPUtils
newGroup
- the group to add
LDAPOperationException
- if the group can't be createdILDAPUtils.addGroup(pt.digitalis.utils.ldap.LDAPGroup)
public void addGroupAttribute(String commonName, String attributeName, Object value) throws LDAPOperationException
ILDAPUtils
addGroupAttribute
in interface ILDAPUtils
commonName
- the group's common nameattributeName
- the attribute namevalue
- the attribute value
LDAPOperationException
ILDAPUtils.addGroupAttribute(java.lang.String, java.lang.String, java.lang.Object)
public void addUser(LDAPUser newUser) throws LDAPOperationException
ILDAPUtils
addUser
in interface ILDAPUtils
newUser
- the new user to add to the LDAP server
LDAPOperationException
- if the user can't be createdILDAPUtils.addUser(pt.digitalis.utils.ldap.LDAPUser)
public void addUserAttribute(String loginName, String attributeName, Object value) throws LDAPOperationException
ILDAPUtils
addUserAttribute
in interface ILDAPUtils
loginName
- the user login nameattributeName
- the attribute namevalue
- the attribute value
LDAPOperationException
- if the attribute can't be addedILDAPUtils.addUserAttribute(java.lang.String, java.lang.String, java.lang.Object)
public void addUserToGroup(String groupCN, String userLogin) throws LDAPOperationException
ILDAPUtils
addUserToGroup
in interface ILDAPUtils
groupCN
- the CN of the groupuserLogin
- the login name of the user to add
LDAPOperationException
- if the user groups can't be addedILDAPUtils.addUserToGroup(java.lang.String, java.lang.String)
protected abstract String calculateDistinguishedName(String commonName, String mainGroupCommonName) throws LDAPOperationException
commonName
- the entity's common namemainGroupCommonName
- the entity's main group name
LDAPOperationException
- if the distinguished name can't be calculatedpublic abstract void changePassword(String loginName, String newPassword) throws LDAPOperationException
ILDAPUtils
changePassword
in interface ILDAPUtils
loginName
- the login name of the user to change the passwordnewPassword
- the new password to set
LDAPOperationException
- if the operation cannot be executedILDAPUtils.changePassword(java.lang.String, java.lang.String)
protected LDAPGroup convertFromAttributesToLDAPGroup(Attributes attributes, String distinguishedName)
attributes
- the object to convertdistinguishedName
- the group DN
protected LDAPUser convertFromAttributesToLDAPUser(Attributes attributes, String distinguishedName)
attributes
- the object to convertdistinguishedName
- the user DN
protected LDAPUser convertFromAttributesToLDAPUser(Attributes attributes, String distinguishedName, boolean convertAttributes)
attributes
- the object to convertdistinguishedName
- the user DNconvertAttributes
- the convert attributes
protected LDAPGroup convertFromSearchResultToLDAPGroup(SearchResult searchResult)
searchResult
- the object to convert
protected LDAPUser convertFromSearchResultToLDAPUser(SearchResult searchResult)
searchResult
- the object to convert
protected LDAPUser convertFromSearchResultToLDAPUser(SearchResult searchResult, boolean convertAttributes)
searchResult
- the object to convertconvertAttributes
- the convert attributes
protected final Map<String,Object> convertFromSearchResultToMap(SearchResult searchResult) throws LDAPOperationException
searchResult
- the search result object
LDAPOperationException
- if the conversion can't be performedpublic int countAllfUsers(String groupId) throws LDAPOperationException
countAllfUsers
in interface ILDAPUtils
groupId
- the group id
LDAPOperationException
- the lDAP operation exceptionILDAPUtils.countAllfUsers(java.lang.String)
public int countAllGroups() throws NamingException, LDAPOperationException
ILDAPUtils
countAllGroups
in interface ILDAPUtils
NamingException
LDAPOperationException
ILDAPUtils.countAllGroups()
public int countAllGroupsOfUser(String loginName) throws NamingException, LDAPOperationException
ILDAPUtils
countAllGroupsOfUser
in interface ILDAPUtils
loginName
- The user login name
NamingException
LDAPOperationException
ILDAPUtils.countAllGroupsOfUser(java.lang.String)
public int countAllUsers() throws NamingException, LDAPOperationException
ILDAPUtils
countAllUsers
in interface ILDAPUtils
NamingException
LDAPOperationException
ILDAPUtils.countAllUsers()
public int countUsers(Map<String,String> attributes) throws LDAPOperationException
ILDAPUtils
countUsers
in interface ILDAPUtils
attributes
- The attributes to be considered in the search
LDAPOperationException
- if the operation can't be executedILDAPUtils.countUsers(java.util.Map)
public List<SearchResult> doLDAPCount(LdapContext context, String baseNode, String searchCriteria) throws NamingException, LDAPOperationException, IOException
context
- a valid Ldap contextbaseNode
- the base node to start the searchsearchCriteria
- the criteria to search
NamingException
- if the search cannot be executed
LDAPOperationException
- if there is an error creating the LDAP context
IOException
- Signals that an I/O exception has occurred.public List<SearchResult> doLDAPSearchMultipleReturns(LdapContext context, String baseNode, String searchCriteria) throws NamingException, LDAPOperationException, IOException
context
- a valid Ldap contextbaseNode
- the base node to start the searchsearchCriteria
- the criteria to search
NamingException
- if the search cannot be executed
LDAPOperationException
- if there is an error creating the LDAP context
IOException
- Signals that an I/O exception has occurred.public List<SearchResult> doLDAPSearchMultipleReturnsPaging(LdapContext context, String baseNode, String searchCriteria, int rowsPerPage, Integer pageToReturn) throws NamingException, LDAPOperationException, IOException
context
- a valid Ldap contextbaseNode
- the base node to start the searchsearchCriteria
- the criteria to searchrowsPerPage
- the request number of results limitpageToReturn
- the page to return, null if all pages must be returned
NamingException
- if the search cannot be executed
LDAPOperationException
- if there is an error creating the LDAP context
IOException
- Signals that an I/O exception has occurred.public Set<LDAPGroup> findAllGroups() throws LDAPOperationException
ILDAPUtils
findAllGroups
in interface ILDAPUtils
LDAPOperationException
- if the operation can't be executedILDAPUtils.findAllGroups()
public Set<LDAPUser> findAllUsers() throws LDAPOperationException
ILDAPUtils
findAllUsers
in interface ILDAPUtils
LDAPOperationException
- if the operation can't be executedILDAPUtils.findAllUsers()
public LDAPGroup findGroupByCommonName(String cn) throws LDAPOperationException
ILDAPUtils
findGroupByCommonName
in interface ILDAPUtils
cn
- the group's common name
LDAPOperationException
- if the operation cannot be executedILDAPUtils.findGroupByCommonName(java.lang.String)
public LDAPGroup findGroupByDistinguishedName(String dn) throws LDAPOperationException
ILDAPUtils
findGroupByDistinguishedName
in interface ILDAPUtils
dn
- the group's distinguished name
LDAPOperationException
- if the operation cannot be executedILDAPUtils.findGroupByDistinguishedName(java.lang.String)
public Set<LDAPGroup> findGroups(int rowsPerPage, int pageToReturn) throws LDAPOperationException
ILDAPUtils
findGroups
in interface ILDAPUtils
rowsPerPage
- The number of rows per pagepageToReturn
- The page number to return
LDAPOperationException
- if the operation cannot be executed.ILDAPUtils.findGroups(int, int)
public Set<LDAPGroup> findGroupsOfUser(String loginName) throws LDAPOperationException
ILDAPUtils
findGroupsOfUser
in interface ILDAPUtils
loginName
- the user's login name
LDAPOperationException
- if the operation can't be executedILDAPUtils.findGroupsOfUser(java.lang.String)
public Set<LDAPGroup> findGroupsOfUserPagination(String loginName, int rowsPerPage, int pageToReturn) throws LDAPOperationException
ILDAPUtils
findGroupsOfUserPagination
in interface ILDAPUtils
loginName
- the user's login namerowsPerPage
- The number of results per pagepageToReturn
- The page number to return
LDAPOperationException
- if the operation can't be executedILDAPUtils.findGroupsOfUserPagination(java.lang.String, int, int)
public LDAPUser findUserByDistinguishedName(String dn) throws LDAPOperationException
ILDAPUtils
findUserByDistinguishedName
in interface ILDAPUtils
dn
- the user's login name
LDAPOperationException
- if the operation cannot be executedILDAPUtils.findUserByDistinguishedName(java.lang.String)
public LDAPUser findUserByLogin(String loginName) throws LDAPOperationException
ILDAPUtils
findUserByLogin
in interface ILDAPUtils
loginName
- the user's login name
LDAPOperationException
- if the operation cannot be executedILDAPUtils.findUserByLogin(java.lang.String)
public LDAPUser findUserByLogin(String loginName, boolean convertAttributes) throws LDAPOperationException
loginName
- the user's login nameconvertAttributes
- the convert attributes
LDAPOperationException
- if the operation cannot be executedpublic Set<LDAPUser> findUsers(int rowsPerPage, int pageToReturn) throws LDAPOperationException
ILDAPUtils
findUsers
in interface ILDAPUtils
rowsPerPage
- The number of rows per pagepageToReturn
- The page number to return
LDAPOperationException
ILDAPUtils.findUsers(int, int)
public Set<LDAPUser> findUsersByAttribute(String attribute, String value) throws LDAPOperationException
ILDAPUtils
findUsersByAttribute
in interface ILDAPUtils
attribute
- the attribute to searchvalue
- the value for the attribute
LDAPOperationException
- if the operation cannot be executedILDAPUtils.findUsersByAttribute(java.lang.String, java.lang.String)
public Set<LDAPUser> findUsersByAttributes(Map<String,String> attributes) throws LDAPOperationException
ILDAPUtils
findUsersByAttributes
in interface ILDAPUtils
attributes
- A map of (attribute, attribute value) pairs
LDAPOperationException
- if the operation cannot be executedILDAPUtils.findUsersByAttributes(java.util.Map)
public Set<LDAPUser> findUsersByAttributes(Map<String,String> attributes, int rowsPerPage, int pageToReturn) throws LDAPOperationException
ILDAPUtils
findUsersByAttributes
in interface ILDAPUtils
attributes
- A map of (attribute, attribute value) pairsrowsPerPage
- The number of results per pagepageToReturn
- The number of the page to return
LDAPOperationException
- if the operation cannot be executedILDAPUtils.findUsersByAttributes(java.util.Map, int, int)
public Set<LDAPUser> findUsersByEmail(String value) throws LDAPOperationException
ILDAPUtils
findUsersByEmail
in interface ILDAPUtils
value
- the value for the attribute email
LDAPOperationException
- if the operation cannot be executedILDAPUtils.findUsersByEmail(java.lang.String)
public Map<String,LDAPUser> findUsersInGroup(String groupCN) throws LDAPOperationException
ILDAPUtils
findUsersInGroup
in interface ILDAPUtils
groupCN
- the group's CN
LDAPOperationException
- if the operation can't be executedILDAPUtils.findUsersInGroup(java.lang.String)
protected Attributes getAttributesForGroupAddition(LDAPGroup newGroup) throws LDAPOperationException
newGroup
- the group to add
LDAPOperationException
- if the attribute list can't be preparedprotected Attributes getAttributesForUserAddition(LDAPUser newUser) throws LDAPOperationException
newUser
- the user to add
LDAPOperationException
- if the attribute list can't be preparedprotected SearchResult getByDistinguishedName(String distinguishedName) throws LDAPOperationException
distinguishedName
- the distinguished name
LDAPOperationException
- if operation cannot be performedprotected SearchResult getByLogin(String loginName) throws LDAPOperationException
loginName
- the login name of the user to find
LDAPOperationException
- if operation cannot be performedpublic Set<LDAPGroup> getChildGroupsByCN(String commonName) throws LDAPOperationException
ILDAPUtils
getChildGroupsByCN
in interface ILDAPUtils
commonName
- the parent group's common name
LDAPOperationException
- if the operation can't be executedILDAPUtils.getChildGroupsByCN(java.lang.String)
public Set<LDAPGroup> getChildGroupsByDN(String distinguishedName) throws LDAPOperationException
ILDAPUtils
getChildGroupsByDN
in interface ILDAPUtils
distinguishedName
- the parent group's distinguished name
LDAPOperationException
- if the operation can't be executedILDAPUtils.getChildGroupsByDN(java.lang.String)
protected final String getCommonName()
public LDAPConfigurations getConfigurations()
ILDAPUtils
getConfigurations
in interface ILDAPUtils
ILDAPUtils.getConfigurations()
protected String getDescriptionAttributeName()
protected String getDisplayNameAttributeName()
protected String getGivenNameAttributeName()
public Object getGroupAttribute(String attributeName, String commonName) throws LDAPOperationException
ILDAPUtils
getGroupAttribute
in interface ILDAPUtils
attributeName
- the attribute namecommonName
- the group common name
LDAPOperationException
- if the user attribute can't be fetchedILDAPUtils.getGroupAttribute(java.lang.String, java.lang.String)
public String getGroupAttributeName()
ILDAPUtils
getGroupAttributeName
in interface ILDAPUtils
ILDAPUtils.getGroupAttributeName()
public Map<String,Object> getGroupAttributes(String commonName) throws LDAPOperationException
ILDAPUtils
getGroupAttributes
in interface ILDAPUtils
commonName
- the group common name
LDAPOperationException
- if the user attributes can't be fetchedILDAPUtils.getGroupAttributes(java.lang.String)
protected SearchResult getGroupByCommonName(String cn) throws LDAPOperationException
cn
- the common name
LDAPOperationException
- if operation cannot be performedprotected LDAPGroup getGroupByDistinguishedName(String distinguishedName) throws LDAPOperationException
distinguishedName
- the distinguished name
LDAPOperationException
- if operation cannot be performedprotected abstract String getGroupClassName()
protected final String getGroupIdentifierName()
public abstract String getGroupParentGroupAttributeName()
protected final LdapContext getLDAPContext() throws LDAPOperationException
LDAPOperationException
- if the context can't be created.public String getMailAttributeName()
getMailAttributeName
in interface ILDAPUtils
public String getNameAttributeName()
getNameAttributeName
in interface ILDAPUtils
public String getNonAvailableValue()
ILDAPUtils
getNonAvailableValue
in interface ILDAPUtils
ILDAPUtils.getNonAvailableValue()
protected final String getObjectClassName()
protected String getPasswordAttributeName()
protected final LdapContext getSecureLDAPContext() throws LDAPOperationException
LDAPOperationException
- if the context can't be created.protected String getSurnameAttributeName()
public Object getUserAttribute(String attributeName, String loginName) throws LDAPOperationException
ILDAPUtils
getUserAttribute
in interface ILDAPUtils
attributeName
- the attribute nameloginName
- the user login name
LDAPOperationException
- if the user attribute can't be fetchedILDAPUtils.getUserAttribute(java.lang.String, java.lang.String)
public Map<String,Object> getUserAttributes(String loginName) throws LDAPOperationException
ILDAPUtils
getUserAttributes
in interface ILDAPUtils
loginName
- the user login name
LDAPOperationException
- if the user attributes can't be fetchedILDAPUtils.getUserAttributes(java.lang.String)
protected LDAPUser getUserByDistinguishedName(String distinguishedName) throws LDAPOperationException
distinguishedName
- the distinguished name
LDAPOperationException
- if operation cannot be performedprotected abstract String getUserClassName()
protected final String getUserIdentifierName()
protected SearchResult getUserInGroup(String userLogin, String groupCN) throws LDAPOperationException
userLogin
- the user's login namegroupCN
- the group's common name
LDAPOperationException
- if the user can't be fetchedpublic String getUserLoginAttributeName()
ILDAPUtils
getUserLoginAttributeName
in interface ILDAPUtils
ILDAPUtils.getUserLoginAttributeName()
public String getUserParentGroupAttributeName()
ILDAPUtils
getUserParentGroupAttributeName
in interface ILDAPUtils
ILDAPUtils.getUserParentGroupAttributeName()
public boolean groupContainsAttribute(String attributeName, String commonName) throws LDAPOperationException
groupContainsAttribute
in interface ILDAPUtils
attributeName
- the attribute namecommonName
- the common name
LDAPOperationException
- the lDAP operation exceptionILDAPUtils.groupContainsAttribute(java.lang.String, java.lang.String)
public boolean groupExists(String groupCN) throws LDAPOperationException
ILDAPUtils
groupExists
in interface ILDAPUtils
groupCN
- the group's CN
LDAPOperationException
- if the operation can't be executedILDAPUtils.groupExists(java.lang.String)
public boolean isIdentityValid(String loginName, String suppliedPassword) throws LDAPOperationException
ILDAPUtils
isIdentityValid
in interface ILDAPUtils
loginName
- the user IDsuppliedPassword
- the supplied user password
LDAPOperationException
- if the operation cannot be executedILDAPUtils.isIdentityValid(java.lang.String, java.lang.String)
public boolean isReadOnly()
ILDAPUtils
isReadOnly
in interface ILDAPUtils
ILDAPUtils.isReadOnly()
public boolean isUserInGroup(String groupCN, String userLogin) throws LDAPOperationException
ILDAPUtils
isUserInGroup
in interface ILDAPUtils
groupCN
- the group's CNuserLogin
- the user's login name
LDAPOperationException
- if the operation can't be executedILDAPUtils.isUserInGroup(java.lang.String, java.lang.String)
protected final void modifyAttributes(String distinguishedName, ModificationItem[] mods, boolean secure) throws LDAPOperationException
distinguishedName
- the DN of the entity to modifymods
- the attributes to modifysecure
- if the connection is secure
LDAPOperationException
- if the attributes can't be modifiedpublic void removeGroup(String groupCN) throws LDAPOperationException
ILDAPUtils
removeGroup
in interface ILDAPUtils
groupCN
- the group to add
LDAPOperationException
- if the group can't be removedILDAPUtils.removeGroup(java.lang.String)
public void removeGroupAttribute(String commonName, String attributeName) throws LDAPOperationException
ILDAPUtils
removeGroupAttribute
in interface ILDAPUtils
commonName
- the group's common nameattributeName
- the attribute name
LDAPOperationException
ILDAPUtils.removeGroupAttribute(java.lang.String, java.lang.String)
public void removeUser(String loginName) throws LDAPOperationException
ILDAPUtils
removeUser
in interface ILDAPUtils
loginName
- the id of the user to remove
LDAPOperationException
- if the user can't be removedILDAPUtils.removeUser(java.lang.String)
public void removeUserAttribute(String loginName, String attributeName) throws LDAPOperationException
ILDAPUtils
removeUserAttribute
in interface ILDAPUtils
loginName
- the user login nameattributeName
- the attribute name
LDAPOperationException
- if the attribute can't be addedILDAPUtils.removeUserAttribute(java.lang.String, java.lang.String)
public void removeUserFromGroup(String groupCN, String userLogin) throws LDAPOperationException
ILDAPUtils
removeUserFromGroup
in interface ILDAPUtils
groupCN
- the CN of the groupuserLogin
- the login name of the user to remove
LDAPOperationException
- if the user groups can't be removedILDAPUtils.removeUserFromGroup(java.lang.String, java.lang.String)
public void resetConfigurations()
ILDAPUtils
resetConfigurations
in interface ILDAPUtils
ILDAPUtils.resetConfigurations()
public void setGroupAttribute(String commonName, String attributeName, Object value) throws LDAPOperationException
ILDAPUtils
setGroupAttribute
in interface ILDAPUtils
commonName
- the user login nameattributeName
- the attribute namevalue
- the attribute value
LDAPOperationException
- if the attribute can't be setILDAPUtils.setGroupAttribute(java.lang.String, java.lang.String, java.lang.Object)
public void setLogger(pt.digitalis.log.ILogWrapper logger)
ILDAPUtils
setLogger
in interface ILDAPUtils
logger
- the new logger value to setILDAPUtils.setLogger(pt.digitalis.log.ILogWrapper)
public void setUserAttribute(String loginName, String attributeName, Object value) throws LDAPOperationException
ILDAPUtils
setUserAttribute
in interface ILDAPUtils
loginName
- the user login nameattributeName
- the attribute namevalue
- the attribute value
LDAPOperationException
- if the attribute can't be setILDAPUtils.setUserAttribute(java.lang.String, java.lang.String, java.lang.Object)
public void updateGroup(LDAPGroup groupToUpdate, String groupCN) throws LDAPOperationException
ILDAPUtils
updateGroup
in interface ILDAPUtils
groupToUpdate
- the user to updategroupCN
- the group ID
LDAPOperationException
- if the group cannot be updatedImplementation note: the attribute 'name' is not eligible for modification (for AD, check other impls).
public void updateUser(LDAPUser userToUpdate, String userLogin) throws LDAPOperationException
ILDAPUtils
updateUser
in interface ILDAPUtils
userToUpdate
- the user to updateuserLogin
- the user's original login
LDAPOperationException
- if the operation cannot be executedILDAPUtils.updateUser(pt.digitalis.utils.ldap.LDAPUser, java.lang.String)
public boolean userContainsAttribute(String id, String loginName) throws LDAPOperationException
ILDAPUtils
userContainsAttribute
in interface ILDAPUtils
id
- the attribute nameloginName
- the user login name
LDAPOperationException
- if the user attribute can't be fetchedILDAPUtils.userContainsAttribute(java.lang.String, java.lang.String)
public boolean userExists(String loginName) throws LDAPOperationException
ILDAPUtils
userExists
in interface ILDAPUtils
loginName
- the ID of the user
LDAPOperationException
- if the operation cannot be executedILDAPUtils.userExists(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |