org.eclipse.stardust.engine.api.runtime
Interface UserService

All Superinterfaces:
org.eclipse.stardust.engine.api.runtime.Service

public interface UserService
extends org.eclipse.stardust.engine.api.runtime.Service

The UserService provides functionality for operating on CARNOT users.

This includes:

Version:
$Revision$
Author:
ubirkemeyer

Field Summary
static java.lang.String ARCHIVE
          Constant used as sessionId on sessions opened on archive audit trails.
static java.lang.String DISABLED_FOR_USER
          Constant used as sessionId on sessions opened with user disabled for tracking.
 
Method Summary
 void closeSession(java.lang.String sessionId)
          Tracks the ending of a user session.
 User createUser(java.lang.String account, java.lang.String firstName, java.lang.String lastName, java.lang.String description, java.lang.String password, java.lang.String eMail, java.util.Date validFrom, java.util.Date validTo)
          Creates a new user with default realm ID.
 User createUser(java.lang.String realm, java.lang.String account, java.lang.String firstName, java.lang.String lastName, java.lang.String description, java.lang.String password, java.lang.String eMail, java.util.Date validFrom, java.util.Date validTo)
          Creates a new user.
 UserGroup createUserGroup(java.lang.String id, java.lang.String name, java.lang.String description, java.util.Date validFrom, java.util.Date validTo)
          Creates a new user group.
 UserRealm createUserRealm(java.lang.String id, java.lang.String name, java.lang.String description)
          Creates a new user realm.
 void dropUserRealm(java.lang.String id)
          Drops the user realm associated with the given ID.
 User getUser()
          Retrieves information on the current user.
 User getUser(long userOID)
          Retrieves the specified user.
 User getUser(java.lang.String account)
          Retrieves the user associated with the given account.
 User getUser(java.lang.String realm, java.lang.String account)
          Retrieves the user associated with the given account.
 UserGroup getUserGroup(long oid)
          Retrieves the specified user group.
 UserGroup getUserGroup(java.lang.String id)
          Retrieves the user group associated with the given ID.
 java.util.List getUserRealms()
          Retrives all existing user realms.
 User invalidate(java.lang.String account)
          Deprecated. Please use invalidateUser(String) instead.
 User invalidateUser(java.lang.String account)
          Invalidates the user with the specified account.
 User invalidateUser(java.lang.String realm, java.lang.String account)
          Invalidates the user with the specified account.
 UserGroup invalidateUserGroup(long oid)
          Invalidates the specified user group.
 UserGroup invalidateUserGroup(java.lang.String id)
          Invalidates the user group associated with the given ID.
 boolean isInternalAuthentication()
          Checks if internal authentication is used.
 boolean isInternalAuthentified()
          Deprecated. Superseded by isInternalAuthentication().
 boolean isInternalAuthorization()
          Checks if internal authorization is used.
 User modifyLoginUser(java.lang.String oldPassword, java.lang.String firstName, java.lang.String lastName, java.lang.String newPassword, java.lang.String eMail)
          Modifies the current user.
 User modifyUser(User user)
          Modifies the specified user.
 User modifyUser(User user, boolean generatePassword)
          Modifies the specified user.
 UserGroup modifyUserGroup(UserGroup userGroup)
          Modifies the specified user group.
 void resetPassword(java.lang.String account, java.util.Map properties)
          Resets the password of specified user by generated password according to configured password rules.
 java.lang.String startSession(java.lang.String clientId)
          Tracks the starting of a new user session.
 

Field Detail

ARCHIVE

static final java.lang.String ARCHIVE
Constant used as sessionId on sessions opened on archive audit trails.

See Also:
Constant Field Values

DISABLED_FOR_USER

static final java.lang.String DISABLED_FOR_USER
Constant used as sessionId on sessions opened with user disabled for tracking.

See Also:
Constant Field Values
Method Detail

startSession

java.lang.String startSession(java.lang.String clientId)
Tracks the starting of a new user session.

Parameters:
clientId - the client starting the session.
Returns:
the new session id.

closeSession

