com.esri.adf.security.store
Class ArcGISSecurityStore

java.lang.Object
  extended by com.esri.adf.security.store.ArcGISSecurityStore

public class ArcGISSecurityStore
extends java.lang.Object

The methods on this class can be used to access a particular implementation of the security store. The class uses the underlying implementation defined by the class name in the constructor to access the security store. You can write custom implementation to access a particular data store by implementing the SecurityStore interface and creating a ArcGISSecurityStore object for that implementation. ArcGIS Web Manager will use ArcGISSecurityStore to access the security store.


Field Summary
protected  SecurityStore secStore
           
 
Constructor Summary
ArcGISSecurityStore(java.lang.String implName)
          Constructor for ArcGISSecurityStore class.
 
Method Summary
 void addRole(ArcGISSecurityRole role)
          Add a new role to the security store.
 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.
 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 deleteRole(java.lang.String roleName)
          Delete a role from the security store.
 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.
 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 users 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.
 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 underlying implementation of the security store.
 boolean isReadOnly()
          Whether the data store is ready only or not depends on the underlying implementation that is used by the ArcGISSecurityStore object.
 void modifyRole(ArcGISSecurityRole role)
          Modify the information for a role in the security store.
 void modifyUser(ArcGISSecurityUser user)
          Modify the full name, password or other user information contained 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

secStore

protected SecurityStore secStore
Constructor Detail

ArcGISSecurityStore

public ArcGISSecurityStore(java.lang.String implName)
                    throws ArcGISSecurityException
Constructor for ArcGISSecurityStore class. It takes as input parameter the fully qualified name of the class whose implementation needs to be used.

Parameters:
implName - - String representing the fully qualified name of the class implementing the SecurityStore interface.
Throws:
ArcGISSecurityException - - if a new instance of the input class cannot be created.
Method Detail

init

public void init(java.util.Map<java.lang.String,java.lang.String> paramsMap)
          throws ArcGISSecurityException
Initialize the underlying implementation of the security store. This method needs to be called if the underlying implementation needs to initialize with particular input parameters.

Parameters:
connectParams - - It contains information that the ArcGISSecurityStore uses to connect to a particular data store.
Throws:
ArcGISSecurityException

reinitialize

public void reinitialize()
                  throws ArcGISSecurityException
Reinitialize the connection to data stores. Sometimes, the connections timeout, there needs to be a hook so that clients can call the object to reinitialize without having to create a new one.

Throws:
ArcGISSecurityException - - if connection cannot be initialized

isReadOnly

public boolean isReadOnly()
Whether the data store is ready only or not depends on the underlying implementation that is used by the ArcGISSecurityStore object.

Returns:
true if the data store is ready only, false otherwise

testConnection

public boolean testConnection(java.util.Map<java.lang.String,java.lang.String> paramsMap)
                       throws ArcGISSecurityException
Test the connection to the data store

Parameters:
connectParams - - connection parameters for the securit data store
Returns:
true if the method can successfully connect to he security store false otherwise
Throws:
ArcGISSecurityException - - if there is an error while connecting to the security data store

addUser

public void addUser(ArcGISSecurityUser user)
             throws ArcGISSecurityException
Add a user to the security store.

Parameters:
ArcGISSecurityUser - - reference to a ArcGISSecurityUser object that contains the user information.
Throws:
ArcGISSecurityException - - if the ArcGISSecurityUser cannot be added to the security store.

deleteUser

public void deleteUser(java.lang.String userName)
                throws ArcGISSecurityException
Delete a user from the security store.

Parameters:
userName - - unique identifier of the user who is to be deleted.
Throws:
ArcGISSecurityException - - if the user cannot be deleted from the security store.

modifyUser

public void modifyUser(ArcGISSecurityUser user)
                throws ArcGISSecurityException
Modify the full name, password or other user information contained in the security store.

Parameters:
ArcGISSecurityUser - - reference to ArcGISSecurityUser object that contains the ArcGISSecurityUser information.
Throws:
ArcGISSecurityException - - if the user information in the security store cannot be in modified.

getUserSecretQuestion

public java.lang.String getUserSecretQuestion(java.lang.String userName)
                                       throws ArcGISSecurityException
Returns the secret question that has been set for a user.

Parameters:
userName - - String represnting the unique identifier for a user.
Returns:
String representing the secret question for a user
Throws:
ArcGISSecurityException - - if input parameter is null or cannot access security store

forgotUserPassword

public java.lang.String forgotUserPassword(java.lang.String userName,
                                           java.lang.String secretQuest,
                                           java.lang.String secretAns)
                                    throws ArcGISSecurityException
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.

Parameters:
userName - - String represnting the unique identifier for a user.
secretQuest - - String represnting secret question set for a user
secretAns - - String represnting the answer to the secret question
Returns:
String representing the new password that has been set for the user.
Throws:
ArcGISSecurityException - - if the password cannot be reset

getAllUsers

public java.util.List<ArcGISSecurityUser> getAllUsers()
                                               throws ArcGISSecurityException
