org.systinet.wasp.admin.security
Class UserStoreProxy

java.lang.Object
  extended byorg.idoox.security.pstore.AbstractUserStore
      extended byorg.systinet.wasp.admin.security.UserStoreProxy
All Implemented Interfaces:
UserStore

public class UserStoreProxy
extends AbstractUserStore

This class acts as a UserStore instance over PStoreService interface. This proxy almost implements UserStore interface.

Since:
4.5
Component:
Security-Services

Nested Class Summary
protected  class UserStoreProxy.UserIteratorImpl
           
 
Field Summary
 
Fields inherited from class org.idoox.security.pstore.AbstractUserStore
listeners
 
Fields inherited from interface org.idoox.security.pstore.UserStore
DELETE_USER_ACTION, FILTER_STRING, IMAGE_PROPERTY, PASSWORD_PROPERTY, X509CERTIFICATE_PROPERTY, X509CERTIFICATECHAIN_PROPERTY
 
Constructor Summary
UserStoreProxy(PStoreService service)
          Consturects proxy above secure service.
 
Method Summary
 void deleteUser(java.lang.String userId)
          Removes user with given name from the user store.
 PropertySerializer getPropertySerializer(java.lang.String propertyKey)
          Returns the PropertySerializer associated with the given key.
WARNING: This function is not remote - it gets PropertySerializer locally!
protected  java.util.HashSet getSupported()
          Returns set of supported property types
 java.util.Iterator getSupportedAttributes()
          Gets supported attributes for the user on both side (caller side and called server side).
 java.lang.String[] getUserIds()
          Returns string array containing all user ids from this user store.
 java.util.Map getUserProperties(java.lang.String userId)
          Returns map of properties associated with given user.
 java.lang.Object getUserProperty(java.lang.String userId, java.lang.String key)
          Returns value of particular property associated with given user.
 UserIterator getUsers()
          Returns iterator containing all users from this user store.
 UserIterator getUsers(java.util.Map filter)
          Returns iterator containing users which correspond to a given filter.
protected  UserStore getUserStore()
          Returns UserStore instance
 boolean hasUser(java.lang.String userId, java.util.Map filter)
          Determines whether user with given name and properties is present in the user store or not.
 void removeUserProperty(java.lang.String userId, java.lang.String key)
          Removes user associated property with given key.
 void setPropertySerializer(java.lang.String propertyKey, PropertySerializer serializer)
          Registers the propertySerializer associated with the propertyKey.
 void setUserProperties(java.lang.String userId, java.util.Map properties)
          Associated given user with a new map of properties.
 void setUserProperties(java.lang.String userId, UserProperty[] properties)
          Associated given user with a new array of property objects.
 void setUserProperty(java.lang.String userId, java.lang.String key, java.lang.Object value)
          Sets particular property value for given user.
 void setUserStoreSource(UserStoreSource source)
          Set the UserStoreSource associated with this object.
 
Methods inherited from class org.idoox.security.pstore.AbstractUserStore
addNotificationListener, destroy, fireDeleteUserAction, match, removeNotificationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserStoreProxy

public UserStoreProxy(PStoreService service)
Consturects proxy above secure service.

Parameters:
service - SecureService Interface
Method Detail

getUserStore

protected UserStore getUserStore()
Returns UserStore instance

Returns:
UserStore instance

getSupported

protected java.util.HashSet getSupported()
Returns set of supported property types

Returns:
set of supported property types

deleteUser

public void deleteUser(java.lang.String userId)
                throws UserStoreException
Removes user with given name from the user store.

Parameters:
userId - name of the user to be removed
Throws:
UserStoreException - when the user is not found or cannot be removed

getUserProperties

public java.util.Map getUserProperties(java.lang.String userId)
                                throws UserStoreException
Returns map of properties associated with given user.

Parameters:
userId - name of the user
Returns:
associated properties map
Throws:
UserStoreException - when user cannot be found
See Also:
UserStore.PASSWORD_PROPERTY, UserStore.X509CERTIFICATE_PROPERTY, UserStore.X509CERTIFICATECHAIN_PROPERTY

getUserProperty

public java.lang.Object getUserProperty(java.lang.String userId,
                                        java.lang.String key)
                                 throws UserStoreException
Returns value of particular property associated with given user.

Parameters:
userId - name of the user
key - key of the property to be returned
Returns:
value of the requested property or null when this property has not been set for given user
Throws:
UserStoreException - when user cannot be found
See Also:
UserStore.PASSWORD_PROPERTY, UserStore.X509CERTIFICATE_PROPERTY, UserStore.X509CERTIFICATECHAIN_PROPERTY