void closeSession(java.lang.String sessionId)
Tracks the ending of a user session.

Parameters:
sessionId - the id of the ending session.

isInternalAuthentified

boolean isInternalAuthentified()
Deprecated. Superseded by isInternalAuthentication().

Checks if internal authentication is used.

Returns:
true if CARNOT services use internal authentication.

isInternalAuthentication

boolean isInternalAuthentication()
Checks if internal authentication is used.

Returns:
true if CARNOT services use internal authentication.

isInternalAuthorization

boolean isInternalAuthorization()
Checks if internal authorization is used.

Returns:
true if Carnot services use internal authorization.

getUser

User getUser()
Retrieves information on the current user.

Returns:
the current user.

modifyLoginUser

User modifyLoginUser(java.lang.String oldPassword,
                     java.lang.String firstName,
                     java.lang.String lastName,
                     java.lang.String newPassword,
                     java.lang.String eMail)
                     throws org.eclipse.stardust.common.error.ConcurrencyException,
                            IllegalOperationException,
                            org.eclipse.stardust.common.security.InvalidPasswordException
Modifies the current user.

Parameters:
oldPassword - the current password.
firstName - first name of the user.
lastName - last name of the user.
newPassword - the new password.
eMail - email address of the user.
Returns:
the modified user.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the current user.
IllegalOperationException - if the authentication is not internal.
org.eclipse.stardust.common.security.InvalidPasswordException - if the new password does not match the given rules.

modifyUser

@ExecutionPermission(id=modifyUserData)
User modifyUser(User user)
                throws org.eclipse.stardust.common.error.ConcurrencyException,
                       org.eclipse.stardust.common.error.ObjectNotFoundException,
                       IllegalOperationException,
                       org.eclipse.stardust.common.security.InvalidPasswordException,
                       org.eclipse.stardust.common.error.AccessForbiddenException
Modifies the specified user.

Parameters:
user - the user to be modified.
Returns:
the modified user.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the specified one.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the user or a given grant is not found.
IllegalOperationException - if the authentication is not internal.
org.eclipse.stardust.common.security.InvalidPasswordException - if the new password does not match the given rules.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not allowed for operation.

resetPassword

@ExecutionPermission(id=resetUserPassword,
                     defaults=ALL)
void resetPassword(java.lang.String account,
                                                                     java.util.Map properties)
                   throws org.eclipse.stardust.common.error.ConcurrencyException,
                          org.eclipse.stardust.common.error.ObjectNotFoundException,
                          IllegalOperationException
Resets the password of specified user by generated password according to configured password rules.

Parameters:
account - the user account to be modified.
properties - Map providing further login properties.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the specified one.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the user or a given grant is not found.
IllegalOperationException - if the authentication is not internal.

modifyUser

@ExecutionPermission(id=modifyUserData)
User modifyUser(User user,
                                                    boolean generatePassword)
                throws org.eclipse.stardust.common.error.ConcurrencyException,
                       org.eclipse.stardust.common.error.ObjectNotFoundException,
                       IllegalOperationException,
                       org.eclipse.stardust.common.security.InvalidPasswordException,
                       org.eclipse.stardust.common.error.AccessForbiddenException
Modifies the specified user.

Parameters:
user - the user to be modified.
generatePassword - if set to true a password will be generated and send by mail to the user.
Returns:
the modified user.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the specified one.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the user or a given grant is not found.
IllegalOperationException - if the authentication is not internal.
org.eclipse.stardust.common.security.InvalidPasswordException - if the new password does not match the given rules.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not allowed for operation.

createUser

@ExecutionPermission(id=modifyUserData)
User createUser(java.lang.String account,
                                                    java.lang.String firstName,
                                                    java.lang.String lastName,
                                                    java.lang.String description,
                                                    java.lang.String password,
                                                    java.lang.String eMail,
                                                    java.util.Date validFrom,
                                                    java.util.Date validTo)
                throws UserExistsException,
                       IllegalOperationException,
                       org.eclipse.stardust.common.security.InvalidPasswordException
Creates a new user with default realm ID.

