com.esri.adf.security.store
Class LDAPConnectParams

java.lang.Object
  extended by com.esri.adf.security.store.ConnectParams
      extended by com.esri.adf.security.store.LDAPConnectParams
All Implemented Interfaces:
java.io.Serializable

public class LDAPConnectParams
extends ConnectParams
implements java.io.Serializable

This class contains the connection parameters to connect to an LDAP. The ArcGISSecurityStore object will use an initiated LDAPConnectParams object to connect to the LDAP.

See Also:
Serialized Form

Field Summary
protected  java.lang.String BASEDN_FOR_ROLE
           
protected  java.lang.String BASEDN_FOR_USER
           
protected  boolean bRoleInLdap
           
protected  boolean bUserInLdap
           
protected  boolean bUserPwdEncrypted
           
protected  java.lang.String CLASSNAME
           
protected  java.lang.String HOSTNAME
           
protected  int iPortNum
           
protected  int iRoleType
           
protected  java.lang.String IS_USER_PWD_ENCRYPTED
           
protected  java.lang.String PORTNUM
           
static int ROLE_AS_ATTRIBUTE
           
static int ROLE_AS_ENTRY
           
protected  java.lang.String ROLE_ATTRB_IN_USER_ENTRY
           
protected  java.lang.String ROLE_IN_LDAP
           
protected  java.lang.String ROLE_TYPE
           
protected  java.lang.String strBaseDnForRole
           
protected  java.lang.String strBaseDnForUser
           
protected  java.lang.String strHostName
           
protected  java.lang.String strLdapURLForRole
           
protected  java.lang.String strLdapURLForUser
           
protected  java.lang.String strRoleAttribInUserEntry
           
protected  java.lang.String strUserAttribInRoleEntry
           
protected  java.lang.String strUserIdAttribute
           
protected  java.lang.String strUserName
           
protected  java.lang.String strUserPwd
           
protected  java.lang.String TYPE_NAME
           
protected  java.lang.String URL_FOR_ROLE
           
protected  java.lang.String URL_FOR_USER
           
protected  java.lang.String USER_ATTRB_IN_ROLE_ENTRY
           
protected  java.lang.String USER_ID_ATTRB
           
protected  java.lang.String USER_IN_LDAP
           
protected  java.lang.String USERNAME
           
protected  java.lang.String USERPWD
           
 
Fields inherited from class com.esri.adf.security.store.ConnectParams
type
 
Constructor Summary
LDAPConnectParams()
          Class constructor.
 