removeUserProperty

public void removeUserProperty(java.lang.String userId,
                               java.lang.String key)
                        throws UserStoreException
Removes user associated property with given key.

Parameters:
userId - name of the user
key - key of the property to be removed
Throws:
UserStoreException - when user cannot be found
See Also:
UserStore.PASSWORD_PROPERTY, UserStore.X509CERTIFICATE_PROPERTY, UserStore.X509CERTIFICATECHAIN_PROPERTY

setUserProperties

public void setUserProperties(java.lang.String userId,
                              java.util.Map properties)
                       throws UserStoreException
Associated given user with a new map of properties. If the user does not already exists this method creates it.

Parameters:
userId - name of the user
properties - map of properties to be associated with user
Throws:
UserStoreException - the properties cannot be set ( cannot save to the db)
See Also:
UserStore.PASSWORD_PROPERTY, UserStore.X509CERTIFICATE_PROPERTY, UserStore.X509CERTIFICATECHAIN_PROPERTY

setUserProperties

public void setUserProperties(java.lang.String userId,
                              UserProperty[] properties)
                       throws UserStoreException
Associated given user with a new array of property objects. If the user does not already exists this method creates it.

Parameters:
userId - name of the user
properties - array of property objects to be associated with user
Throws:
UserStoreException - the properties cannot be set ( cannot save to the db)

setUserProperty

public void setUserProperty(java.lang.String userId,
                            java.lang.String key,
                            java.lang.Object value)
                     throws UserStoreException
Sets particular property value for given user. If the user does not already exists this method creates it.

Parameters:
userId - name of the user
key - key of the property which value is to be set
value - value of the property to be set
Throws:
UserStoreException - if user cannot be found or the property value cannot be set
See Also:
UserStore.PASSWORD_PROPERTY, UserStore.X509CERTIFICATE_PROPERTY, UserStore.X509CERTIFICATECHAIN_PROPERTY

getUsers

public UserIterator getUsers()
Returns iterator containing all users from this user store.

Returns:
user iterator containing all users from the user store

getUserIds

public java.lang.String[] getUserIds()
Returns string array containing all user ids from this user store.

Returns:
array containing all user ids from the user store

getSupportedAttributes

public java.util.Iterator getSupportedAttributes()
Gets supported attributes for the user on both side (caller side and called server side). The returned set is intersection of attributes supported by caller's server and attributes supported by called server.

Returns:
string values

getPropertySerializer

public PropertySerializer getPropertySerializer(java.lang.String propertyKey)
                                         throws UserStoreException
Returns the PropertySerializer associated with the given key.
WARNING: This function is not remote - it gets PropertySerializer locally!

Parameters:
propertyKey - the key to retrieve propertySerializer
Returns:
the associated PropertySerializer or null if isn't exist
Throws:
UserStoreException - thrown when propertySerializer doesn't exist.

setPropertySerializer

public void setPropertySerializer(java.lang.String propertyKey,
                                  PropertySerializer serializer)
                           throws UserStoreException
Registers the propertySerializer associated with the propertyKey. WARNING: This function is not remote -it sets PropertySerializer locally!

Parameters:
propertyKey - a key associated with the serializer
serializer - a serializer associated with the key
Throws:
UserStoreException - Exception

hasUser

public boolean hasUser(java.lang.String userId,
                       java.util.Map filter)
Determines whether user with given name and properties is present in the user store or not.

The property can be either requested to be present, in which case the map should contain only the property key and the associated value must be set to null or it can be requested that particular property must have certain value, in which case both key and value in the properties map must be set to non-null values.

Parameters:
userId - name of the user
filter - set of properties the user must possess
Returns:
Value
See Also:
UserStore.PASSWORD_PROPERTY, UserStore.X509CERTIFICATE_PROPERTY, UserStore.X509CERTIFICATECHAIN_PROPERTY

getUsers

public UserIterator getUsers(java.util.Map filter)
Returns iterator containing users which correspond to a given filter.

The property can be either requested to be present, in which case the map should contain only the property key and the associated value must be set to null or it can be requested that particular property must have certain value, in which case both key and value in the properties map must be set to non-null values.

Parameters:
filter - the filter for users to be returned
Returns:
iterator containing users corresponding with given filter.
See Also:
UserStore.PASSWORD_PROPERTY, UserStore.X509CERTIFICATE_PROPERTY, UserStore.X509CERTIFICATECHAIN_PROPERTY

setUserStoreSource

public void setUserStoreSource(UserStoreSource source)
Set the UserStoreSource associated with this object. Every modification is saved by the UserStoreSource.

Parameters:
source - the UserStoreSource associated with this object.