com.flexive.shared.security
Class Account

java.lang.Object
  extended by com.flexive.shared.AbstractSelectableObjectWithName
      extended by com.flexive.shared.security.Account
All Implemented Interfaces:
SelectableObject, SelectableObjectWithName, java.io.Serializable
Direct Known Subclasses:
AccountEdit

public class Account
extends AbstractSelectableObjectWithName
implements java.io.Serializable

User account class.

Author:
Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at), Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
protected  boolean active
           
protected  boolean allowMultiLogin
           
protected  long contactDataId
           
protected  long defaultNodeId
           
protected  java.lang.String description
           
protected  java.lang.String email
           
protected  long id
           
protected  FxLanguage language
           
protected  LifeCycleInfo lifeCycleInfo
           
protected  java.lang.String loginName
           
protected  long mandatorId
           
protected  java.lang.String name
           
static long NULL_ACCOUNT
          Dummy account (id if a null value cannot be applied)
protected  java.lang.String updateToken
           
static long USER_GLOBAL_SUPERVISOR
          The supervisor.
static long USER_GUEST
          The guest user.
static java.util.Date VALID_FOREVER
          01.01.3000
protected  boolean validated
           
protected  java.util.Date validFrom
           
protected  java.util.Date validTo
           
 
Constructor Summary
Account()
           
Account(Account other)
           