Method Summary
 java.lang.String getBaseDnForRole()
          Returns the base DN from which the roles will be searched
 java.lang.String getBaseDnForUser()
          Returns the base DN from which the users will be searched
 java.lang.String getHostName()
          Returns that name of the host that has been set on the object.
 java.util.Map<java.lang.String,java.lang.String> getParameters()
          Returns the parameters set on the object into a HashMap
 int getPortNumber()
          Returns the port number that has been set on the object.
 java.lang.String getPreparedURLForRole()
          Returns a JNDI URL to connect to an LDAP.
 java.lang.String getPreparedURLForUser()
          Returns a JNDI URL to connect to an LDAP.
 java.lang.String getRoleAttribInUserEntry()
          Returns the name of the attribute in the User entry that will contain the DN of the role to which the ArcGISSecurityUser belongs.
 int getRoleType()
          Returns the type in which role information is stored in the LDAP.
 java.lang.String getType()
          Returns a string identifier for the class that implements this method.
 java.lang.String getURLForRole()
          Returns the URL to connect to the roles in LDAP.
 java.lang.String getURLForUser()
          Returns the URL to connect to the roles in LDAP.
 java.lang.String getUserAttrbInRoleEntry()
          Returns the name of the attribute in the Role entry that will contain the user DN who are members of that role.
 java.lang.String getUserIdAttribute()
          Return the attribute used for ArcGISSecurityUser-id in the DN string e.g.
 java.lang.String getUserName()
          Returns the user name for the LDAP account that has been set on the object
 java.lang.String getUserPwd()
          Returns the user password for the LDAP account that has been set on the object
 boolean isRoleInLdap()
          Returns the boolean flag that states if the roles are maintained in the LDAP.
 boolean isUserInLdap()
          Returns the boolean flag that states if the users are maintained in the LDAP.
 boolean isUserPwdEncrypted()
          Returns true if the user password is to be treated as an encrypted string.
 void setBaseDnForRole(java.lang.String baseDnForRole)
          Sets the base DN for the LDAP from which the roles will be searched.
 void setBaseDnForUser(java.lang.String baseDnForUser)
          Sets the base DN for the LDAP from which the users will be searched.
 void setHostName(java.lang.String hostName)
          Set the name of the host that runs the LDAP.
 void setParameters(java.util.Map<java.lang.String,java.lang.String> paramsMap)
          Populates the parameters from the HashMap
 void setPortNumber(int portNumber)
          Sets the port number for the machine that runs the LDAP.
 void setRoleAttribInUserEntry(java.lang.String roleAttribInUserEntry)
          Sets the name of the attribute in the User entry that will contain the DN of the role to which the user belongs.
 void setRoleInLdap(boolean roleInLdap)
          Set the boolean flag to true is roles are in LDAP.
 void setRoleType(int type)
          This method instructs the data store the way roles are maintained in the LDAP.
 void setURLForRole(java.lang.String ldapURL)
          Set the LDAP URL.
 void setURLForUser(java.lang.String ldapURL)
          Set the LDAP URL.
 void setUserAttrbInRoleEntry(java.lang.String userAttribInRoleEntry)
          Sets the name of the attribute in the Role entry that will contain the user DN who are members of that role.
 void setUserIdAttribute(java.lang.String userIdAttribute)
          Sets the attribute used for ArcGISSecurityUser-id in the DN string e.g.
 void setUserInLdap(boolean userInLdap)
          Set the boolean flag to true is users are in LDAP.
 void setUserName(java.lang.String userName)
          Set the user credentials for an LDAP account
 void setUserPwd(java.lang.String userPwd)
          Set the user credentials for an LDAP account
 void setUserPwdEncrypted(boolean pwdEncrypted)
          Sets the condition whether that user password is encrypted.
 boolean verifyParameters()
          Verifies if all the required parameters for the LDAPConnectParams are set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strHostName

protected java.lang.String strHostName

iPortNum

protected int iPortNum

strBaseDnForUser

protected java.lang.String strBaseDnForUser

strBaseDnForRole

protected java.lang.String strBaseDnForRole

bUserInLdap

protected boolean bUserInLdap

bRoleInLdap

protected boolean bRoleInLdap

strUserIdAttribute

protected java.lang.String strUserIdAttribute

strLdapURLForUser

protected java.lang.String strLdapURLForUser

strLdapURLForRole

protected java.lang.String strLdapURLForRole

strUserAttribInRoleEntry

protected java.lang.String strUserAttribInRoleEntry

strRoleAttribInUserEntry

protected java.lang.String strRoleAttribInUserEntry

strUserName

protected java.lang.String strUserName

strUserPwd

protected java.lang.String strUserPwd

iRoleType

protected int iRoleType

bUserPwdEncrypted

protected boolean bUserPwdEncrypted

ROLE_AS_ENTRY

public static int ROLE_AS_ENTRY

ROLE_AS_ATTRIBUTE

public static int ROLE_AS_ATTRIBUTE

TYPE_NAME

protected final java.lang.String TYPE_NAME
See Also:
Constant Field Values

CLASSNAME

protected final java.lang.String CLASSNAME
See Also:
Constant Field Values

HOSTNAME

protected final java.lang.String HOSTNAME
See Also:
Constant Field Values

PORTNUM

protected final java.lang.String PORTNUM
See Also:
Constant Field Values

USERNAME

protected final java.lang.String USERNAME
See Also:
Constant Field Values

