|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.konakart.bl.BaseMgr
com.konakart.bl.SecurityMgr
public class SecurityMgr
Security Management
| Field Summary | |
|---|---|
protected static org.apache.commons.logging.Log |
log
the log |
| Fields inherited from class com.konakart.bl.BaseMgr |
|---|
templateBaseDir |
| Constructor Summary | |
|---|---|
SecurityMgr(KKEngIf eng)
Constructor |
|
| Method Summary | |
|---|---|
void |
addCustomDataToSession(java.lang.String sessionId,
java.lang.String data,
int position)
Implemented in SecurityMgrEE |
protected java.lang.String |
byteToHex(byte data)
Utility method |
void |
changePassword(java.lang.String sessionId,
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. |
int |
checkSession(java.lang.String sessionId)
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 |
enableCustomer(java.lang.String secretKey)
This method retrieves the SSO token using the Secret Key. |
java.lang.String |
encrypt(java.lang.String password)
Generates a random byte which it concatenates with the password placing it in front (i.e. |
java.lang.String |
getCustomDataFromSession(java.lang.String sessionId,
int position)
Implemented in SecurityMgrEE |
protected int |
getExpiryTimeInSecs()
Utility method to return the expiry time in minutes calculated from now. |
protected LDAPMgrIf |
getLDAPMgr()
Used to get an instance of the LDAPMgr |
protected LoginIntegrationMgrInterface |
getLoginIntegrationMgr()
Used to get an instance of the LoginIntegrationMgr |
java.lang.String |
getRandomPassword(int length)
If length == 0, the configuration value ENTRY_PASSWORD_MIN_LENGTH is used. |
protected int |
getSessionDurationInSecs()
Utility method to return the session duration in seconds. |
SSOTokenIf |
getSSOToken(java.lang.String secretKey,
boolean deleteToken)
Returns an SSOToken object for the secretKey (UUID). |
int |
getTimeInSecs()
Utility method to return the current time in seconds |
protected void |
insertSessionId(java.lang.String sessionId,
int expiryInSecs,
int customerId)
Insert the sessionId passed in as a parameter |
protected java.lang.String |
login(int customerId)
protected login method that assumes that all checks have already been taken. |
java.lang.String |
login(java.lang.String emailAddr,
java.lang.String password)
Returns a session id if successful. |
java.lang.String |
loginByAdmin(java.lang.String adminSession,
int customerId)
Used to log in to the application as a customer by an Administrator. |
void |
logout(java.lang.String sessionId)
Logout the user with the specified session Id. |
java.lang.String |
saveSSOToken(SSOTokenIf token)
Saves the SSOToken in the database and returns a UUID secret key identifier. |
void |
sendNewPassword(java.lang.String emailAddr,
java.lang.String subject,
java.lang.String countryCode)
Deprecated. |
EmailIf |
sendNewPassword1(java.lang.String emailAddr,
EmailOptionsIf options)
If a customer exists with the email address passed in as a parameter, then a new password is generated and sent to the customer. |
protected char |
toHexChar(int i)
Utility method |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.commons.logging.Log log
| Constructor Detail |
|---|
public SecurityMgr(KKEngIf eng)
throws java.lang.Exception
eng -
java.lang.Exception| Method Detail |
|---|
public java.lang.String login(java.lang.String emailAddr,
java.lang.String password)
throws java.lang.Exception
login in interface SecurityMgrIfemailAddr - password -
java.lang.Exception
protected java.lang.String login(int customerId)
throws java.lang.Exception
customerId -
java.lang.Exception
protected void insertSessionId(java.lang.String sessionId,
int expiryInSecs,
int customerId)
throws org.apache.torque.TorqueException,
KKException
sessionId - expiryInSecs - customerId -
org.apache.torque.TorqueException
KKExceptionprotected java.lang.String createSessionId()
public void logout(java.lang.String sessionId)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException,
KKException
logout in interface SecurityMgrIfsessionId -
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKExceptionpublic int getTimeInSecs()
getTimeInSecs in interface SecurityMgrIfprotected int getExpiryTimeInSecs()
protected int getSessionDurationInSecs()
public int checkSession(java.lang.String sessionId)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException,
KKException
checkSession in interface SecurityMgrIfsessionId -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException
public java.lang.String encrypt(java.lang.String password)
throws java.security.NoSuchAlgorithmException
encrypt in interface SecurityMgrIfpassword -
java.security.NoSuchAlgorithmException
protected int checkPassword(java.lang.String eMail,
java.lang.String password)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException,
java.security.NoSuchAlgorithmException,
KKException
eMail - password -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.security.NoSuchAlgorithmException
KKExceptionprotected java.lang.String byteToHex(byte data)
data -
protected char toHexChar(int i)
i -
public void changePassword(java.lang.String sessionId,
java.lang.String currentPassword,
java.lang.String newPassword)
throws java.lang.Exception
changePassword in interface SecurityMgrIfsessionId - currentPassword - newPassword -
java.lang.Exception
public java.lang.String getRandomPassword(int length)
throws java.lang.Exception
getRandomPassword in interface SecurityMgrIflength -
java.lang.Exception
public void sendNewPassword(java.lang.String emailAddr,
java.lang.String subject,
java.lang.String countryCode)
throws java.security.NoSuchAlgorithmException,
java.lang.Exception
sendNewPassword in interface SecurityMgrIfemailAddr - subject - countryCode -
java.security.NoSuchAlgorithmException
java.lang.Exception
public EmailIf sendNewPassword1(java.lang.String emailAddr,
EmailOptionsIf options)
throws java.security.NoSuchAlgorithmException,
java.lang.Exception
sendNewPassword1 in interface SecurityMgrIfemailAddr - options -
java.security.NoSuchAlgorithmException
java.lang.Exception
public java.lang.String loginByAdmin(java.lang.String adminSession,
int customerId)
throws java.lang.Exception
loginByAdmin in interface SecurityMgrIfadminSession - The session of a logged in administrator usercustomerId - The id of the customer to login as
java.lang.Exceptionprotected LoginIntegrationMgrInterface getLoginIntegrationMgr()
protected LDAPMgrIf getLDAPMgr()
public void addCustomDataToSession(java.lang.String sessionId,
java.lang.String data,
int position)
throws org.apache.torque.TorqueException,
KKException
addCustomDataToSession in interface SecurityMgrIfsessionId - The sessionIddata - The data to be savedposition - This must be in the range of 1-5 to identify custom1 to custom5
org.apache.torque.TorqueException
KKException
public java.lang.String getCustomDataFromSession(java.lang.String sessionId,
int position)
throws KKException,
org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException
getCustomDataFromSession in interface SecurityMgrIfsessionId - The sessionIdposition - This must be in the range of 1-5 to identify custom1 to custom5
KKException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
public java.lang.String saveSSOToken(SSOTokenIf token)
throws java.lang.Exception
saveSSOToken in interface SecurityMgrIftoken - The SSO token to be saved
java.lang.Exception
public SSOTokenIf getSSOToken(java.lang.String secretKey,
boolean deleteToken)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException
deleteToken parameter is set to true, the token is deleted from the
database after having been read.
getSSOToken in interface SecurityMgrIfsecretKey - The UUID secretKey used to identify the tokendeleteToken - The token is deleted from the database after being read
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
public void enableCustomer(java.lang.String secretKey)
throws java.lang.Exception
enableCustomer in interface SecurityMgrIfsecretKey -
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||