Parameters:
account - the account name.
firstName - first name of the user.
lastName - last name of the user.
description - short description.
password - the user password.
eMail - email address of the user.
validFrom - validity start time or null if unlimited.
validTo - validity end time or null if unlimited.
Returns:
the newly created user.
Throws:
UserExistsException - if another user with the specified account already exists.
IllegalOperationException - if the authentication is not internal.
org.eclipse.stardust.common.security.InvalidPasswordException

createUser

@ExecutionPermission(id=modifyUserData)
User createUser(java.lang.String realm,
                                                    java.lang.String account,
                                                    java.lang.String firstName,
                                                    java.lang.String lastName,
                                                    java.lang.String description,
                                                    java.lang.String password,
                                                    java.lang.String eMail,
                                                    java.util.Date validFrom,
                                                    java.util.Date validTo)
                throws UserExistsException,
                       IllegalOperationException,
                       org.eclipse.stardust.common.security.InvalidPasswordException
Creates a new user.

Parameters:
realm - the user's realm ID.
account - the account name.
firstName - first name of the user.
lastName - last name of the user.
description - short description.
password - the user password.
eMail - email address of the user.
validFrom - validity start time or null if unlimited.
validTo - validity end time or null if unlimited.
Returns:
the newly created user.
Throws:
UserExistsException - if another user with the specified account already exists.
IllegalOperationException - if the authentication is not internal.
org.eclipse.stardust.common.security.InvalidPasswordException

getUser

@ExecutionPermission(id=readUserData,
                     defaults=ALL)
User getUser(java.lang.String account)
             throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                    IllegalOperationException
Retrieves the user associated with the given account.

Parameters:
account - the account name of the user to retrieve.
Returns:
the user.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no user with the specified account.
IllegalOperationException

getUser

@ExecutionPermission(id=readUserData,
                     defaults=ALL)
User getUser(java.lang.String realm,
                                                          java.lang.String account)
             throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves the user associated with the given account.

Parameters:
realm - the realm ID of the user to retrieve.
account - the account name of the user to retrieve.
Returns:
the user.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no user with the specified account.

getUser

@ExecutionPermission(id=readUserData,
                     defaults=ALL)
User getUser(long userOID)
             throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves the specified user.

Parameters:
userOID - the OID of the user to retrieve.
Returns:
the user.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no user with the specified oid.

invalidate

@ExecutionPermission(id=modifyUserData)
User invalidate(java.lang.String account)
                throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                       IllegalOperationException
Deprecated. Please use invalidateUser(String) instead.

Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException
IllegalOperationException

invalidateUser

@ExecutionPermission(id=modifyUserData)
User invalidateUser(java.lang.String account)
                    throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                           IllegalOperationException
Invalidates the user with the specified account.

Parameters:
account - the account name of the user to invalidate.
Returns:
the invalidated user.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no user with the specified account.
IllegalOperationException - if the authentication is not internal.

invalidateUser

@ExecutionPermission(id=modifyUserData)
User invalidateUser(java.lang.String realm,
                                                        java.lang.String account)
                    throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                           IllegalOperationException
Invalidates the user with the specified account.

Parameters:
realm - the realm ID of the user to invalidate.
account - the account name of the user to invalidate.
Returns:
the invalidated user.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no user with the specified account.
IllegalOperationException - if the authentication is not internal.

createUserGroup

@ExecutionPermission(id=modifyUserData)
UserGroup createUserGroup(java.lang.String id,
                                                              java.lang.String name,
                                                              java.lang.String description,
                                                              java.util.Date validFrom,
                                                              java.util.Date validTo)
                          throws UserGroupExistsException,
                                 IllegalOperationException,
                                 org.eclipse.stardust.common.security.InvalidPasswordException,
                                 org.eclipse.stardust.common.error.InvalidArgumentException
Creates a new user group.