USERPWD

protected final java.lang.String USERPWD
See Also:
Constant Field Values

BASEDN_FOR_USER

protected final java.lang.String BASEDN_FOR_USER
See Also:
Constant Field Values

BASEDN_FOR_ROLE

protected final java.lang.String BASEDN_FOR_ROLE
See Also:
Constant Field Values

USER_ID_ATTRB

protected final java.lang.String USER_ID_ATTRB
See Also:
Constant Field Values

URL_FOR_USER

protected final java.lang.String URL_FOR_USER
See Also:
Constant Field Values

URL_FOR_ROLE

protected final java.lang.String URL_FOR_ROLE
See Also:
Constant Field Values

ROLE_TYPE

protected final java.lang.String ROLE_TYPE
See Also:
Constant Field Values

USER_ATTRB_IN_ROLE_ENTRY

protected final java.lang.String USER_ATTRB_IN_ROLE_ENTRY
See Also:
Constant Field Values

ROLE_ATTRB_IN_USER_ENTRY

protected final java.lang.String ROLE_ATTRB_IN_USER_ENTRY
See Also:
Constant Field Values

USER_IN_LDAP

protected final java.lang.String USER_IN_LDAP
See Also:
Constant Field Values

ROLE_IN_LDAP

protected final java.lang.String ROLE_IN_LDAP
See Also:
Constant Field Values

IS_USER_PWD_ENCRYPTED

protected final java.lang.String IS_USER_PWD_ENCRYPTED
See Also:
Constant Field Values
Constructor Detail

LDAPConnectParams

public LDAPConnectParams()
Class constructor.

Method Detail

getType

public java.lang.String getType()
Returns a string identifier for the class that implements this method.

Specified by:
getType in class ConnectParams
Returns:
String identifier for the implementing class

setParameters

public void setParameters(java.util.Map<java.lang.String,java.lang.String> paramsMap)
                   throws ArcGISSecurityException
Populates the parameters from the HashMap

Specified by:
setParameters in class ConnectParams
Parameters:
paramsMap - - HashMap that contains the names of the parameter and their values
Throws:
ArcGISSecurityException - - if the required parameters are not set

getParameters

public java.util.Map<java.lang.String,java.lang.String> getParameters()
                                                               throws ArcGISSecurityException
Returns the parameters set on the object into a HashMap

Specified by:
getParameters in class ConnectParams
Returns:
HashMap containing the parameters and their values
Throws:
ArcGISSecurityException - - if the required parameters are not set

isUserPwdEncrypted

public boolean isUserPwdEncrypted()
Returns true if the user password is to be treated as an encrypted string.

Returns:
true if the password is encrypted, false otherwise

setUserPwdEncrypted

public void setUserPwdEncrypted(boolean pwdEncrypted)
Sets the condition whether that user password is encrypted. The password must be encrypted using the Cryptographer class. If the password is encrypted the security store will decrypt it when trying to connect to the data store.

Parameters:
pwdEncrypted - - true if the user password is encryted, false otherwise

setUserName

public void setUserName(java.lang.String userName)
                 throws ArcGISSecurityException
Set the user credentials for an LDAP account

Parameters:
userName - - String representing the name of the user
Throws:
ArcGISSecurityException - - if the input parameter is null

getUserName

public java.lang.String getUserName()
Returns the user name for the LDAP account that has been set on the object

Returns:
String representing name of the user

getUserPwd

public java.lang.String getUserPwd()
Returns the user password for the LDAP account that has been set on the object

Returns:
String representing password of the user

setUserPwd

public void setUserPwd(java.lang.String userPwd)
                throws ArcGISSecurityException
Set the user credentials for an LDAP account

Parameters:
userPwd - - String representing the password of the user
Throws:
ArcGISSecurityException - - if the input parameter is null

setHostName

public void setHostName(java.lang.String hostName)
                 throws ArcGISSecurityException
Set the name of the host that runs the LDAP.

