Cumulus4j API
(1.1.0)

org.cumulus4j.keymanager.front.webapp
Class UserService

java.lang.Object
  extended by org.cumulus4j.keymanager.front.webapp.AbstractService
      extended by org.cumulus4j.keymanager.front.webapp.UserService

public class UserService
extends AbstractService

REST service for user management.

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Field Summary
 
Fields inherited from class org.cumulus4j.keymanager.front.webapp.AbstractService
keyStoreManager, request
 
Constructor Summary
UserService()
          Create a new instance.
 
Method Summary
 void deleteUser(String keyStoreID, String userName)
          Delete a user.
 User getUser(String keyStoreID, String userName)
          Get a KeyStore's user identified by the given keyStoreID and userName.
 UserList getUsers(String keyStoreID)
          Get all users of the KeyStore identified by keyStoreID.
 void postUser(String keyStoreID, UserWithPassword userWithPassword)
          Compatibility for clients not supporting PUT.
 void putUser(String keyStoreID, UserWithPassword userWithPassword)
          Put a user.
 
Methods inherited from class org.cumulus4j.keymanager.front.webapp.AbstractService
authenticate, getAuth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserService

public UserService()
Create a new instance.

Method Detail

getUser

public User getUser(String keyStoreID,
                    String userName)
Get a KeyStore's user identified by the given keyStoreID and userName.

Parameters:
keyStoreID - identifier of the KeyStore to work with.
userName - the user's name.
Returns:
the desired user or null, if there is no user with the given name in the specified KeyStore.

getUsers

public UserList getUsers(String keyStoreID)
Get all users of the KeyStore identified by keyStoreID.

Parameters:
keyStoreID - identifier of the KeyStore to work with.
Returns:
all users of the KeyStore identified by keyStoreID.

postUser

public void postUser(String keyStoreID,
                     UserWithPassword userWithPassword)
Compatibility for clients not supporting PUT. This method does the same as (it delegates to) putUser(String, UserWithPassword). Ajax-Clients (e.g. jQuery in Firefox) seem not to support PUT.


putUser

public void putUser(String keyStoreID,
                    UserWithPassword userWithPassword)
Put a user. If a user with the same name already exists, it is updated, otherwise the new user is added to the KeyStore identified by keyStoreID.

Parameters:
keyStoreID - identifier of the KeyStore to work with.
userWithPassword - the user's information to be stored.

deleteUser

public void deleteUser(String keyStoreID,
                       String userName)
Delete a user.

Parameters:
keyStoreID - identifier of the KeyStore to work with.
userName - the name of the user to be deleted.

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.