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

All Superinterfaces:
DynamicParticipant, DynamicParticipantInfo, ModelElement, Participant, ParticipantInfo, Serializable, UserInfo

public interface User
extends DynamicParticipant, UserInfo

The User represents a snapshot of the user state.

It contains general user information, as well as information regarding the permissions (Grant) the user currently have.

The User instance can be modified and used to update the user's information.

Version:
$Revision$
Author:
ubirkemeyer

Method Summary
 void addGrant(ModelParticipantInfo participant)
          Marks that grants for this participant should be added to all model versions.
 void addGrant(String id)
          Deprecated. Please use addGrant(ModelParticipantInfo participant) instead
 String getAccount()
          Retrieves the account (login name) of the user.
 List<Grant> getAllGrants()
          Returns all the grants (permissions) given to the user.
 List<UserGroup> getAllGroups()
          Lists all user groups this user is a member of.
 Map<String,Object> getAllProperties()
          Retrieves all user custom properties.
 String getDescription()
          Retrieves this user description.
 UserDetailsLevel getDetailsLevel()
          Retrieves the level of details for user.
 String getEMail()
          Retrieves the email address of the user.
 String getFirstName()
          Retrieves the first name of the user.
 String getLastName()
          Retrieves the last name (family name) of the user.
 PermissionState getPermission(String permissionId)
          Returns the permission state of the given permission id for the user.
 Date getPreviousLoginTime()
          Returns the date of the previous login.
 Serializable getProperty(String name)
          Retrieves a custom property value for user.
 Integer getQualityAssuranceProbability()
          Get the probability for this user
 UserRealm getRealm()
          Retrieves the realm of the user.
 String getRealmId()
          Deprecated. Use getRealm().getId();
 long getRealmOID()
          Deprecated. Use getRealm().getOID();
 Date getValidFrom()
          Retrieves the date from which this user is valid.
 Date getValidTo()
          Retrieves the date until this user is valid.
 boolean isAdministrator()
          Returns if user is admin.
 boolean isPasswordExpired()
          Checks if user password expired.
 void joinGroup(String id)
          Marks this user's desire to join the user group identified by the given id.
 void leaveGroup(String id)
          Marks this user's desire to leave the user group identified by the given id.
 void removeAllGrants()
          Removes all user grants.
 void removeGrant(ModelParticipantInfo participant)
          Marks the grants for this participant to be removed from all model versions.
 void removeGrant(String id)
          Deprecated. Please use removeGrant(ModelParticipantInfo participant) instead
 void setAccount(String account)
          Sets the account name of the user.
 void setAllProperties(Map<String,Object> properties)
          Sets all the custom properties of the user.
 void setDescription(String description)
          Sets the description of the user.
 void setEMail(String eMail)
          Sets the email address of the user.
 void setFirstName(String firstName)
          Sets the first name of the user.
 void setLastName(String lastName)
          Sets the last name (family name) of the user.
 void setPassword(String password)
          Sets the password of the user.
 void setProperty(String name, Serializable value)
          Sets a custom property.
 void setQualityAssuranceProbability(Integer probability)
          Set the probability for quality assurance.
 void setValidFrom(Date validFrom)
          Sets the validity start date of the account.
 void setValidTo(Date validTo)
          Sets the validity end date of the account.
 
Methods inherited from interface org.eclipse.stardust.engine.api.model.DynamicParticipant
getPartitionId, getPartitionOID
 
Methods inherited from interface org.eclipse.stardust.engine.api.model.Participant
getAllAttributes, getAllSuperOrganizations, getAttribute, getElementOID, getModelOID, getNamespace
 
Methods inherited from interface org.eclipse.stardust.engine.api.model.ModelElement
getId, getName, getQualifiedId
 
Methods inherited from interface org.eclipse.stardust.engine.api.model.DynamicParticipantInfo
getOID
 
Methods inherited from interface org.eclipse.stardust.engine.api.model.ParticipantInfo
getId, getName, getQualifiedId
 

Method Detail

getQualityAssuranceProbability

Integer getQualityAssuranceProbability()
Get the probability for this user

Returns:
the probability for this user

setQualityAssuranceProbability

void setQualityAssuranceProbability(Integer probability)
                                    throws org.eclipse.stardust.common.error.InvalidValueException
Set the probability for quality assurance. The current is not allowed to change his own probability.

Parameters:
probability - The probability for the user
Throws:
org.eclipse.stardust.common.error.InvalidValueException

isAdministrator

boolean isAdministrator()
Returns if user is admin.

Returns:
true if user is admin.
Throws:
IllegalStateException - if details level is UserDetailsLevel.MINIMAL

isPasswordExpired

boolean isPasswordExpired()
Checks if user password expired.

Returns:
true if expired flag is set.

getPreviousLoginTime

Date getPreviousLoginTime()
Returns the date of the previous login.

Returns:
Date.

getRealmOID

long getRealmOID()
Deprecated. Use getRealm().getOID();

Retrieves the OID of the users realm.

Returns:
a unique identifier of the users realm in the audit trail.

getRealmId

String getRealmId()
Deprecated. Use getRealm().getId();

Retrieves the id of the users realm.

Returns:
the users realm id.

getRealm

UserRealm getRealm()
Retrieves the realm of the user.

Returns:
the user realm.

getAccount

String getAccount()
Retrieves the account (login name) of the user. Same as ModelElement.getId().

Specified by:
getAccount in interface UserInfo
Returns:
the account name.

getFirstName

String getFirstName()
Retrieves the first name of the user.

Specified by:
getFirstName in interface UserInfo
Returns:
the first name.

getLastName

String getLastName()
Retrieves the last name (family name) of the user.

