org.eclipse.higgins.userprofile.inmem
Class MemoryUserProfileService

java.lang.Object
  extended byorg.eclipse.higgins.userprofile.inmem.MemoryUserProfileService
All Implemented Interfaces:
org.eclipse.higgins.registry.IServiceProvider, IUserProfileService

public class MemoryUserProfileService
extends Object
implements IUserProfileService


Constructor Summary
MemoryUserProfileService()
           
 
Method Summary
 Category addCategory(CallbackHandler handler, Category category)
           
 void addSelectorAndSetPasswordByPasswordIsapMd5(String userId, String privateSelectorINumber, byte[] passwordIsapMd5, String newPassword)
          Add the new Selector given by the privateSelectorINumber and set the new password without remembering it.
 UserProfile addUserProfile(CallbackHandler handler, UserProfile userProfile)
           
 CardInformation clearCardCredential(CallbackHandler handler, org.eclipse.higgins.icard.CUID cuid)
          Clears credential information for the given card.
 void deleteCategory(CallbackHandler handler, String categoryId)
           
 void deleteOldPassword(CallbackHandler handler)
          Deletes the old password and change it to the new one.
 void deleteUserProfile(CallbackHandler handler)
           
 CardInformation getCardInformation(CallbackHandler handler, org.eclipse.higgins.icard.CUID cuid)
          Returns the whole information about the given card
 ICardUsageManager getCardUsageManager(CallbackHandler handler)
          Returns class that manages all Card usage and URI relations information
 List getCategories(CallbackHandler handler)
           
 org.eclipse.higgins.registry.IConfiguration getConfiguration()
           
 String getID()
           
 PolicyVersion getRPPolicyVersion(CallbackHandler handler, URI url)
           
 PolicyVersion getRPPolicyVersion(CallbackHandler handler, WebForm form)
           
 UserProfile getUserProfile(CallbackHandler handler)
           
 Category modifyCategory(CallbackHandler handler, Category category)
           
 UserProfile modifyUserProfile(CallbackHandler handler, UserProfile userProfile)
           
 String resetPassword(CallbackHandler handler)
           
 String resolveUserIdentifier(String privateSelectorINumber)
          Resolves user private Selector I-Number to user Identifier
 CardInformation setCardCredential(CallbackHandler handler, org.eclipse.higgins.icard.CUID cuid, CardCredential cardCredential)
          Sets credential information for the given card.
 void setID(String id)
           
 void setNewPassword(CallbackHandler handler, String newPassword)
          Sets the new password allowing authentication both by new and old passwords until the successful deleteOldPassword() call.
 void setNewPasswordByPasswordIsapMd5(String userId, byte[] passwordIsapMd5, String newPassword)
          Sets the new password allowing authentication both by new and old passwords until the successful deleteOldPassword() call.
 void setRPPolicyVersion(CallbackHandler handler, PolicyVersion policyVersion)
           
 boolean userIdentifierExists(String userIdentifier)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryUserProfileService

public MemoryUserProfileService()
Method Detail

addCategory

public Category addCategory(CallbackHandler handler,
                            Category category)
                     throws UserProfileException
Specified by:
addCategory in interface IUserProfileService
Parameters:
handler - - authentication handler
category -
Returns:
new created category instance.
Throws:
UserProfileException

addUserProfile

public UserProfile addUserProfile(CallbackHandler handler,
                                  UserProfile userProfile)
                           throws UserProfileException
Specified by:
addUserProfile in interface IUserProfileService
Parameters:
userProfile -
Returns:
Throws:
UserProfileException

clearCardCredential

public CardInformation clearCardCredential(CallbackHandler handler,
                                           org.eclipse.higgins.icard.CUID cuid)
                                    throws UserProfileException
Description copied from interface: IUserProfileService
Clears credential information for the given card.

Specified by:
clearCardCredential in interface IUserProfileService
Parameters:
handler -
Returns:
CardInformation object with all related card information, or null if card info not found
Throws:
UserProfileException

deleteCategory

