com.esri.adf.security.store
Class DBConnectParams

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

public class DBConnectParams
extends ConnectParams
implements java.io.Serializable

This class contains the connection parameters to connect to a Database. The ArcGISSecurityStore object will use an initiated DBConnectParams object to connect to a database.

See Also:
Serialized Form

Field Summary
protected  boolean bRoleInDb
           
protected  boolean bUserInDb
           
protected  boolean bUserPwdEncrypted
           
protected  java.lang.String CLASSNAME
           
protected  java.lang.String DATABASENAME
           
protected  java.lang.String DRIVERNAME
           
protected  java.lang.String HOSTNAME
           
protected  int iPortNum
           
protected  java.lang.String IS_USER_PWD_ENCRYPTED
           
protected  java.lang.String PORTNUM
           
protected  java.lang.String ROLE_IN_DB
           
protected  java.lang.String strDatabaseName
           
protected  java.lang.String strDBDriverName
           
protected  java.lang.String strHostName
           
protected  java.lang.String strJdbcUrl
           
protected  java.lang.String strUserName
           
protected  java.lang.String strUserPwd
           
protected  java.lang.String TYPE_NAME
           
protected  java.lang.String URL
           
protected  java.lang.String USER_IN_DB
           
protected  java.lang.String USERNAME
           
protected  java.lang.String USERPWD
           
 
Fields inherited from class com.esri.adf.security.store.ConnectParams
type
 
Constructor Summary
DBConnectParams()
          Class constructor.
 
Method Summary
 java.lang.String getDatabaseName()
          Returns the name of the database that the security store will connect.
 java.lang.String getDriverName()
          Returns the name of the JDBC driver that has been set on the object.
 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 getPreparedURL()
          Returns the JDBC URL that is automatically generated for all the parameters that have been set on the object.
 java.lang.String getType()
          Returns a string identifier for the class that implements this method.
 java.lang.String getURL()
          Returns the JDBC URL that bas been set on the object.
 java.lang.String getUserName()
          Returns the name of the user that is going to be used to connect to the DB.
 java.lang.String getUserPwd()
          Returns the password for the user that the security store, will use to connect to the database.
 boolean isRoleInDb()
          Returns boolean true if role information is maintained in DB.
 boolean isUserInDb()
          Returns boolean true if user information is maintained in DB.
 boolean isUserPwdEncrypted()
          Returns true if the user password is to be treated as an encrypted string.
 void setDatabaseName(java.lang.String databaseName)
          Sets the name of the database to which the security API will talk to.
 void setDriverName(java.lang.String driverName)
          Sets the name of the JDBC driver.
 void setHostName(java.lang.String hostName)
          Set the name of the host that runs the DBMS.
 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 DBMS.
 void setRoleInDb(boolean isRoleInDB)
          If role information is maintained in a database, this method should be called with boolean true.
 void setURL(java.lang.String jdbcURL)
          Set the JDBC URL into the object.
 void setUserInDb(boolean isUserInDB)
          If user information is maintained in a database, this method should be called with boolean true.
 void setUserName(java.lang.String userName)
          Sets the user credential for connecting to the DBMS.
 void setUserPwd(java.lang.String userPwd)
          Sets the password for the user that the security store, will use to connect to the database.
 void setUserPwdEncrypted(boolean pwdEncrypted)
          Sets the condition whether that user password is encrypted.
 boolean verifyParameters()
          Verifies if all the required parameters for the DBConnectParams 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

strUserName

protected java.lang.String strUserName

strUserPwd

protected java.lang.String strUserPwd

strDBDriverName

protected java.lang.String strDBDriverName

strDatabaseName

protected java.lang.String strDatabaseName

strJdbcUrl

protected java.lang.String strJdbcUrl

bUserInDb

protected boolean bUserInDb

bRoleInDb

protected boolean bRoleInDb

bUserPwdEncrypted

protected boolean bUserPwdEncrypted

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

DRIVERNAME

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