Specified by:
getLastName in interface UserInfo
Returns:
the last name.

getEMail

String getEMail()
Retrieves the email address of the user.

Returns:
the email address.

getValidFrom

Date getValidFrom()
Retrieves the date from which this user is valid.

Specified by:
getValidFrom in interface DynamicParticipant
Returns:
the validity start date, or null if unlimited.

getValidTo

Date getValidTo()
Retrieves the date until this user is valid.

Specified by:
getValidTo in interface DynamicParticipant
Returns:
the validity end date, or null if unlimited.

getDescription

String getDescription()
Retrieves this user description.

Specified by:
getDescription in interface ModelElement
Returns:
the user description.

getProperty

Serializable getProperty(String name)
Retrieves a custom property value for user.

Parameters:
name - the property name.
Returns:
the value of the property.

getAllProperties

Map<String,Object> getAllProperties()
Retrieves all user custom properties.

Returns:
a Map of name-value pairs of user properties.

getDetailsLevel

UserDetailsLevel getDetailsLevel()
Retrieves the level of details for user.

Returns:
the user details level.

setPassword

void setPassword(String password)
Sets the password of the user. The actual password will not be changed until UserService.modifyUser(user) is invoked.

Parameters:
password - the new password.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

setAccount

void setAccount(String account)
Sets the account name of the user. The actual account will not be changed until UserService.modifyUser(user) is invoked.

Parameters:
account - the new account name
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

setDescription

void setDescription(String description)
Sets the description of the user. The actual description will not be changed until UserService.modifyUser(user) is invoked.

Parameters:
description - the user description.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

setEMail

void setEMail(String eMail)
Sets the email address of the user. The actual email address will not be changed until UserService.modifyUser(user) is invoked.

Parameters:
eMail - the new email address.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

setFirstName

void setFirstName(String firstName)
Sets the first name of the user. The actual first name will not be changed until UserService.modifyUser(user) is invoked.

Parameters:
firstName - the new first name of the user.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

setLastName

void setLastName(String lastName)
Sets the last name (family name) of the user. The actual name will not be changed until UserService.modifyUser(user) is invoked.

Parameters:
lastName - the user last name.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

setValidFrom

void setValidFrom(Date validFrom)
Sets the validity start date of the account. The actual date will not be changed until UserService.modifyUser(user) is invoked.

Parameters:
validFrom - the validity start date, or null if unlimited.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

setValidTo

void setValidTo(Date validTo)
Sets the validity end date of the account. The actual date will not be changed until UserService.modifyUser(user) is invoked.

Parameters:
validTo - the validity end date, or null if unlimited.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

setProperty

void setProperty(String name,
                 Serializable value)
Sets a custom property.

Parameters:
name - the name of the property.
value - the value of the property.

setAllProperties

void setAllProperties(Map<String,Object> properties)
Sets all the custom properties of the user. This method will clear any previous custom properties the user may have.

Parameters:
properties - a Map containing name-value pair of custom properties.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User)

getAllGrants

List<Grant> getAllGrants()
Returns all the grants (permissions) given to the user. Contains the organization grants before the role grants.

Returns:
a List of Grant objects.

addGrant

void addGrant(String id)
Deprecated. Please use addGrant(ModelParticipantInfo participant) instead

Adds a new grant to the user from the active model. The grant will not be actually given until UserService.modifyUser(user) is invoked.

Parameters:
id - the ID of the participant (role or organization) in the active model.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User), Grant

addGrant

void addGrant(ModelParticipantInfo participant)
Marks that grants for this participant should be added to all model versions. The grant will not be actually given until UserService.modifyUser(user) is invoked.

Parameters:
participant - the participants (bound or not to a department) for which the grants will be added.
Throws:
org.eclipse.stardust.common.error.InvalidArgumentException - if the participant is null.

removeGrant

void removeGrant(String id)
Deprecated. Please use removeGrant(ModelParticipantInfo participant) instead

Removes a grant from the user from the active model. The grant will not be actually removed until UserService.modifyUser(user) is invoked.

Parameters:
id - the ID of the participant (role or organization) in the active model.
See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User), Grant

removeGrant

void removeGrant(ModelParticipantInfo participant)
Marks the grants for this participant to be removed from all model versions. The grant will not be actually removed until UserService.modifyUser(user) is invoked.

Parameters:
participant - the participants (bound or not to a department) for which the grants will be removed.
Throws:
org.eclipse.stardust.common.error.InvalidArgumentException - if the participant is null.

removeAllGrants

void removeAllGrants()
Removes all user grants. The grants will not be actually removed until UserService.modifyUser(user) is invoked.

See Also:
UserService.modifyUser(org.eclipse.stardust.engine.api.runtime.User), Grant

getAllGroups

List<UserGroup> getAllGroups()
Lists all user groups this user is a member of.

Returns:
a list of UserGroup objects.

joinGroup

void joinGroup(String id)
Marks this user's desire to join the user group identified by the given id. Note: The actual join operation will only be performed when UserService.modifyUser(User) is invoked.

Parameters:
id - The id of the user group to be joined.

leaveGroup

void leaveGroup(String id)
Marks this user's desire to leave the user group identified by the given id. Note: The actual join operation will only be performed when UserService.modifyUser(User) is invoked.

Parameters:
id - The id of the user group to be left from.

getPermission

PermissionState getPermission(String permissionId)
Returns the permission state of the given permission id for the user.

Parameters:
permissionId -
Returns:
Granted if the the permission was granted to the user, Denied if the permission was denied to the user or Unknown if the permission is invalid for this user.


Copyright © 2017 Eclipse Stardust. All Rights Reserved.