public void deleteCategory(CallbackHandler handler,
                           String categoryId)
                    throws UserProfileException
Specified by:
deleteCategory in interface IUserProfileService
Parameters:
categoryId -
Returns:
.
Throws:
UserProfileException

deleteUserProfile

public void deleteUserProfile(CallbackHandler handler)
                       throws UserProfileException
Specified by:
deleteUserProfile in interface IUserProfileService
Returns:
Throws:
UserProfileException

getCardInformation

public CardInformation getCardInformation(CallbackHandler handler,
                                          org.eclipse.higgins.icard.CUID cuid)
                                   throws UserProfileException
Description copied from interface: IUserProfileService
Returns the whole information about the given card

Specified by:
getCardInformation in interface IUserProfileService
Parameters:
handler -
cuid -
Returns:
Throws:
UserProfileException

getCategories

public List getCategories(CallbackHandler handler)
                   throws UserProfileException
Specified by:
getCategories in interface IUserProfileService
Parameters:
handler - - authentication handler
Returns:
List object with all user categories.
Throws:
UserProfileException

getUserProfile

public UserProfile getUserProfile(CallbackHandler handler)
                           throws UserProfileException
Specified by:
getUserProfile in interface IUserProfileService
Returns:
Throws:
UserProfileException

modifyCategory

public Category modifyCategory(CallbackHandler handler,
                               Category category)
                        throws UserProfileException
Specified by:
modifyCategory in interface IUserProfileService
Parameters:
handler - - authentication handler
category -
Returns:
updated category instance .
Throws:
UserProfileException

modifyUserProfile

public UserProfile modifyUserProfile(CallbackHandler handler,
                                     UserProfile userProfile)
                              throws UserProfileException
Specified by:
modifyUserProfile in interface IUserProfileService
Parameters:
userProfile -
Returns:
Throws:
UserProfileException

resetPassword

public String resetPassword(CallbackHandler handler)
                     throws UserProfileException
Specified by:
resetPassword in interface IUserProfileService
Returns:
Throws:
UserProfileException

setCardCredential

public CardInformation setCardCredential(CallbackHandler handler,
                                         org.eclipse.higgins.icard.CUID cuid,
                                         CardCredential cardCredential)
                                  throws UserProfileException
Description copied from interface: IUserProfileService
Sets credential information for the given card.

Specified by:
setCardCredential in interface IUserProfileService
Parameters:
handler -
cuid -
cardCredential -
Returns:
CardInformation object with all related card information, or null if card info not found
Throws:
UserProfileException

userIdentifierExists

public boolean userIdentifierExists(String userIdentifier)
                             throws UserProfileException
Specified by:
userIdentifierExists in interface IUserProfileService
Parameters:
userIdentifier -
Returns:
true if the specified user profile already exists
Throws:
UserProfileException

getConfiguration

public org.eclipse.higgins.registry.IConfiguration getConfiguration()
Specified by:
getConfiguration in interface org.eclipse.higgins.registry.IServiceProvider

getID

public String getID()
Specified by:
getID in interface org.eclipse.higgins.registry.IServiceProvider

setID

public void setID(String id)
           throws Exception
Specified by:
setID in interface org.eclipse.higgins.registry.IServiceProvider
Throws:
Exception

getCardUsageManager

public ICardUsageManager getCardUsageManager(CallbackHandler handler)
                                      throws UserProfileException
Description copied from interface: IUserProfileService
Returns class that manages all Card usage and URI relations information

Specified by:
getCardUsageManager in interface IUserProfileService
Parameters:
handler -
Returns:
instance of ICardUsageRelationManager
Throws:
UserProfileException

resolveUserIdentifier

public String resolveUserIdentifier(String privateSelectorINumber)
                             throws UserProfileException
Description copied from interface: IUserProfileService
Resolves user private Selector I-Number to user Identifier

Specified by:
resolveUserIdentifier in interface IUserProfileService
Parameters:
privateSelectorINumber -
Returns:
Throws:
UserProfileException