Account(long id, java.lang.String name, java.lang.String loginName, long mandator, java.lang.String email, FxLanguage language, boolean active, boolean validated, java.util.Date validFrom, java.util.Date validTo, long defaultNode, java.lang.String description, long contactDataId, boolean allowMultiLogin, java.lang.String updateToken, LifeCycleInfo lifeCycleInfo)
           
 
Method Summary
 AccountEdit asEditable()
           
 FxPK getContactData()
          Get the primary key of the contact data object holding further informations of the user.
 long getContactDataId()
          Get the id of the contact data instance associated to this account
 long getDefaultNode()
          Returns the desired default node of the user.
 java.lang.String getDescription()
          Gets the description if the user.
 java.lang.String getEmail()
          Returns the email of the user.
 long getId()
          Returns the unique user id.
 FxLanguage getLanguage()
          Returns the language of the user.
 LifeCycleInfo getLifeCycleInfo()
          Get the lifecycle information
 java.lang.String getLoginName()
          Returns the login name of the user.
 long getMandatorId()
          Returns the unique id of the mandator this user belongs to.
 java.lang.String getName()
          Returns the user name.
 java.lang.String getUpdateToken()
          Returns the update token of this account.
 java.util.Date getValidFrom()
          Returns the valid from date of the user.
 java.lang.String getValidFromString()
          Returns the valid from date of the user.
 java.util.Date getValidTo()
          Returns the valid to date of the user.
 java.lang.String getValidToString()
          Returns the valid to date of the user.
 boolean isActive()
          Return true if the user is active.
 boolean isAllowMultiLogin()
          Is this account allowed to be logged in more than once?
 boolean isNew()
          Is this account instance new? (i.e.
 boolean isSystemInternalAccount()
          Is this a system internal account?
 boolean isValidated()
          Returns true if the user is validated.
 
Methods inherited from class com.flexive.shared.AbstractSelectableObjectWithName
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

USER_GUEST

public static final long USER_GUEST
The guest user. Everyone who is not logged in is treated as GUEST

See Also:
Constant Field Values

USER_GLOBAL_SUPERVISOR

public static final long USER_GLOBAL_SUPERVISOR
The supervisor. This user is in all roles and may operate on all mandators

See Also:
Constant Field Values

NULL_ACCOUNT

public static final long NULL_ACCOUNT
Dummy account (id if a null value cannot be applied)

See Also:
Constant Field Values

VALID_FOREVER

public static final java.util.Date VALID_FOREVER
01.01.3000


name

protected java.lang.String name

loginName

protected java.lang.String loginName

id

protected long id

mandatorId

protected long mandatorId

email

protected java.lang.String email

language

protected FxLanguage language

active

protected boolean active

validated

protected boolean validated

validFrom

protected java.util.Date validFrom

validTo

protected java.util.Date validTo

defaultNodeId

protected long defaultNodeId

description

protected java.lang.String description

contactDataId

protected long contactDataId

allowMultiLogin

protected boolean allowMultiLogin

updateToken

protected java.lang.String updateToken

lifeCycleInfo

protected LifeCycleInfo lifeCycleInfo
Constructor Detail

Account

public Account()

Account

public Account(long id,
               java.lang.String name,
               java.lang.String loginName,
               long mandator,
               java.lang.String email,
               FxLanguage language,
               boolean active,
               boolean validated,
               java.util.Date validFrom,
               java.util.Date validTo,
               long defaultNode,
               java.lang.String description,
               long contactDataId,
               boolean allowMultiLogin,
               java.lang.String updateToken,
               LifeCycleInfo lifeCycleInfo)

Account

public Account(Account other)
Method Detail

isSystemInternalAccount

public boolean isSystemInternalAccount()
Is this a system internal account?

Returns:
system internal account

isNew

public boolean isNew()
Is this account instance new? (i.e. not saved yet)

Returns:
if new

getEmail

public java.lang.String getEmail()
Returns the email of the user.

Returns:
the email of the user

getLanguage

public FxLanguage getLanguage()
Returns the language of the user.

Returns:
the language of the user

getName

public java.lang.String getName()
Returns the user name.

Specified by:
getName in interface SelectableObjectWithName
Returns:
the user name.

getId

public long getId()
Returns the unique user id.

Specified by:
getId in interface SelectableObject
Returns:
the unique user id.

getMandatorId

public long getMandatorId()
Returns the unique id of the mandator this user belongs to.

Returns:
the unique id of the mandator this user belongs to.

getLoginName

public java.lang.String getLoginName()
Returns the login name of the user.

Returns:
the login name of the user.

isActive

public boolean isActive()
Return true if the user is active.

Returns:
true if the user is active

isValidated

public boolean isValidated()
Returns true if the user is validated.

Returns:
true if the user is validated

getValidFrom

public java.util.Date getValidFrom()
Returns the valid from date of the user.

The valid from/to dates may be used to define a timeperiode in which the user may LOG in.

Returns:
the valid from date of the user

getValidTo

public java.util.Date getValidTo()
Returns the valid to date of the user.

The valid from/to dates may be used to define a timeperiode in which the user may LOG in.

Returns:
the valid to date of the user

getValidFromString

public java.lang.String getValidFromString()
Returns the valid from date of the user.

The valid from/to dates may be used to define a timeperiode in which the user may LOG in.

Returns:
the valid from date of the user

getValidToString

public java.lang.String getValidToString()
Returns the valid to date of the user.

The valid from/to dates may be used to define a timeperiode in which the user may LOG in.

Returns:
the valid to date of the user

getDescription

public java.lang.String getDescription()
Gets the description if the user.

The result may be a empty String (but is never null)

Returns:
the description if the user

getContactData

public FxPK getContactData()
Get the primary key of the contact data object holding further informations of the user.

Returns:
the id of the contact data object

getContactDataId

public long getContactDataId()
Get the id of the contact data instance associated to this account

Returns:
contact data id

getUpdateToken

public java.lang.String getUpdateToken()
Returns the update token of this account. The update token may be used in external API calls modifying this account to improve security.

Returns:
the update token of this account

getDefaultNode

public long getDefaultNode()
Returns the desired default node of the user. May be -1 if no default node is defined.

Returns:
the desired default node of the user

isAllowMultiLogin

public boolean isAllowMultiLogin()
Is this account allowed to be logged in more than once?

Returns:
multi login allowed?

getLifeCycleInfo

public LifeCycleInfo getLifeCycleInfo()
Get the lifecycle information

Returns:
lifecycle information

asEditable

public AccountEdit asEditable()