Parameters:
hostName - - name of the host
Throws:
ArcGISSecurityException - - if input parameter is null

getHostName

public java.lang.String getHostName()
Returns that name of the host that has been set on the object.

Returns:
String representing the name of the host, null if setHostName has not been called on the object

setPortNumber

public void setPortNumber(int portNumber)
Sets the port number for the machine that runs the LDAP.

Parameters:
portNumber - - port number of the host machine that listens for LDAP connections

getPortNumber

public int getPortNumber()
Returns the port number that has been set on the object.

Returns:
int representing that port number of the machine that listens for LDAP connections, -1 otherwise

setBaseDnForUser

public void setBaseDnForUser(java.lang.String baseDnForUser)
                      throws ArcGISSecurityException
Sets the base DN for the LDAP from which the users will be searched.

Parameters:
baseDnForUser - - base DN for searching users
Throws:
ArcGISSecurityException - - if input parameter is null

getBaseDnForUser

public java.lang.String getBaseDnForUser()
Returns the base DN from which the users will be searched

Returns:
String represents the base DN for the LDAP entry from which the users will be searched, null if setBaseDnForUser not called on the object

setRoleType

public void setRoleType(int type)
                 throws ArcGISSecurityException
This method instructs the data store the way roles are maintained in the LDAP. Role can be maintained either as individual entries with user information being maintained as values for attributes. Roles can also be maintained as attribute values for individual user entries. After this method is called, you need to call either setUserAttrbInRoleEntry if type = or call setRoleAttribInUserEntry if type =

Parameters:
type - - this can either be LDAPConnectParams.ROLE_AS_ATTRBUTE or LDAPConnectParams.ROLE_AS_ENTRY
Throws:
ArcGISSecurityException - - if input parameter is not of the above value

getRoleType

public int getRoleType()
                throws ArcGISSecurityException
Returns the type in which role information is stored in the LDAP. The value can be comapared with LDAPConnectParams.ROLE_AS_ATTRBUTE or LDAPConnectParams.ROLE_AS_ENTRY

Returns:
integer representing the type in which roles are maintained in the LDAP
Throws:
ArcGISSecurityException - - if setRoleType is not called before calling this method.

setUserAttrbInRoleEntry

public void setUserAttrbInRoleEntry(java.lang.String userAttribInRoleEntry)
                             throws ArcGISSecurityException
Sets the name of the attribute in the Role entry that will contain the user DN who are members of that role.

Parameters:
userAttribInRoleEntry - - String representing the attribute name whose value is the DN of the user who is a member of this role.
Throws:
ArcGISSecurityException - when the input parameter is null or setRoleType method has not been called before this method is called.

getUserAttrbInRoleEntry

public java.lang.String getUserAttrbInRoleEntry()
                                         throws ArcGISSecurityException
Returns the name of the attribute in the Role entry that will contain the user DN who are members of that role.

Returns:
String representing the name of the attribute that contains the DN of the role
Throws:
ArcGISSecurityException - when this method is called before setUserAttrbInRoleEntry method is called.

setRoleAttribInUserEntry

public void setRoleAttribInUserEntry(java.lang.String roleAttribInUserEntry)
                              throws ArcGISSecurityException
Sets the name of the attribute in the User entry that will contain the DN of the role to which the user belongs.

Parameters:
roleAttrbInUserEntry - - String representing the attribute name whose value is the DN of the user who is a member of this role.
Throws:
ArcGISSecurityException - when the input parameter is null or if setRoleType method is not called before this method is called.

getRoleAttribInUserEntry

public java.lang.String getRoleAttribInUserEntry()
                                          throws ArcGISSecurityException
Returns the name of the attribute in the User entry that will contain the DN of the role to which the ArcGISSecurityUser belongs.

Returns:
String representing the attribute name that contains the DN of the role
Throws:
ArcGISSecurityException - when this method is called before setRoleAttribInUserEntry method is called.

setBaseDnForRole

public void setBaseDnForRole(java.lang.String baseDnForRole)
                      throws ArcGISSecurityException