getRPPolicyVersion

public PolicyVersion getRPPolicyVersion(CallbackHandler handler,
                                        URI url)
                                 throws UserProfileException
Throws:
UserProfileException

setRPPolicyVersion

public void setRPPolicyVersion(CallbackHandler handler,
                               PolicyVersion policyVersion)
                        throws UserProfileException
Specified by:
setRPPolicyVersion in interface IUserProfileService
Throws:
UserProfileException

deleteOldPassword

public void deleteOldPassword(CallbackHandler handler)
                       throws UserProfileException
Description copied from interface: IUserProfileService
Deletes the old password and change it to the new one. After this successful call change password process assumed completed and all subsequent authentication will conduct on the changed (new) password. This implements change password logic according to ISAP sequences CP1 and CP2.

Specified by:
deleteOldPassword in interface IUserProfileService
Parameters:
handler - - Callback handler containing current and valid "old password" or the new one.
Throws:
UserProfileException

setNewPassword

public void setNewPassword(CallbackHandler handler,
                           String newPassword)
                    throws UserProfileException
Description copied from interface: IUserProfileService
Sets the new password allowing authentication both by new and old passwords until the successful deleteOldPassword() call. This implements change password logic according to ISAP sequences CP1 and CP2.

Specified by:
setNewPassword in interface IUserProfileService
Parameters:
handler - - Callback handler containing current and valid "old password" or the new one.
newPassword - - password, on which the authentication will try. If not succeeded, will conduct on the old one.
Throws:
UserProfileException

setNewPasswordByPasswordIsapMd5

public void setNewPasswordByPasswordIsapMd5(String userId,
                                            byte[] passwordIsapMd5,
                                            String newPassword)
                                     throws UserProfileException
Description copied from interface: IUserProfileService
Sets the new password allowing authentication both by new and old passwords until the successful deleteOldPassword() call. This implements change password logic according to ISAP sequences CP1 and CP2. The Private Broker MUST authenticate this message came from an authorized Selector by verifying that the $password$isap$md5 value matches the hash of the same value registered with the Private Broker in ISAP Sequence P1. This value is the Installation Key MD5 defined in the Credentials section of ISAP Common. Note that the Private Broker should store a HASH of this value, even though the value is already a hash of the Installation Key

Specified by:
setNewPasswordByPasswordIsapMd5 in interface IUserProfileService
Parameters:
passwordIsapMd5 - - hash of Installation Key MD5 by which authentication occurs here
newPassword - - password, on which the authentication will try. If not succeeded, will conduct on the old one.
Throws:
UserProfileException

addSelectorAndSetPasswordByPasswordIsapMd5

public void addSelectorAndSetPasswordByPasswordIsapMd5(String userId,
                                                       String privateSelectorINumber,
                                                       byte[] passwordIsapMd5,
                                                       String newPassword)
                                                throws UserProfileException
Description copied from interface: IUserProfileService
Add the new Selector given by the privateSelectorINumber and set the new password without remembering it. Note that all subsuquent operations will be authenticated by this new password. The Private Broker MUST authenticate this message came from an authorized Selector by verifying that the Installation Key MD5 matches the Installation Key MD5 registered with the Private Broker in ISAP Sequence P1.
The Private Broker MUST:
1. Register the new Selector as defined in ISAP Sequence P2.
2. Change the Private User Password and defined in ISAP Sequence CP2 except that in this sequence the old Private User Password is NOT saved because a new Selector is being installed.

Specified by:
addSelectorAndSetPasswordByPasswordIsapMd5 in interface IUserProfileService
Parameters:
userId - - private-user-i-number at the Private Broker
privateSelectorINumber -
passwordIsapMd5 -
newPassword -
Throws:
UserProfileException

getRPPolicyVersion

public PolicyVersion getRPPolicyVersion(CallbackHandler handler,
                                        WebForm form)
                                 throws UserProfileException
Specified by:
getRPPolicyVersion in interface IUserProfileService
Throws:
UserProfileException