com.konakartadmin.bl
Class AdminSecurityMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminSecurityMgr
All Implemented Interfaces:
AdminSecurityMgrIf
Direct Known Subclasses:
AdminSecurityMgrEE

public class AdminSecurityMgr
extends AdminBaseMgr
implements AdminSecurityMgrIf

The AdminSecurityMgr - for Managing Security Objects for the Admin Application


Nested Class Summary
protected  class AdminSecurityMgr.LoginAttempt
          Class that contains the login attempt, information for a user so that we can block hackers
protected  class AdminSecurityMgr.SessionData
          Class that contains the login attempt, information for a user so that we can block hackers
protected  class AdminSecurityMgr.StaticData
          Used to store the static data of this manager
 
Field Summary
(package private) static int ADMIN_USER_ID
           
(package private) static int DEFAULT_SESSION_DURATION
           
protected static org.apache.commons.logging.Log log
          the log
protected static java.lang.String mutex
           
protected static java.util.Map<java.lang.String,AdminSecurityMgr.StaticData> staticDataHM
          Hash Map that contains the static data
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminSecurityMgr(KKAdminIf eng)
          Constructor
 
Method Summary
 void addApiCallsToRole(AdminApiCall[] apiCalls, int roleId)
          Adds the array of AdminApiCall objects to the role identified by the roleId parameter.
 void addCustomDataToSession(java.lang.String sessionId, java.lang.String data, int position)
          Implemented in AdminSecurityMgrEE
 void addPanelsToRole(AdminPanel[] panels, int roleId)
          Adds the array of AdminPanel objects to the role identified by the roleId parameter.
 void addRolesToUser(AdminRole[] roles, int userId)
          Adds the array of AdminRole objects to the user identified by the userId parameter.
protected  java.lang.String byteToHex(byte data)
          Utility method
 void changePassword(int custId, java.lang.String currentPassword, java.lang.String newPassword)
          The method ensures that the current password is correct, and then changes it with the new password.
protected  int checkPassword(java.lang.String eMail, java.lang.String password)
          The customer is searched for using his email as the key.
protected  int checkPasswordFromDatabase(java.lang.String user, java.lang.String password)
          The customer is searched for using his email as the key.
 int checkSession(java.lang.String sessionId, java.lang.String apiCall)
          The given sessionId is checked to see whether it exists and whether it is has timed out.
