|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.esri.adf.security.store.DBStore
public class DBStore
This class implements the SecurityStore interface and provides access methods to a relational database. You can use this class as an underlying implementation for the ArcGISSecurityStore when users or role are maintained in a database as tabular information.
| Field Summary | |
|---|---|
protected java.sql.Connection |
dbConnection
|
protected DBConnectParams |
dbConnectParams
|
protected java.util.Map<java.lang.String,java.lang.String> |
dbParamsMap
|
protected java.lang.String |
ROLE_ATTR_DESCRIPTION
|
protected java.lang.String |
ROLE_ATTR_ROLENAME
|
protected java.lang.String |
ROLE_TABLE
|
protected java.lang.String |
USER_ATTR_EMAIL
|
protected java.lang.String |
USER_ATTR_FULLNAME
|
protected java.lang.String |
USER_ATTR_MD5PASSWORD
|
protected java.lang.String |
USER_ATTR_SECRETANSWER
|
protected java.lang.String |
USER_ATTR_SECRETQUESTION
|
protected java.lang.String |
USER_ATTR_SHAPASSWORD
|
protected java.lang.String |
USER_ATTR_USERNAME
|
protected java.lang.String |
USER_ROLE_TABLE
|
protected java.lang.String |
USER_TABLE
|
| Constructor Summary | |
|---|---|
DBStore()
|
|
| Method Summary | |
|---|---|
void |
addRole(ArcGISSecurityRole role)
Add a new role to the security store database. |
void |
addRolesToUser(java.lang.String username,
java.util.List<ArcGISSecurityRole> roleList)
Assign list of roles to a user. |
void |
addRolesToUser(java.lang.String username,
java.lang.String[] roleList)
Assign list of roles to a user. |
void |
addUser(ArcGISSecurityUser user)
Add a user to the security store database. |
void |
addUsersToRole(java.lang.String rolename,
java.lang.String[] userList)
Assign a role to a bunch of users. |
void |
close()
Close all connections to the security store. |
void |
createTables(boolean bUsersInDb,
boolean bRolesInDb)
Creates tables within a database that are required by the security store. |
protected void |
deleteAllRolesFromUser(java.lang.String userName)
Delete all the roles that have been assigned to a user. |
protected void |
deleteAllUsersForRole(java.lang.String roleName)
Delete a particular role from a bunch of users. |
void |
deleteRole(java.lang.String rolename)
Delete a role from the security store database. |
void |
deleteRolesFromUser(java.lang.String username,
java.lang.String[] roleList)
Delete list of roles that are assigned to a user. |
void |
deleteUser(java.lang.String userName)
Delete a user from the security store database. |
void |
deleteUsersFromRole(java.lang.String rolename,
java.lang.String[] userList)
Delete a particular role from a bunch of users. |
java.lang.String |
forgotUserPassword(java.lang.String userName,
java.lang.String secretQuest,
java.lang.String secretAns)
Method that will reset the user password to some random string, by checking the answer provided to the secret question provided by the user when adding user to the security store. |
java.util.List<ArcGISSecurityRole> |
getAllRoles()
Return list of roles that are present in the security store. |
java.util.List<ArcGISSecurityUser> |
getAllUsers()
Returns a list of ArcGISSecurityUser objects that represent all the users currently in the security store. |
ArcGISSecurityRole |
getRole(java.lang.String rolename)
Call this method to get information regarding a particular role in the security store database. |
java.util.List<ArcGISSecurityRole> |
getRolesForUser(java.lang.String username)
Return a list of roles that are assigned to a particular user. |
ArcGISSecurityUser |
getUser(java.lang.String username)
Call this method to get information regarding a particular user in the security store. |
java.lang.String |
getUserSecretQuestion(java.lang.String userName)
Returns the secret question that has been set for a user. |
java.util.List<ArcGISSecurityUser> |
getUsersForRole(java.lang.String rolename)
Return list of user who are assigned a particular role. |
void |
init(java.util.Map<java.lang.String,java.lang.String> paramsMap)
Initialize the database connection. |
boolean |
isReadOnly()
For the current implementation, we can write to a DB so this method will always return false. |
void |
modifyRole(ArcGISSecurityRole role)
Modify the information for a role in the security store. |
void |
modifyUser(ArcGISSecurityUser user)
Modify the information for a user in the security store. |
void |
reinitialize()
Reinitialize the connection to data stores. |
boolean |
testConnection(java.util.Map<java.lang.String,java.lang.String> paramsMap)
Test the connection to the data store |
boolean |
validateUser(java.lang.String username,
java.lang.String password)
Check the user credentials with the information available in the security store. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DBConnectParams dbConnectParams
protected java.sql.Connection dbConnection
protected java.util.Map<java.lang.String,java.lang.String> dbParamsMap
protected java.lang.String USER_TABLE
protected java.lang.String ROLE_TABLE
protected java.lang.String USER_ROLE_TABLE
protected java.lang.String USER_ATTR_USERNAME
protected java.lang.String USER_ATTR_FULLNAME
protected java.lang.String USER_ATTR_MD5PASSWORD
protected java.lang.String USER_ATTR_SHAPASSWORD
protected java.lang.String USER_ATTR_SECRETQUESTION
protected java.lang.String USER_ATTR_SECRETANSWER
protected java.lang.String USER_ATTR_EMAIL
protected java.lang.String ROLE_ATTR_ROLENAME
protected java.lang.String ROLE_ATTR_DESCRIPTION
| Constructor Detail |
|---|
public DBStore()
| Method Detail |
|---|
public void init(java.util.Map<java.lang.String,java.lang.String> paramsMap)
throws ArcGISSecurityException
init in interface SecurityStoreparamsMap - - HashMap generated from a DBConnectParams object.
It contains information that the ArcGISSecurityStore
uses to connect to an database.
ArcGISSecurityException - - if connection to a database cannot be made
public void reinitialize()
throws ArcGISSecurityException
reinitialize in interface SecurityStoreArcGISSecurityException - - if connection cannot be initializedpublic boolean isReadOnly()
isReadOnly in interface SecurityStore
public boolean testConnection(java.util.Map<java.lang.String,java.lang.String> paramsMap)
throws ArcGISSecurityException
testConnection in interface SecurityStoreparamsMap - - HashMap generated from a DBConnectParams object.
It contains information that the ArcGISSecurityStore
uses to connect to an database.
ArcGISSecurityException - - if there is an error while connecting
to the security data store
public void addUser(ArcGISSecurityUser user)
throws ArcGISSecurityException
addUser in interface SecurityStoreuser - - reference to ArcGISSecurityUser object that contains
user information.
ArcGISSecurityException - - if user cannot be added
public void deleteUser(java.lang.String userName)
throws ArcGISSecurityException
deleteUser in interface SecurityStoreuserName - - String identifier that uniquely identifies a user.
ArcGISSecurityException - - if the user cannot be deleted from the store.
public void modifyUser(ArcGISSecurityUser user)
throws ArcGISSecurityException
modifyUser in interface SecurityStoreuser - - reference to ArcGISSecurityUser object thats contains
modified user information.
ArcGISSecurityException
public java.lang.String getUserSecretQuestion(java.lang.String userName)
throws ArcGISSecurityException
getUserSecretQuestion in interface SecurityStoreuserName - - String represnting the unique identifier for a user.
ArcGISSecurityException - - if input parameter is null or cannot access security store
public java.lang.String forgotUserPassword(java.lang.String userName,
java.lang.String secretQuest,
java.lang.String secretAns)
throws ArcGISSecurityException
forgotUserPassword in interface SecurityStoreuserName - - String represnting the unique identifier for a user.secretQuest - - String represnting secret question set for a usersecretAns - - String represnting the answer to the secret question
ArcGISSecurityException - - if the password cannot be reset
public java.util.List<ArcGISSecurityUser> getAllUsers()
throws ArcGISSecurityException
getAllUsers in interface SecurityStoreArcGISSecurityException - - if users cannot be retrieved from the security store
public void addRole(ArcGISSecurityRole role)
throws ArcGISSecurityException
addRole in interface SecurityStorerole - - reference to ArcGISSecurityRole object that contains role information
ArcGISSecurityException - - if role cannot be added to the security store
public void deleteRole(java.lang.String rolename)
throws ArcGISSecurityException
deleteRole in interface SecurityStoreroleName - - name of the role to be deleted
ArcGISSecurityException - - if the role cannot be deleted from the security store
public void modifyRole(ArcGISSecurityRole role)
throws ArcGISSecurityException
modifyRole in interface SecurityStorerole - - reference to the ArcGISSecurityRole object that contains the
modified role information.
ArcGISSecurityException - - if role information cannot be modified.
public java.util.List<ArcGISSecurityRole> getAllRoles()
throws ArcGISSecurityException
getAllRoles in interface SecurityStoreArcGISSecurityException - - if a role cannot be retrieved from the security store
public ArcGISSecurityUser getUser(java.lang.String username)
throws ArcGISSecurityException
getUser in interface SecurityStoreuserName - - unique name of the user for whom to retrieve information.
ArcGISSecurityException - - if user information cannot be retrieved from the security store.
public ArcGISSecurityRole getRole(java.lang.String rolename)
throws ArcGISSecurityException
getRole in interface SecurityStoreroleName - - unique name of the role for whom to retrieve information.
ArcGISSecurityException - - if role information cannot be retrieved from the security store
public void addRolesToUser(java.lang.String username,
java.util.List<ArcGISSecurityRole> roleList)
throws ArcGISSecurityException
userName - - unique name of user to whom the roles are to be assignedroleList - - list of role objects that are to be assigned to the user
ArcGISSecurityException - - if users cannot be assigned to roles
public void addRolesToUser(java.lang.String username,
java.lang.String[] roleList)
throws ArcGISSecurityException
addRolesToUser in interface SecurityStoreuserName - - unique name of user to whom the roles are to be assignedroleList - - Array of strings containing the name of the roles that are
to be assigned to the user.
ArcGISSecurityException - - if users cannot be assigned to roles
protected void deleteAllUsersForRole(java.lang.String roleName)
throws ArcGISSecurityException
roleName - - name of the role that will be deleted from all users.
ArcGISSecurityException - - if the particular role cannot be deleted from
the list of users.
protected void deleteAllRolesFromUser(java.lang.String userName)
throws ArcGISSecurityException
userName - - name of the user whose all roles will be delted
ArcGISSecurityException - - if roles assigned to the user cannot be deleted
public void addUsersToRole(java.lang.String rolename,
java.lang.String[] userList)
throws ArcGISSecurityException
addUsersToRole in interface SecurityStoreroleName - - String representing the particular role that is to be assigned.userList - - Array of strings containing the name of the user to whom this
role is to be assigned
ArcGISSecurityException - - if this role cannot be assigned to the users.
public void deleteRolesFromUser(java.lang.String username,
java.lang.String[] roleList)
throws ArcGISSecurityException
deleteRolesFromUser in interface SecurityStoreuserName - - name of the user from whom the roles are to be deletedroleList - - array of strings containing name of the roles that are to be
deleted from this user.
ArcGISSecurityException - - if the user or any role in the list does not exist in the
security store.
public void deleteUsersFromRole(java.lang.String rolename,
java.lang.String[] userList)
throws ArcGISSecurityException
deleteUsersFromRole in interface SecurityStoreroleName - - String representing the particular role thats is to be
deleted.userList - - Array of strings containing the name of the users from whom this role
is to be deleted.
ArcGISSecurityException - - if the role cannot be deleted from the list of users
public java.util.List<ArcGISSecurityRole> getRolesForUser(java.lang.String username)
throws ArcGISSecurityException
getRolesForUser in interface SecurityStoreuserName - - String representing the user whose roles are to
be returned.
ArcGISSecurityException - - if role list cannot be retrieved
public java.util.List<ArcGISSecurityUser> getUsersForRole(java.lang.String rolename)
throws ArcGISSecurityException
getUsersForRole in interface SecurityStoreroleName - - String representing the role that is assigned to the
users.
ArcGISSecurityException - - if user list cannot be retrieved.
public boolean validateUser(java.lang.String username,
java.lang.String password)
throws ArcGISSecurityException
validateUser in interface SecurityStoreuserName - - String representing a particular useruserPassword - - String representing the user's password
ArcGISSecurityException - - if user information cannot be retrieved.public void close()
close in interface SecurityStore
public void createTables(boolean bUsersInDb,
boolean bRolesInDb)
throws ArcGISSecurityException
ArcGISSecurityException - - if tables and keys cannot be created in the security store
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||