org.systinet.wasp.admin.security
Interface PStoreService

All Superinterfaces:
KeyStore

public interface PStoreService
extends KeyStore

This interface represents component which provides management features for database of identities (UserStore) and certificate store (KeyStore).

Using PStoreService it is possible to manage users, users properties such as password or certificate, key entries and trusted certificates in KeyStore.

Since:
4.5
Component:
Security-Services

Method Summary
 void addUser(java.lang.String userId)
          Adds use.
 void deleteUser(java.lang.String userId)
          Deletes user (removes also permissions)
 java.util.HashSet getSupportedAttributes()
          Returns supported property names
 java.lang.String[] getUserIds()
          Returns string array containing all user ids from this user store.
 UserProperty[] getUserProperties(java.lang.String userId, java.util.HashSet supported)
          Returns user properties
 byte[] getUserProperty(java.lang.String userId, java.lang.String key, java.util.HashSet supported)
          Return user property
 java.util.HashSet getUsers(java.util.HashSet supported)
          Return users.
 java.util.HashSet getUsers(UserProperty[] filter)
          Returns iterator containing users which correspond to a given filter.
 boolean hasUser(java.lang.String userId, UserProperty[] 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 property
 java.util.HashSet setUserProperties(java.lang.String userId, UserProperty[] properties)
          Set user properties
 boolean setUserProperty(java.lang.String userId, java.lang.String key, byte[] value)
          Sets user property
 
Methods inherited from interface org.idoox.security.pstore.KeyStore
containsAlias, deleteEntry, getAlias, getAliasEntries, getAliases, getCertificateChain, getKey, getKeyEntry, isKeyEntry, setCertificateEntry, setKeyEntry, setKeyEntry, setKeyStoreSoure
 

Method Detail

getUsers

public java.util.HashSet getUsers(java.util.HashSet supported)
Return users.

Parameters:
supported - set of supported property types
Returns:
set RawUserEntries

getUsers

public java.util.HashSet getUsers(UserProperty[] 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 - property objects array
Returns:
set RawUserEntries

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

deleteUser

public void deleteUser(java.lang.String userId)
                throws UserStoreException
Deletes user (removes also permissions)

Parameters:
userId - - user ID
Throws:
UserStoreException

addUser

public void addUser(java.lang.String userId)
             throws UserStoreException
Adds use. (The behavior is the same as when You call

Parameters:
userId - - user ID
Throws:
UserStoreException
See Also:
with no properties)

getUserProperties

public UserProperty[] getUserProperties(java.lang.String userId,
                                        java.util.HashSet supported)
                                 throws UserStoreException
Returns user properties

Parameters:
userId - - user ID
supported - set of names of supported property types which are supported by caller
Returns:
an array of user properties
Throws:
UserStoreException

getUserProperty

public byte[] getUserProperty(java.lang.String userId,
                              java.lang.String key,
                              java.util.HashSet supported)
                       throws UserStoreException
Return user property

Parameters:
userId - - user ID
key - - property name
supported - set of names of supported property types which are supported
Returns:
user property value as an array of bytes
Throws:
UserStoreException

setUserProperties

public java.util.HashSet setUserProperties(java.lang.String userId,
                                           UserProperty[] properties)
                                    throws UserStoreException
Set user properties

Parameters:
userId - - user ID
properties - - an array of user properties
Returns:
set of names of property types which called server does not support
Throws:
UserStoreException

setUserProperty

public boolean setUserProperty(java.lang.String userId,
                               java.lang.String key,
                               byte[] value)
                        throws UserStoreException
Sets user property

Parameters:
userId - - user ID
key - - property name
value - - property value as an array of bytes
Returns:
false if server does not support requested property type
Throws:
UserStoreException

removeUserProperty

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

Parameters:
userId - - user ID
key - - property name
Throws:
UserStoreException

getSupportedAttributes

public java.util.HashSet getSupportedAttributes()
Returns supported property names

Returns:
set of names of supported property types

hasUser

public boolean hasUser(java.lang.String userId,
                       UserProperty[] 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 - array of Property objects
Returns:
Value