Sets the base DN for the LDAP from which the roles will be searched.

Parameters:
baseDnForRoles - - base DN for searching roles
Throws:
ArcGISSecurityException - - if input parameter is null

getBaseDnForRole

public java.lang.String getBaseDnForRole()
Returns the base DN from which the roles will be searched

Returns:
String represents the base DN for the LDAP entry from which the roles will be searched, null if setBaseDnForRole not called on the object

setUserInLdap

public void setUserInLdap(boolean userInLdap)
Set the boolean flag to true is users are in LDAP.

Parameters:
userInLdap - - boolean true if users are in LDAP

isUserInLdap

public boolean isUserInLdap()
Returns the boolean flag that states if the users are maintained in the LDAP.

Returns:
true if users are maintained in LDAP, false otherwise

setRoleInLdap

public void setRoleInLdap(boolean roleInLdap)
Set the boolean flag to true is roles are in LDAP.

Parameters:
roleInLdap - - boolean true if roles are in LDAP

isRoleInLdap

public boolean isRoleInLdap()
Returns the boolean flag that states if the roles are maintained in the LDAP.

Returns:
true if roles are maintained in LDAP, false otherwise

getPreparedURLForUser

public java.lang.String getPreparedURLForUser()
                                       throws ArcGISSecurityException
Returns a JNDI URL to connect to an LDAP. The URL points to the base DN for the users. You need to call setURLForUser to set the URL that this class will use to connect to LDAP for users.

Returns:
String representing the JNDI url to connect to the users in LDAP
Throws:
ArcGISSecurityException - if conditions are not met to generate the URL

getPreparedURLForRole

public java.lang.String getPreparedURLForRole()
                                       throws ArcGISSecurityException
Returns a JNDI URL to connect to an LDAP. The URL points to the base DN for the roles. You need to call setURLForRole to set the URL that this class will use to connect to LDAP for roles.

Returns:
String representing the JNDI url to connect to the roles in LDAP
Throws:
ArcGISSecurityException - if conditions are not met to generate the URL

setURLForUser

public void setURLForUser(java.lang.String ldapURL)
                   throws ArcGISSecurityException
Set the LDAP URL. The security store will use this URL to connect to the users in LDAP.

Throws:
ArcGISSecurityException

getURLForUser

public java.lang.String getURLForUser()
Returns the URL to connect to the roles in LDAP.

Returns:
String representing the LDAP URL.

setURLForRole

public void setURLForRole(java.lang.String ldapURL)
                   throws ArcGISSecurityException
Set the LDAP URL. The security store will use this URL to connect to the roles in LDAP.

Throws:
ArcGISSecurityException

getURLForRole

public java.lang.String getURLForRole()
Returns the URL to connect to the roles in LDAP.

Returns:
String representing the LDAP URL.

getUserIdAttribute

public java.lang.String getUserIdAttribute()
Return the attribute used for ArcGISSecurityUser-id in the DN string e.g. DN:uid=xxx,ou=users,o=example, here the attribute for ArcGISSecurityUser-id is 'uid'

Returns:
String representing the ArcGISSecurityUser-id in the DN attribute of the entry, null if setUserIdAttribute not called on the object

setUserIdAttribute

public void setUserIdAttribute(java.lang.String userIdAttribute)
                        throws ArcGISSecurityException
Sets the attribute used for ArcGISSecurityUser-id in the DN string e.g. DN:uid=xxx,ou=users,o=example, here the attribute for ArcGISSecurityUser-id is 'uid'

Throws:
ArcGISSecurityException - - if the input parameter is null

verifyParameters

public boolean verifyParameters()
                         throws ArcGISSecurityException
Verifies if all the required parameters for the LDAPConnectParams are set. If a particular parameter is not set, this method will throw an exception.

Specified by:
verifyParameters in class ConnectParams
Returns:
true if all the required parameters are correctly set
Throws:
ArcGISSecurityException - when a required parameters is not set