DATABASENAME

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

URL

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

USER_IN_DB

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

ROLE_IN_DB

protected final java.lang.String ROLE_IN_DB
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

DBConnectParams

public DBConnectParams()
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

setDriverName

public void setDriverName(java.lang.String driverName)
                   throws ArcGISSecurityException
Sets the name of the JDBC driver.

Throws:
ArcGISSecurityException - - if the input parameter is null

getDriverName

public java.lang.String getDriverName()
Returns the name of the JDBC driver that has been set on the object.

Returns:
String representing the driver name, null if setDriverName has not been called on the object

setHostName

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

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

setUserInDb

public void setUserInDb(boolean isUserInDB)
If user information is maintained in a database, this method should be called with boolean true.

Parameters:
isUserInDB - - true if users are stored in DB, false otherwise

setRoleInDb

public void setRoleInDb(boolean isRoleInDB)
If role information is maintained in a database, this method should be called with boolean true.

Parameters:
isRoleInDB - - true if roles are stored in DB, false otherwise

isUserInDb

public boolean isUserInDb()
Returns boolean true if user information is maintained in DB. If setUserInDb is not called on this object, this method will return true.

Returns:
false if users are not maintained in DB, true otherwise

isRoleInDb

public boolean isRoleInDb()
Returns boolean true if role information is maintained in DB. If setRoleInDb is not called on this object, this method will return true.

Returns:
false if roles are not maintained in DB, true otherwise

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 DBMS.

Parameters:
portNumber - - port number of the host machine that listens for DB 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 DB connections, -1 otherwise

setUserName

public void setUserName(java.lang.String userName)
                 throws ArcGISSecurityException
Sets the user credential for connecting to the DBMS.

Parameters:
userName - - name of a user that can be used to connect to Database
Throws:
ArcGISSecurityException - - if input parameter is null

getUserName

public java.lang.String getUserName()
Returns the name of the user that is going to be used to connect to the DB.

Returns:
String representing the name of the user, null if setUserName not called on the object

setDatabaseName

public void setDatabaseName(java.lang.String databaseName)
                     throws ArcGISSecurityException
Sets the name of the database to which the security API will talk to.

Parameters:
databaseName - - name of the database that the security store will connect to
Throws:
ArcGISSecurityException - - if input parameter is null

getDatabaseName

public java.lang.String getDatabaseName()
Returns the name of the database that the security store will connect.

Returns:
String representing the name of the database

setUserPwd

public void setUserPwd(java.lang.String userPwd)
                throws ArcGISSecurityException
Sets the password for the user that the security store, will use to connect to the database.

Parameters:
userPwd - - password for the user account for the database
Throws:
ArcGISSecurityException - - if input parameter is null

getUserPwd

public java.lang.String getUserPwd()
Returns the password for the user that the security store, will use to connect to the database.

Returns:
String representing the password for the user, null if setUserPwd not called on the object

getPreparedURL

public java.lang.String getPreparedURL()
                                throws ArcGISSecurityException
Returns the JDBC URL that is automatically generated for all the parameters that have been set on the object. You can use this method, to see the generated URL for the particular DBMS. You still have to call setURL to set the JDBC URL on the object.

Returns:
- String representing the generated JDBC URL.
Throws:
ArcGISSecurityException - - if the URL mapping file is missing or if the particular DBMS information is not available with the security API.

setURL

public void setURL(java.lang.String jdbcURL)
            throws ArcGISSecurityException
Set the JDBC URL into the object. The security store will then use this URL to connect to the DB

Parameters:
jdbcURL - - jdbc url that the DBConnectParams object will use
Throws:
ArcGISSecurityException - - if the input parameters are null

getURL

public java.lang.String getURL()
Returns the JDBC URL that bas been set on the object.

Returns:
String representing the JDBC URL, null if setURL has not been called

verifyParameters

public boolean verifyParameters()
                         throws ArcGISSecurityException
Verifies if all the required parameters for the DBConnectParams 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