| com.nabhinc.portal.spi.BaseUserServiceImpl com.nabhinc.portal.spi.impl.ldap.UserAdminServiceLDAPImpl
UserAdminServiceLDAPImpl | public class UserAdminServiceLDAPImpl extends BaseUserServiceImpl implements UserAdminService(Code) | | User Admin service that works with a directory
server accessed via the Java Naming and Directory Interface (JNDI) APIs.
The following constraints are imposed on the data structure in the
underlying directory server:
|
Field Summary | |
final public static String | DEREF_ALIASES Constant that holds the name of the environment property for specifying
the manner in which aliases should be dereferenced. | protected String | UserInfoAttributes The attribute names. | protected String | UserInfoAttributesLDAP | protected String | alternateURL An alternate URL, to which, we should connect if connectionURL fails. | protected String | authentication | protected int | connectionAttempt The number of connection attempts. | protected String | connectionName The connection username for the server we will contact. | protected String | connectionPassword The connection password for the server we will contact. | protected String | connectionURL The connection URL for the server we will contact. | protected DirContext | context The directory context linking us to our directory server. | protected String | contextFactory The JNDI context factory used to acquire our InitialContext. | protected int | curUserPattern The current user pattern to be used for lookup and binding of a user. | protected String | derefAliases How aliases should be dereferenced during search operations. | final protected static String | name Descriptive information about this Realm implementation. | protected String | protocol The protocol that will be used in the communication with the
directory server. | protected String | referrals How should we handle referrals? Microsoft Active Directory can't handle
the default case, so an application authenticating against AD must
set referrals to "follow". | protected String | userBase The base element for user searches. | protected String | userPattern The message format used to form the distinguished name of a
user, with "{0}" marking the spot where the specified username
goes. | protected String[] | userPatternArray A string of LDAP user patterns or paths, ":"-separated
These will be used to form the distinguished name of a
user, with "{0}" marking the spot where the specified username
goes. | protected MessageFormat[] | userPatternFormatArray An array of MessageFormat objects associated with the current
userPatternArray . | protected String | userSearch The message format used to search for a user, with "{0}" marking
the spot where the username goes. | protected MessageFormat | userSearchFormat The MessageFormat object associated with the current
userSearch . | protected boolean | userSubtree |
Method Summary | |
protected void | close(DirContext context) Close any open connection to the directory server for this Realm. | public void | createUser(User usr, String password, int[] roleIDs) | public void | deleteUsers(int[] userID) | public void | deleteUsers(String[] usernames) | protected String | doRFC2254Encoding(String inString) Given an LDAP search string, returns the string with certain characters
escaped according to RFC 2254 guidelines. | public String | getAlternateURL() Getter for property alternateURL. | public String | getAuthentication() Return the type of authentication to use. | public String | getConnectionName() Return the connection username for this Realm. | public String | getConnectionPassword() Return the connection password for this Realm. | public String | getConnectionURL() Return the connection URL for this Realm. | public String | getContextFactory() Return the JNDI context factory for this Realm. | public java.lang.String | getDerefAliases() Return the derefAliases setting to be used. | protected Hashtable | getDirectoryContextEnvironment() Create our directory context configuration. | public byte[] | getIcon(String userName) | public String | getProtocol() Return the protocol to be used. | public String | getReferrals() Returns the current settings for handling JNDI referrals. | public User | getUser(int userID) | public User | getUser(String userName) | protected synchronized Attributes | getUserAttributes(DirContext context, String userName) Return the attributes associated with the given user name. | public String | getUserBase() Return the base element for user searches. | public int | getUserCount() | public Map | getUserInfo(String userName) | public String | getUserInfoAttributes() | public String | getUserInfoAttributesLDAP() | public String | getUserNameFromEmail(String email) | public String | getUserPattern() Return the message format pattern for selecting users in this Realm. | public String | getUserSearch() Return the message format pattern for selecting users in this Realm. | public boolean | getUserSubtree() Return the "search subtree for users" flag. | public List | getUsers(int offset, int maxUsers, String orderby, boolean isDescending) | public void | init(ServerObjectConfig config) Caches server context and sets object properties. | protected DirContext | open() Open (if necessary) and return a connection to the configured
directory server for this Realm. | protected String[] | parseUserPatternString(String userPatternString) Given a string containing LDAP patterns for user locations (separated by
parentheses in a pseudo-LDAP search string format -
"(location1)(location2)", returns an array of those paths. | protected void | release(DirContext context) Release our use of this connection so that it can be recycled. | public void | setAlternateURL(String alternateURL) Setter for property alternateURL. | public void | setAuthentication(String authentication) Set the type of authentication to use. | public void | setConnectionName(String connectionName) Set the connection username for this Realm. | public void | setConnectionPassword(String connectionPassword) Set the connection password for this Realm. | public void | setConnectionURL(String connectionURL) Set the connection URL for this Realm. | public void | setContextFactory(String contextFactory) Set the JNDI context factory for this Realm. | public void | setDerefAliases(java.lang.String derefAliases) Set the value for derefAliases to be used when searching the directory. | public void | setIcon(String userName, byte[] icon) | public void | setPassword(String userName, String password) | public void | setProtocol(String protocol) Set the protocol for this Realm. | public void | setReferrals(String referrals) How do we handle JNDI referrals? ignore, follow, or throw
(see javax.naming.Context.REFERRAL for more information). | public void | setUserBase(String userBase) Set the base element for user searches. | public void | setUserInfoAttributeTypes(String attribTypes) | public void | setUserInfoAttributes(String uInfoAttribs) | public void | setUserInfoAttributesLDAP(String uInfoAttribsLDAP) | public void | setUserPattern(String userPattern) Set the message format pattern for selecting users in this Realm.
This may be one simple pattern, or multiple patterns to be tried,
separated by parentheses. | public void | setUserSearch(String userSearch) Set the message format pattern for selecting users in this Realm. | public void | setUserSubtree(boolean userSubtree) Set the "search subtree for users" flag. | public void | updateLastLogin(String userName) | public void | updateUser(User usr, int[] roleIDs) | public void | updateUserProfile(User usr) |
DEREF_ALIASES | final public static String DEREF_ALIASES(Code) | | Constant that holds the name of the environment property for specifying
the manner in which aliases should be dereferenced.
|
UserInfoAttributes | protected String UserInfoAttributes(Code) | | The attribute names.
|
UserInfoAttributesLDAP | protected String UserInfoAttributesLDAP(Code) | | |
alternateURL | protected String alternateURL(Code) | | An alternate URL, to which, we should connect if connectionURL fails.
|
authentication | protected String authentication(Code) | | The type of authentication to use
|
connectionAttempt | protected int connectionAttempt(Code) | | The number of connection attempts. If greater than zero we use the
alternate url.
|
connectionName | protected String connectionName(Code) | | The connection username for the server we will contact.
|
connectionPassword | protected String connectionPassword(Code) | | The connection password for the server we will contact.
|
connectionURL | protected String connectionURL(Code) | | The connection URL for the server we will contact.
|
context | protected DirContext context(Code) | | The directory context linking us to our directory server.
|
contextFactory | protected String contextFactory(Code) | | The JNDI context factory used to acquire our InitialContext. By
default, assumes use of an LDAP server using the standard JNDI LDAP
provider.
|
curUserPattern | protected int curUserPattern(Code) | | The current user pattern to be used for lookup and binding of a user.
|
derefAliases | protected String derefAliases(Code) | | How aliases should be dereferenced during search operations.
|
name | final protected static String name(Code) | | Descriptive information about this Realm implementation.
|
protocol | protected String protocol(Code) | | The protocol that will be used in the communication with the
directory server.
|
referrals | protected String referrals(Code) | | How should we handle referrals? Microsoft Active Directory can't handle
the default case, so an application authenticating against AD must
set referrals to "follow".
|
userBase | protected String userBase(Code) | | The base element for user searches.
|
userPattern | protected String userPattern(Code) | | The message format used to form the distinguished name of a
user, with "{0}" marking the spot where the specified username
goes.
|
userPatternArray | protected String[] userPatternArray(Code) | | A string of LDAP user patterns or paths, ":"-separated
These will be used to form the distinguished name of a
user, with "{0}" marking the spot where the specified username
goes.
This is similar to userPattern, but allows for multiple searches
for a user.
|
userPatternFormatArray | protected MessageFormat[] userPatternFormatArray(Code) | | An array of MessageFormat objects associated with the current
userPatternArray .
|
userSearch | protected String userSearch(Code) | | The message format used to search for a user, with "{0}" marking
the spot where the username goes.
|
userSearchFormat | protected MessageFormat userSearchFormat(Code) | | The MessageFormat object associated with the current
userSearch .
|
userSubtree | protected boolean userSubtree(Code) | | Should we search the entire subtree for matching users?
|
close | protected void close(DirContext context)(Code) | | Close any open connection to the directory server for this Realm.
Parameters: context - The directory context to be closed |
doRFC2254Encoding | protected String doRFC2254Encoding(String inString)(Code) | | Given an LDAP search string, returns the string with certain characters
escaped according to RFC 2254 guidelines.
The character mapping is as follows:
char -> Replacement
---------------------------
-> \2a
( -> \28
) -> \29
\ -> \5c
\0 -> \00
Parameters: inString - string to escape according to RFC 2254 guidelines String the escaped/encoded result |
getAlternateURL | public String getAlternateURL()(Code) | | Getter for property alternateURL.
Value of property alternateURL. |
getAuthentication | public String getAuthentication()(Code) | | Return the type of authentication to use.
|
getConnectionName | public String getConnectionName()(Code) | | Return the connection username for this Realm.
|
getConnectionPassword | public String getConnectionPassword()(Code) | | Return the connection password for this Realm.
|
getConnectionURL | public String getConnectionURL()(Code) | | Return the connection URL for this Realm.
|
getContextFactory | public String getContextFactory()(Code) | | Return the JNDI context factory for this Realm.
|
getDirectoryContextEnvironment | protected Hashtable getDirectoryContextEnvironment()(Code) | | Create our directory context configuration.
java.util.Hashtable the configuration for the directory context. |
getProtocol | public String getProtocol()(Code) | | Return the protocol to be used.
|
getReferrals | public String getReferrals()(Code) | | Returns the current settings for handling JNDI referrals.
|
getUserBase | public String getUserBase()(Code) | | Return the base element for user searches.
|
getUserInfoAttributes | public String getUserInfoAttributes()(Code) | | |
getUserInfoAttributesLDAP | public String getUserInfoAttributesLDAP()(Code) | | |
getUserPattern | public String getUserPattern()(Code) | | Return the message format pattern for selecting users in this Realm.
|
getUserSearch | public String getUserSearch()(Code) | | Return the message format pattern for selecting users in this Realm.
|
getUserSubtree | public boolean getUserSubtree()(Code) | | Return the "search subtree for users" flag.
|
parseUserPatternString | protected String[] parseUserPatternString(String userPatternString)(Code) | | Given a string containing LDAP patterns for user locations (separated by
parentheses in a pseudo-LDAP search string format -
"(location1)(location2)", returns an array of those paths. Real LDAP
search strings are supported as well (though only the "|" "OR" type).
Parameters: userPatternString - - a string LDAP search paths surrounded byparentheses |
release | protected void release(DirContext context)(Code) | | Release our use of this connection so that it can be recycled.
Parameters: context - The directory context to release |
setAlternateURL | public void setAlternateURL(String alternateURL)(Code) | | Setter for property alternateURL.
Parameters: alternateURL - New value of property alternateURL. |
setAuthentication | public void setAuthentication(String authentication)(Code) | | Set the type of authentication to use.
Parameters: authentication - The authentication |
setConnectionName | public void setConnectionName(String connectionName)(Code) | | Set the connection username for this Realm.
Parameters: connectionName - The new connection username |
setConnectionPassword | public void setConnectionPassword(String connectionPassword)(Code) | | Set the connection password for this Realm.
Parameters: connectionPassword - The new connection password |
setConnectionURL | public void setConnectionURL(String connectionURL)(Code) | | Set the connection URL for this Realm.
Parameters: connectionURL - The new connection URL |
setContextFactory | public void setContextFactory(String contextFactory)(Code) | | Set the JNDI context factory for this Realm.
Parameters: contextFactory - The new context factory |
setDerefAliases | public void setDerefAliases(java.lang.String derefAliases)(Code) | | Set the value for derefAliases to be used when searching the directory.
Parameters: derefAliases - New value of property derefAliases. |
setProtocol | public void setProtocol(String protocol)(Code) | | Set the protocol for this Realm.
Parameters: protocol - The new protocol. |
setReferrals | public void setReferrals(String referrals)(Code) | | How do we handle JNDI referrals? ignore, follow, or throw
(see javax.naming.Context.REFERRAL for more information).
|
setUserBase | public void setUserBase(String userBase)(Code) | | Set the base element for user searches.
Parameters: userBase - The new base element |
setUserInfoAttributeTypes | public void setUserInfoAttributeTypes(String attribTypes)(Code) | | |
setUserInfoAttributes | public void setUserInfoAttributes(String uInfoAttribs)(Code) | | |
setUserInfoAttributesLDAP | public void setUserInfoAttributesLDAP(String uInfoAttribsLDAP)(Code) | | |
setUserPattern | public void setUserPattern(String userPattern)(Code) | | Set the message format pattern for selecting users in this Realm.
This may be one simple pattern, or multiple patterns to be tried,
separated by parentheses. (for example, either "cn={0}", or
"(cn={0})(cn={0},o=myorg)" Full LDAP search strings are also supported,
but only the "OR", "|" syntax, so "(|(cn={0})(cn={0},o=myorg))" is
also valid. Complex search strings with &, etc are NOT supported.
Parameters: userPattern - The new user pattern |
setUserSearch | public void setUserSearch(String userSearch)(Code) | | Set the message format pattern for selecting users in this Realm.
Parameters: userSearch - The new user search pattern |
setUserSubtree | public void setUserSubtree(boolean userSubtree)(Code) | | Set the "search subtree for users" flag.
Parameters: userSubtree - The new search flag |
|
|