Returns a list of users that represent all the users currently in the security store.

Returns:
list of ArcGISSecurityUser objects
Throws:
ArcGISSecurityException - - if users cannot be retrieved from the security store

addRole

public void addRole(ArcGISSecurityRole role)
             throws ArcGISSecurityException
Add a new role to the security store.

Parameters:
role - - reference to ArcGISSecurityRole object that contains role information
Throws:
ArcGISSecurityException - - if role cannot be added to the security store

deleteRole

public void deleteRole(java.lang.String roleName)
                throws ArcGISSecurityException
Delete a role from the security store.

Parameters:
roleName - - name of the role to be deleted
Throws:
ArcGISSecurityException - - if the role cannot be deleted from the security store.

modifyRole

public void modifyRole(ArcGISSecurityRole role)
                throws ArcGISSecurityException
Modify the information for a role in the security store. When modifying role information, a particular role is identified by its roleName. You cannot modify the roleName for this role.

Parameters:
role - - reference to the ArcGISSecurityRole object that contains the modified role information.
Throws:
ArcGISSecurityException - - if role information cannot be modified.

getAllRoles

public java.util.List<ArcGISSecurityRole> getAllRoles()
                                               throws ArcGISSecurityException
Return list of roles that are present in the security store.

Returns:
list of ArcGISSecurityRole objects each representing a single role
Throws:
ArcGISSecurityException - - if a role cannot be retrieved from the security store

getUser

public ArcGISSecurityUser getUser(java.lang.String userName)
                           throws ArcGISSecurityException
Call this method to get information regarding a particular user in the security store.

Parameters:
userName - - unique name of the user for whom to retrieve information.
Returns:
ArcGISSecurityUser object that represents the user in security store.
Throws:
ArcGISSecurityException - - if user information cannot be retrieved from the security store.

getRole

public ArcGISSecurityRole getRole(java.lang.String roleName)
                           throws ArcGISSecurityException
Call this method to get information regarding a particular role in the security store.

Parameters:
roleName - - unique name of the role for whom to retrieve information.
Returns:
ArcGISSecurityRole object that represents the role in the security store.
Throws:
ArcGISSecurityException - - if role information cannot be retrieved from the security store

addRolesToUser

public void addRolesToUser(java.lang.String userName,
                           java.lang.String[] roleList)
                    throws ArcGISSecurityException
Assign list of roles to a user.

Parameters:
userName - - unique name of user to whom the roles are to be assigned
roleList - - array of strings containing the name of the roles that are to be assigned to the user.
Throws:
ArcGISSecurityException - - if users cannot be assigned to roles

addUsersToRole

public void addUsersToRole(java.lang.String roleName,
                           java.lang.String[] userList)
                    throws ArcGISSecurityException
Assign a role to a bunch of users.

Parameters:
roleName - - 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.
Throws:
ArcGISSecurityException - - if this role cannot be assigned to the users.

deleteRolesFromUser

public void deleteRolesFromUser(java.lang.String userName,
                                java.lang.String[] roleList)
                         throws ArcGISSecurityException
Delete list of roles that are assigned to a user.

Parameters:
userName - - name of the user from whom the roles are to be deleted
roleList - - Array of strings containing name of the roles that are to be deleted from this user.
Throws:
ArcGISSecurityException - - if the roles assigned to the user cannot be deleted

deleteUsersFromRole

public void deleteUsersFromRole(java.lang.String roleName,
                                java.lang.String[] userList)
                         throws ArcGISSecurityException
Delete a particular role from a bunch of users.

Parameters:
roleName - - String representing the particular role thats is to be deleted.
userList - - Array of strings containing the name of the users from whom this role
Throws:
ArcGISSecurityException - - if the role cannot be deleted from the list of users

getRolesForUser

public java.util.List<ArcGISSecurityRole> getRolesForUser(java.lang.String userName)
                                                   throws ArcGISSecurityException
Return a list of roles that are assigned to a particular user.

Parameters:
userName - - String representing the user whose roles are to be returned.
Returns:
List of ArcGISSecurityRole objects that are assigned to this user.
Throws:
ArcGISSecurityException - - if role list cannot be retrieved

getUsersForRole

public java.util.List<ArcGISSecurityUser> getUsersForRole(java.lang.String roleName)
                                                   throws ArcGISSecurityException
Return list of user who are assigned a particular role.

Parameters:
roleName - - String representing the role that is assigned to the users.
Returns:
List of ArcGISSecurityUser objects that are assigned this particular role.
Throws:
ArcGISSecurityException - - if user list cannot be retrieved.

validateUser

public boolean validateUser(java.lang.String userName,
                            java.lang.String password)
                     throws ArcGISSecurityException
Check the user credentials with the information available in the security store.

Parameters:
userName - - String representing a particular user
userPassword - - String representing the user's password
Returns:
true if the user credentials match with the ones in the security store.
Throws:
ArcGISSecurityException - - if user information cannot be retrieved.

close

public void close()
Close all connections to the security store.