protected  java.lang.String createSessionId()
          create a sessionId string
 void deleteApiCall(int apiCallId)
          Deletes the apiCallId identified by the apiCallId parameter.
 int deleteExpiredSessions()
          Deletes all sessions that have expired.
 void deletePanel(int panelId)
          Deletes the panel identified by the panelId parameter.
 void deleteRole(int roleId)
          Deletes the role identified by the roleId parameter.
 void editApiCall(AdminApiCall apiCall)
          Edit an ApiCall.
 void editPanel(AdminPanel panel)
          Edit a Panel.
 void editRole(AdminRole role)
          Edit a Role.
 java.lang.String encrypt(java.lang.String password)
          Generates a random byte which it concatenates with the password placing it in front (i.e.
protected  AdminLoginIntegrationMgrInterface getAdminLoginIntegMgrInstanceByName(java.lang.String className)
          Called to instantiate an AdminLoginIntegrationMgr.
protected  AdminLoginIntegrationMgrInterface getAdminLoginIntegrationMgr()
          Used to get an instance of the AdminLoginIntegrationMgr
 AdminApiCall[] getAllApiCalls()
          Retrieves all apiCalls in an array
 AdminPanel[] getAllPanels()
          Retrieves all panels in an array
 AdminRole[] getAllRoles()
          Returns all roles
 AdminApiCall getApiCall(int apiCallId)
          Returns the AdminApiCall referenced by the apiCallId.
protected  java.util.HashMap<java.lang.String,java.lang.String> getAPICallHashMap(AdminRole[] roles)
          Get the API calls that the user can access, in the form of a hash map
 AdminApiCall[] getApiCallsPerRole(int roleId)
          Retrieves an array of AdminApiCall objects for the role.
 java.lang.String getCustomDataFromSession(java.lang.String sessionId, int position)
          Implemented in AdminSecurityMgrEE
protected  int getExpiryTimeInSecs()
          Utility method to return the expiry time in minutes calculated from now.
protected  AdminLDAPMgrIf getLDAPMgr()
          Used to get an instance of the LDAPMgr
 AdminPanel getPanel(int panelId)
          Returns the AdminPanel referenced by the panelId.
 AdminPanel[] getPanelsPerRole(int roleId)
          Retrieves an array of AdminPanel objects for the role.
 AdminRole getRole(int roleId)
          Returns the AdminRole referenced by the roleId.
 AdminRole[] getRolesPerUser(int userId)
          Retrieves an array of AdminRole objects for the user.
 AdminSession getSession(java.lang.String sessionId)
          Retrieves the session object for the specified sessionId
protected  int getSessionDurationInSecs()
          Utility method to return the session duration in seconds.
 int getTimeInSecs()
          Utility method to return the current time in seconds
 int insertApiCall(AdminApiCall apiCall)
          Insert a new apiCall.
 int insertPanel(AdminPanel panel)
          Insert a new Panel.
 int insertRole(AdminRole role)
          Insert a new Role.
protected  void insertSessionId(java.lang.String sessionId, int expiryInSecs, int customerId)
          Insert the sessionId passed in as a parameter
 boolean isSuperUser(int userId)
          Returns true if the user has a superUser role otherwise false
protected  boolean isUserBlocked(java.lang.String user)
           
 boolean isUserSuperUser(int userId)
          Determines whether or not the user with the specified userId is a Super User.
 java.lang.String login(java.lang.String user, java.lang.String password)
          Returns a session id if successful.
 void logout(java.lang.String sessionId)
          Used to logout the user with the specified sessionId
 void refreshConfigs()
          Refresh the configuration of the Admin Currency Manager
 void removeApiCallsFromRole(AdminApiCall[] apiCalls, int roleId)
          Removes the array of AdminApiCall objects from the role identified by the roleId parameter.
 void removePanelsFromRole(AdminPanel[] panels, int roleId)
          Removes the array of AdminPanel objects from the role identified by the roleId parameter.
 void removeRolesFromUser(AdminRole[] roles, int userId)
          Removes the array of AdminRole objects from the user identified by the userId parameter.
protected  void removeUser(java.lang.String user)
          Removes the user from the hash map
protected  void setUpSecurityData(int userId)
          Put the API Calls that the user can access in the hash table.
protected  void setUpSessionData(int userId)
          Set up the SessionData for the user.
protected  char toHexChar(int i)
          Utility method
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log


DEFAULT_SESSION_DURATION

static final int DEFAULT_SESSION_DURATION
See Also:
Constant Field Values

ADMIN_USER_ID

static final int ADMIN_USER_ID
See Also:
Constant Field Values

mutex

protected static java.lang.String mutex

staticDataHM

protected static java.util.Map<java.lang.String,AdminSecurityMgr.StaticData> staticDataHM
Hash Map that contains the static data

Constructor Detail

AdminSecurityMgr

public AdminSecurityMgr(KKAdminIf eng)
                 throws java.lang.Exception
Constructor

Parameters:
eng - the KKAdmin engine
Throws:
java.lang.Exception
Method Detail

setUpSecurityData

protected void setUpSecurityData(int userId)
                          throws KKAdminException,
                                 org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException
Put the API Calls that the user can access in the hash table. If a set of API calls already exists, then delete those.

Parameters:
userId -
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

setUpSessionData

protected void setUpSessionData(int userId)
                         throws KKAdminException,
                                org.apache.torque.TorqueException,
                                com.workingdogs.village.DataSetException
Set up the SessionData for the user. This is normally called during login.

Parameters:
userId -
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getAPICallHashMap

protected java.util.HashMap<java.lang.String,java.lang.String> getAPICallHashMap(AdminRole[] roles)
Get the API calls that the user can access, in the form of a hash map

Parameters:
roles -
Returns:
Returns a HashMap of API Call names

login

public java.lang.String login(java.lang.String user,
                              java.lang.String password)
                       throws java.lang.Exception
Returns a session id if successful. Otherwise returns null.

Specified by:
login in interface AdminSecurityMgrIf
Parameters:
user -
password -
Returns:
SessionId if OK. Otherwise null.
Throws:
java.lang.Exception

insertSessionId

protected void insertSessionId(java.lang.String sessionId,
                               int expiryInSecs,
                               int customerId)
                        throws org.apache.torque.TorqueException,
                               KKAdminException
Insert the sessionId passed in as a parameter

Parameters:
sessionId -
expiryInSecs -
customerId -
Throws:
org.apache.torque.TorqueException
KKAdminException

createSessionId

protected java.lang.String createSessionId()
create a sessionId string

Returns:
Returns a newly created sessionId string

logout

public void logout(java.lang.String sessionId)
            throws java.lang.Exception
Used to logout the user with the specified sessionId

Specified by:
logout in interface AdminSecurityMgrIf
Parameters:
sessionId - The session Id of the logged in user
Throws:
java.lang.Exception

checkPasswordFromDatabase

protected int checkPasswordFromDatabase(java.lang.String user,
                                        java.lang.String password)
                                 throws org.apache.torque.TorqueException,
                                        com.workingdogs.village.DataSetException,
                                        java.security.NoSuchAlgorithmException,
                                        KKAdminException
The customer is searched for using his email as the key. We retrieve the hashed password from the DB; remove the colon and the random byte. We concatenate the random byte to the input password and encrypt the lot. Then we have to check whether the result matches the hashed password.

Parameters:
user -
password -
Returns:
id of customer if password matches. Otherwise a negative number.
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.security.NoSuchAlgorithmException
KKAdminException

isUserBlocked

protected boolean isUserBlocked(java.lang.String user)
                         throws KKAdminException
Parameters:
user -
Returns:
Return true if the user is blocked
Throws:
KKAdminException

isSuperUser

public boolean isSuperUser(int userId)
                    throws KKAdminException
Returns true if the user has a superUser role otherwise false

Specified by:
isSuperUser in interface AdminSecurityMgrIf
Parameters:
userId - the userId (customerId) of the user to check
Returns:
Return true if the user is a Super User
Throws:
KKAdminException

removeUser

protected void removeUser(java.lang.String user)
                   throws KKAdminException
Removes the user from the hash map

Parameters:
user -
Throws:
KKAdminException

getSession

public AdminSession getSession(java.lang.String sessionId)
                        throws java.lang.Exception
Retrieves the session object for the specified sessionId

Specified by:
getSession in interface AdminSecurityMgrIf
Parameters:
sessionId - the session to read
Returns:
Returns the AdminSession object for the session
Throws:
java.lang.Exception

checkSession

public int checkSession(java.lang.String sessionId,
                        java.lang.String apiCall)
                 throws java.lang.Exception
The given sessionId is checked to see whether it exists and whether it is has timed out. If it is valid, the expiry attribute is updated. If the apiCall is not null, we also check for API Call security.

Specified by:
checkSession in interface AdminSecurityMgrIf
Parameters:
sessionId -
apiCall -
Returns:
Returns customerId
Throws:
java.lang.Exception

changePassword

public void changePassword(int custId,
                           java.lang.String currentPassword,
                           java.lang.String newPassword)
                    throws java.lang.Exception
The method ensures that the current password is correct, and then changes it with the new password. It allows any password length and relies on the application to ensure that a minimum length is guaranteed.

Specified by:
changePassword in interface AdminSecurityMgrIf
Parameters:
custId - the customer Id of the customer whose password to change
currentPassword - current password
newPassword - new password
Throws:
java.lang.Exception

checkPassword

protected int checkPassword(java.lang.String eMail,
                            java.lang.String password)
                     throws org.apache.torque.TorqueException,
                            com.workingdogs.village.DataSetException,
                            java.security.NoSuchAlgorithmException,
                            KKAdminException
The customer is searched for using his email as the key. We retrieve the hashed password from the DB; remove the colon and the random byte. We concatenate the random byte to the input password and encrypt the lot. Then we have to check whether the result matches the hashed password.

Parameters:
eMail -
password -
Returns:
id of customer if password matches. Otherwise a negative number.
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.security.NoSuchAlgorithmException
KKAdminException

deleteExpiredSessions

public int deleteExpiredSessions()
                          throws org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException,
                                 KKAdminException
Deletes all sessions that have expired. Returns the number of non expired sessions.

Specified by:
deleteExpiredSessions in interface AdminSecurityMgrIf
Returns:
Returns the number of remaining sessions
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getExpiryTimeInSecs

protected int getExpiryTimeInSecs()
                           throws KKAdminException
Utility method to return the expiry time in minutes calculated from now.

Returns:
Returns the expiry time
Throws:
KKAdminException

getSessionDurationInSecs

protected int getSessionDurationInSecs()
                                throws KKAdminException
Utility method to return the session duration in seconds.

Returns:
Returns the the session duration
Throws:
KKAdminException

getTimeInSecs

public int getTimeInSecs()
Utility method to return the current time in seconds

Specified by:
getTimeInSecs in interface AdminSecurityMgrIf
Returns:
Returns the time

encrypt

public java.lang.String encrypt(java.lang.String password)
                         throws java.security.NoSuchAlgorithmException
Generates a random byte which it concatenates with the password placing it in front (i.e. "randomByte" + "Password"). Once the string has been encrypted it is returned as "encrypted string" : "random byte" . For example : password = secret and random byte = ce, then we encrypt cesecret . If the result is "51fc1050abe9ce692565814ac52a9ed2" we return 51fc1050abe9ce692565814ac52a9ed2:ce

Specified by:
encrypt in interface AdminSecurityMgrIf
Parameters:
password -
Returns:
Returns an encrypted password
Throws:
java.security.NoSuchAlgorithmException

byteToHex

protected java.lang.String byteToHex(byte data)
Utility method

Parameters:
data -
Returns:
Returns hex representation of the data

toHexChar

protected char toHexChar(int i)
Utility method

Parameters:
i -
Returns:
Returns a hex representation of the char

getRolesPerUser

public AdminRole[] getRolesPerUser(int userId)
                            throws org.apache.torque.TorqueException,
                                   com.workingdogs.village.DataSetException,
                                   KKAdminException
Retrieves an array of AdminRole objects for the user. Each AdminRole object will contain an array of AdminPanel objects and AdminApiCall objects if defined.

Specified by:
getRolesPerUser in interface AdminSecurityMgrIf
Parameters:
userId - the userId of the user whose roles & panels are returned. If the userId is 0, all roles and all panels are returned.
Returns:
Returns an array of roles with AdmnPanel and AdminApiCall objects attached if defined
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

isUserSuperUser

public boolean isUserSuperUser(int userId)
                        throws org.apache.torque.TorqueException,
                               com.workingdogs.village.DataSetException,
                               KKAdminException
Determines whether or not the user with the specified userId is a Super User. This does not access any cached data.. it always looks up the roles of the user in the database.

Parameters:
userId - the userId of the user to check. If the user with the specified userId isn't found an exception is returned.
Returns:
Returns true if the user is a Super User, otherwise false
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getAllRoles

public AdminRole[] getAllRoles()
                        throws org.apache.torque.TorqueException,
                               com.workingdogs.village.DataSetException,
                               KKAdminException
Returns all roles

Specified by:
getAllRoles in interface AdminSecurityMgrIf
Returns:
Returns an array of roles
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getPanelsPerRole

public AdminPanel[] getPanelsPerRole(int roleId)
                              throws org.apache.torque.TorqueException,
                                     com.workingdogs.village.DataSetException,
                                     KKAdminException
Retrieves an array of AdminPanel objects for the role.

Specified by:
getPanelsPerRole in interface AdminSecurityMgrIf
Parameters:
roleId -
Returns:
Returns an array of panels
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getApiCallsPerRole

public AdminApiCall[] getApiCallsPerRole(int roleId)
                                  throws org.apache.torque.TorqueException,
                                         com.workingdogs.village.DataSetException,
                                         KKAdminException
Retrieves an array of AdminApiCall objects for the role.

Specified by:
getApiCallsPerRole in interface AdminSecurityMgrIf
Parameters:
roleId -
Returns:
Returns an array of adminApiCalls
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getAllPanels

public AdminPanel[] getAllPanels()
                          throws org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException,
                                 KKAdminException
Retrieves all panels in an array

Specified by:
getAllPanels in interface AdminSecurityMgrIf
Returns:
Returns an array of panels
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getAllApiCalls

public AdminApiCall[] getAllApiCalls()
                              throws org.apache.torque.TorqueException,
                                     com.workingdogs.village.DataSetException,
                                     KKAdminException
Retrieves all apiCalls in an array

Specified by:
getAllApiCalls in interface AdminSecurityMgrIf
Returns:
Returns an array of apiCalls
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

insertRole

public int insertRole(AdminRole role)
               throws org.apache.torque.TorqueException,
                      KKAdminException
Insert a new Role. The role name is mandatory.

Specified by:
insertRole in interface AdminSecurityMgrIf
Parameters:
role -
Returns:
Returns the id of the inserted AdminRole object
Throws:
org.apache.torque.TorqueException
KKAdminException

editRole

public void editRole(AdminRole role)
              throws org.apache.torque.TorqueException,
                     KKAdminException
Edit a Role. Only the role name and the role description can be modified. All other attributes are ignored.

Specified by:
editRole in interface AdminSecurityMgrIf
Parameters:
role -
Throws:
org.apache.torque.TorqueException
KKAdminException

getRole

public AdminRole getRole(int roleId)
                  throws org.apache.torque.TorqueException,
                         com.workingdogs.village.DataSetException,
                         KKAdminException
Returns the AdminRole referenced by the roleId.

Specified by:
getRole in interface AdminSecurityMgrIf
Parameters:
roleId -
Returns:
Returns an AdminRole object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

deleteRole

public void deleteRole(int roleId)
                throws org.apache.torque.TorqueException,
                       KKAdminException
Deletes the role identified by the roleId parameter. All customers_to_role and role_to_panel and role_to_api_call records are also deleted.

Specified by:
deleteRole in interface AdminSecurityMgrIf
Parameters:
roleId -
Throws:
org.apache.torque.TorqueException
KKAdminException

addRolesToUser

public void addRolesToUser(AdminRole[] roles,
                           int userId)
                    throws java.lang.Exception
Adds the array of AdminRole objects to the user identified by the userId parameter. The roles must already exist in the database.

Specified by:
addRolesToUser in interface AdminSecurityMgrIf
Parameters:
roles -
userId -
Throws:
java.lang.Exception

removeRolesFromUser

public void removeRolesFromUser(AdminRole[] roles,
                                int userId)
                         throws java.lang.Exception
Removes the array of AdminRole objects from the user identified by the userId parameter.

Specified by:
removeRolesFromUser in interface AdminSecurityMgrIf
Parameters:
roles -
userId -
Throws:
java.lang.Exception

insertPanel

public int insertPanel(AdminPanel panel)
                throws org.apache.torque.TorqueException,
                       KKAdminException
Insert a new Panel. The panel code is mandatory and the panel description is optional. All other attributes are ignored.

Specified by:
insertPanel in interface AdminSecurityMgrIf
Parameters:
panel -
Returns:
Returns the id of the inserted AdminPanel object
Throws:
org.apache.torque.TorqueException
KKAdminException

insertApiCall

public int insertApiCall(AdminApiCall apiCall)
                  throws org.apache.torque.TorqueException,
                         KKAdminException
Insert a new apiCall. The apiCall name is mandatory and the apiCall description is optional. All other attributes are ignored.

Specified by:
insertApiCall in interface AdminSecurityMgrIf
Parameters:
apiCall -
Returns:
Returns the id of the inserted AdminPanel object
Throws:
org.apache.torque.TorqueException
KKAdminException

editPanel

public void editPanel(AdminPanel panel)
               throws org.apache.torque.TorqueException,
                      KKAdminException
Edit a Panel. Only the panel code and the panel description can be modified. All other attributes are ignored.

Specified by:
editPanel in interface AdminSecurityMgrIf
Parameters:
panel -
Throws:
org.apache.torque.TorqueException
KKAdminException

editApiCall

public void editApiCall(AdminApiCall apiCall)
                 throws org.apache.torque.TorqueException,
                        KKAdminException
Edit an ApiCall. Only the apiCall name and the apiCall description can be modified. All other attributes are ignored.

Specified by:
editApiCall in interface AdminSecurityMgrIf
Parameters:
apiCall -
Throws:
org.apache.torque.TorqueException
KKAdminException

deletePanel

public void deletePanel(int panelId)
                 throws org.apache.torque.TorqueException,
                        KKAdminException
Deletes the panel identified by the panelId parameter. All role_to_panel records are also deleted.

Specified by:
deletePanel in interface AdminSecurityMgrIf
Parameters:
panelId -
Throws:
org.apache.torque.TorqueException
KKAdminException

deleteApiCall

public void deleteApiCall(int apiCallId)
                   throws org.apache.torque.TorqueException,
                          KKAdminException
Deletes the apiCallId identified by the apiCallId parameter. All role_to_api_call records are also deleted.

Specified by:
deleteApiCall in interface AdminSecurityMgrIf
Parameters:
apiCallId -
Throws:
org.apache.torque.TorqueException
KKAdminException

getPanel

public AdminPanel getPanel(int panelId)
                    throws org.apache.torque.TorqueException,
                           com.workingdogs.village.DataSetException,
                           KKAdminException
Returns the AdminPanel referenced by the panelId.

Specified by:
getPanel in interface AdminSecurityMgrIf
Parameters:
panelId -
Returns:
Returns an AdminPanel object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getApiCall

public AdminApiCall getApiCall(int apiCallId)
                        throws org.apache.torque.TorqueException,
                               com.workingdogs.village.DataSetException,
                               KKAdminException
Returns the AdminApiCall referenced by the apiCallId.

Specified by:
getApiCall in interface AdminSecurityMgrIf
Parameters:
apiCallId -
Returns:
Returns an AdminApiCall object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

addPanelsToRole

public void addPanelsToRole(AdminPanel[] panels,
                            int roleId)
                     throws KKAdminException,
                            org.apache.torque.TorqueException,
                            com.workingdogs.village.DataSetException
Adds the array of AdminPanel objects to the role identified by the roleId parameter. The panel identified by panelId for each panel, and the role identified by the roleId, must already exist in the database. The panel name and description are ignored.

Specified by:
addPanelsToRole in interface AdminSecurityMgrIf
Parameters:
panels -
roleId -
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

addApiCallsToRole

public void addApiCallsToRole(AdminApiCall[] apiCalls,
                              int roleId)
                       throws KKAdminException,
                              org.apache.torque.TorqueException,
                              com.workingdogs.village.DataSetException
Adds the array of AdminApiCall objects to the role identified by the roleId parameter. The apiCall identified by apiCallId for each apiCall, and the role identified by the roleId, must already exist in the database. The apiCall name and description are ignored.

Specified by:
addApiCallsToRole in interface AdminSecurityMgrIf
Parameters:
apiCalls -
roleId -
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

removePanelsFromRole

public void removePanelsFromRole(AdminPanel[] panels,
                                 int roleId)
                          throws KKAdminException,
                                 org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException
Removes the array of AdminPanel objects from the role identified by the roleId parameter.

Specified by:
removePanelsFromRole in interface AdminSecurityMgrIf
Parameters:
panels -
roleId -
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

removeApiCallsFromRole

public void removeApiCallsFromRole(AdminApiCall[] apiCalls,
                                   int roleId)
                            throws KKAdminException,
                                   org.apache.torque.TorqueException,
                                   com.workingdogs.village.DataSetException
Removes the array of AdminApiCall objects from the role identified by the roleId parameter.

Specified by:
removeApiCallsFromRole in interface AdminSecurityMgrIf
Parameters:
apiCalls -
roleId -
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getAdminLoginIntegrationMgr

protected AdminLoginIntegrationMgrInterface getAdminLoginIntegrationMgr()
Used to get an instance of the AdminLoginIntegrationMgr

Returns:
Returns an LoginIntegrationMgr Object

getLDAPMgr

protected AdminLDAPMgrIf getLDAPMgr()
Used to get an instance of the LDAPMgr

Returns:
Returns an LDAPMgr Object

getAdminLoginIntegMgrInstanceByName

protected AdminLoginIntegrationMgrInterface getAdminLoginIntegMgrInstanceByName(java.lang.String className)
                                                                         throws java.lang.InstantiationException,
                                                                                java.lang.IllegalAccessException,
                                                                                java.lang.ClassNotFoundException,
                                                                                java.lang.IllegalArgumentException,
                                                                                java.lang.reflect.InvocationTargetException
Called to instantiate an AdminLoginIntegrationMgr. It determines whether the AdminLoginIntegrationMgr has a constructor where KKAdmin is passed in and if it does, then this constructor is used. Otherwise the empty constructor is used.

Parameters:
className -
Returns:
Returns an instantiated Module
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.IllegalArgumentException

refreshConfigs

public void refreshConfigs()
                    throws KKAdminException
Refresh the configuration of the Admin Currency Manager

Specified by:
refreshConfigs in interface AdminSecurityMgrIf
Overrides:
refreshConfigs in class AdminBaseMgr
Throws:
KKAdminException

addCustomDataToSession

public void addCustomDataToSession(java.lang.String sessionId,
                                   java.lang.String data,
                                   int position)
                            throws org.apache.torque.TorqueException,
                                   KKAdminException
Implemented in AdminSecurityMgrEE

Specified by:
addCustomDataToSession in interface AdminSecurityMgrIf
Parameters:
sessionId -
data -
position -
Throws:
org.apache.torque.TorqueException
KKAdminException

getCustomDataFromSession

public java.lang.String getCustomDataFromSession(java.lang.String sessionId,
                                                 int position)
                                          throws KKAdminException,
                                                 org.apache.torque.TorqueException,
                                                 com.workingdogs.village.DataSetException
Implemented in AdminSecurityMgrEE

Specified by:
getCustomDataFromSession in interface AdminSecurityMgrIf
Parameters:
sessionId -
position -
Returns:
returns a String containing the Customer Data from the Session
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException


Copyright © 2011 DS Data Systems UK Ltd.