Parameters:
id - the user group ID. Must not be null or empty and must be unique.
name - the user group name. Must not be null or empty.
description - short description. Must not be null.
validFrom - validity start time or null if unlimited.
validTo - validity end time or null if unlimited.
Returns:
the newly created user group.
Throws:
UserGroupExistsException - if another user group with the specified ID already exists.
org.eclipse.stardust.common.error.InvalidArgumentException - if ID is empty if name is empty if description is empty
IllegalOperationException - if operation is not allowed in this context.
org.eclipse.stardust.common.security.InvalidPasswordException

getUserGroup

@ExecutionPermission(id=readUserData,
                     defaults=ALL)
UserGroup getUserGroup(java.lang.String id)
                       throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves the user group associated with the given ID.

Parameters:
id - the id of the user group to retrieve.
Returns:
the user group.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no user group with the specified ID.

getUserGroup

@ExecutionPermission(id=readUserData,
                     defaults=ALL)
UserGroup getUserGroup(long oid)
                       throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves the specified user group.

Parameters:
oid - the OID of the user group to retrieve.
Returns:
the user group.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no user group with the specified OID.

modifyUserGroup

@ExecutionPermission(id=modifyUserData)
UserGroup modifyUserGroup(UserGroup userGroup)
                          throws org.eclipse.stardust.common.error.ConcurrencyException,
                                 org.eclipse.stardust.common.error.ObjectNotFoundException,
                                 IllegalOperationException
Modifies the specified user group.

Parameters:
userGroup - the user group to be modified.
Returns:
the modified user group.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the specified user group.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the user group is not found.
IllegalOperationException - if operation is not allowed in this context.

invalidateUserGroup

@ExecutionPermission(id=modifyUserData)
UserGroup invalidateUserGroup(java.lang.String id)
                              throws org.eclipse.stardust.common.error.ConcurrencyException,
                                     org.eclipse.stardust.common.error.ObjectNotFoundException,
                                     IllegalOperationException
Invalidates the user group associated with the given ID.

Parameters:
id - the ID of the user group to be invalidated.
Returns:
the invalidated user group.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the specified user group.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the user group is not found.
IllegalOperationException - if operation is not allowed in this context.

invalidateUserGroup

@ExecutionPermission(id=modifyUserData)
UserGroup invalidateUserGroup(long oid)
                              throws org.eclipse.stardust.common.error.ConcurrencyException,
                                     org.eclipse.stardust.common.error.ObjectNotFoundException,
                                     IllegalOperationException
Invalidates the specified user group.

Parameters:
oid - the OID of the user group to invalidate.
Returns:
the invalidated user group.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the specified user group.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the user group is not found.
IllegalOperationException - if operation is not allowed in this context.

createUserRealm

@ExecutionPermission(id=modifyUserData)
UserRealm createUserRealm(java.lang.String id,
                                                              java.lang.String name,
                                                              java.lang.String description)
                          throws org.eclipse.stardust.engine.api.runtime.UserRealmExistsException,
                                 IllegalOperationException
Creates a new user realm.

Parameters:
id - the user realm ID.
name - the user realm name.
description - short description.
Returns:
the newly created user realm.
Throws:
UserRealmExistsException - if another user realm with the specified ID already exists.
IllegalOperationException - if operation is not allowed in this context.

dropUserRealm

@ExecutionPermission(id=modifyUserData)
void dropUserRealm(java.lang.String id)
                   throws org.eclipse.stardust.common.error.ConcurrencyException,
                          org.eclipse.stardust.common.error.ObjectNotFoundException,
                          IllegalOperationException
Drops the user realm associated with the given ID.

Parameters:
id - the ID of the user realm to be dropped.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the specified user realm.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the user realm is not found.
IllegalOperationException - if at least one user is assigned to the user realm.

getUserRealms

@ExecutionPermission(id=readUserData,
                     defaults=ALL)
java.util.List getUserRealms()
                             throws org.eclipse.stardust.common.error.ConcurrencyException,
                                    IllegalOperationException
Retrives all existing user realms.

Returns:
list of all existing user realms.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if another user operates on the user realms.
IllegalOperationException - if operation is not allowed in this context.


Copyright © 2013 SunGard CSA LLC. All Rights Reserved.