Jive API (3.0.13) Core Javadocs

com.jivesoftware.base
Interface User

All Superinterfaces:
AttachmentContentResource, JiveObject
All Known Implementing Classes:
UserTemplate

public interface User
extends JiveObject, AttachmentContentResource

The User interface provides information about and services for users of the system. Users can be identified by a unique id or username. Users can also be organized into groups for easier management of permissions.

The name and email field will normally be required fields when creating user accounts for most implementations. However, some users may wish to keep that information private. Therefore, there are two flags to set if the name and email fields should be made visible to other users. If the flags are set to deny access, getName() and getEmail() will throw UnauthorizedExceptions to users that don't have administrator permissions.

Security for User objects is provide by UserProxy protection proxy objects.

Instructions for those that wish to implement this interface to provide a custom User implementation appear in red. Note that as of 2.0, the contract for this object has been simplified to be read-only. All changes must be made via an underlying template such as the UserTemplate.

See Also:
Group, UserTemplate

Nested Class Summary
static class User.Status
           
 
Field Summary
static String EMAIL_VISIBILITY_ALLOW_TOGGLE
          A JiveProperty key to get the setting for allowing the user to choose email address visiblity.
static String EMAIL_VISIBILITY_DEFAULT
          A JiveProperty key to get the default setting for email address visiblity.
static String NAME_VISIBILITY_ALLOW_TOGGLE
          A JiveProperty key to get the setting for allowing the user to choose name visiblity.
 
Method Summary
 Date getCreationDate()
          Returns the date that the user was created.
 String getEmail()
          Returns the user's email address.
 String getFirstName()
          Returns the user's first name.
 long getID()
          Returns the user's id.
 Date getLastLoggedIn()
          Returns the date the user last logged in.
 String getLastName()
          Returns the user's last name.
 Date getLastProfileUpdate()
          Returns the date the user's profile was last updated, or null if not set.
 Date getModificationDate()
          Returns the date that the user was last modified.
 String getName()
          Returns the user's name.
 String getPassword()
          Exposes a raw password.
 String getPasswordHash()
          Returns the user's password in hashed form.
 Permissions getPermissions(AuthToken authToken)
          Returns the permissions for the user that correspond to the passed-in AuthToken.
 Map<String,String> getProperties()
          Retrieve a map of all the extended properties for the user.
 User.Status getStatus()
          Returns the current status of the user in regards to moderation.
 String getUsername()
          Returns the user's username.
 boolean isAnonymous()
          Returns true if the user represents an anonymous user.
 boolean isAuthorized(long permissionType)
          Returns true if the handle on the object has the permission specified.
 boolean isEmailVisible()
          Returns true if the user has chosen to make her email visible to other users.
 boolean isEnabled()
          Returns true if the user is disabled, meaning they cannot log in.
 boolean isExternal()
          Indicates if the user is simply a representation of an external identity and not a Jive SBS system user.
 boolean isFederated()
          Indicates if a user is a federated - if their identity is managed outside the Jive SBS application.
 boolean isGetPasswordHashSupported()
          Indicates whether retrieving a password hash is supported for this user.
 boolean isNameVisible()
          Returns true if the user has chosen to make her name visible to other users.
 boolean isPropertyEditSupported()
          Indicates whether the property methods (get, set, delete, etc.) are supported.
 boolean isSetEmailSupported()
          Indicates whether setting the email address is supported for this user.
 boolean isSetEmailVisibleSupported()
          Indicates whether setting the visibility of the email address is supported for this user.
 boolean isSetNameSupported()
          Indicates whether setting the full name is supported for this user.
 boolean isSetNameVisibleSupported()
          Indicates whether setting the visibility of the name is supported for this user.
 boolean isSetPasswordHashSupported()
          Indicates whether modifying the hash of the user's password is supported for this user.
 boolean isSetPasswordSupported()
          Indicates whether modifying the user's password is supported.
 boolean isSetUsernameSupported()
          Indicates whether setting the username is supported for this user.
 

Field Detail

EMAIL_VISIBILITY_DEFAULT

static final String EMAIL_VISIBILITY_DEFAULT
A JiveProperty key to get the default setting for email address visiblity.

See Also:
Constant Field Values

EMAIL_VISIBILITY_ALLOW_TOGGLE

static final String EMAIL_VISIBILITY_ALLOW_TOGGLE
A JiveProperty key to get the setting for allowing the user to choose email address visiblity.

See Also:
Constant Field Values

NAME_VISIBILITY_ALLOW_TOGGLE

static final String NAME_VISIBILITY_ALLOW_TOGGLE
A JiveProperty key to get the setting for allowing the user to choose name visiblity.

See Also:
Constant Field Values
Method Detail

getID

long getID()
Returns the user's id. All ids must be unique in the system.

Specified by:
getID in interface JiveObject
Returns:
the user's id.

getUsername

String getUsername()
Returns the user's username. All usernames must be unique in the system.

Returns:
the username of the user.

getName

String getName()
Returns the user's name. The user's name does not have to be to be unique in the system. Some users may opt to not let others see their name for privacy reasons. In that case, the user can set nameVisible to false. In that case, a call to this method will return null. If firstName and lastName exist in persistence, a concatinated String of these values will be returned.

Returns:
the name of the user.

getFirstName

String getFirstName()
Returns the user's first name. Follows visibility rules defined as defined in getName(). General API usage will be to use getName() to retrieve the full name, as the first name will be returned only if it exists in persistence.

Returns:
the first name of the user, or null if the first name doesn't exist.

getLastName

String getLastName()
Returns the user's last name. Follows visibility rules defined as defined in getName(). General API usage will be to use getName() to retrieve the full name, as the first name will be returned only if it exists in persistence.

Returns:
the last name of the user, or null if the last name doesn't exist.

isNameVisible

boolean isNameVisible()
Returns true if the user has chosen to make her name visible to other users. If the name is not visible, calling getName() will throw an UnauthorizedException.

Returns:
true if the name is visible to other users.

getPasswordHash

String getPasswordHash()
                       throws UnauthorizedException
Returns the user's password in hashed form. This method is only intended for system administration functions and can be ignored by skin writers.

If your back-end user store does not support this operation, throw an UnsupportedOperationException.

Returns:
the hashed password.
Throws:
UnauthorizedException - if does not have administrator permissions.

getPassword

String getPassword()
                   throws UnauthorizedException
Exposes a raw password. Will generally be null except in the case where a user is being created or updated.

Returns:
null if the password is not set in this context.
Throws:
UnauthorizedException

getEmail

String getEmail()
Returns the user's email address. Email should be considered to be a required field of a user account since it is critical to many user operations performing. If the user sets emailVisible to false, this method will always return null.

If your back-end user store does not support this operation, always return null.

Returns:
the email address of the user.

isEmailVisible

boolean isEmailVisible()
Returns true if the user has chosen to make her email visible to other users. If the email field is not visible, calling getEmail() will throw an UnauthorizedException.

Returns:
true if the name is visible to other users.

getCreationDate

Date getCreationDate()
Returns the date that the user was created.

If your back-end user store does not support this operation, throw an UnsupportedOperationException.

Returns:
the date the user was created.

getModificationDate

Date getModificationDate()
Returns the date that the user was last modified.

Returns:
the date the user record was last modified.

getProperties

Map<String,String> getProperties()
Retrieve a map of all the extended properties for the user. Each user can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface. The map is alterable if the user is authorized to modify the user. Null keys and values are not allowed.

If the user is not authorized to modify the user any method which modifies the map will fail with a UnsupportedOperationException;

Changes to the properties requires updates.

Returns:
a map of user extended properties.

getPermissions

Permissions getPermissions(AuthToken authToken)
Returns the permissions for the user that correspond to the passed-in AuthToken.

Parameters:
authToken - the auth token to look up permissions with.
Returns:
The permissions for the auth token.

isAuthorized

boolean isAuthorized(long permissionType)
Returns true if the handle on the object has the permission specified. A list of possible permissions can be found in the Permissions class. Certain methods of this class are restricted to certain permissions as specified in the method comments.

Because proxy objects will implement real security checking, this method should be implemented as:
return true;
.

Parameters:
permissionType - the permission to check for.
Returns:
True if the user is authorized.
See Also:
Permissions

getLastLoggedIn

Date getLastLoggedIn()
Returns the date the user last logged in.

Returns:
the date the user last logged in.

getLastProfileUpdate

Date getLastProfileUpdate()
Returns the date the user's profile was last updated, or null if not set.

Returns:
the date the user's profile was last updated, or null if not set.

isEnabled

boolean isEnabled()
Returns true if the user is disabled, meaning they cannot log in. Disabled Users do not count against perseat licensing.

Returns:
Returns false if the user is disabled

isFederated

boolean isFederated()
Indicates if a user is a federated - if their identity is managed outside the Jive SBS application. Every user has an internal application representation but for many installations, Jive SBS will not be the system of record.

Returns:
Since:
2.0

isExternal

boolean isExternal()
Indicates if the user is simply a representation of an external identity and not a Jive SBS system user. Originally motivated by external collaboration users. All external users are federated, but not all federated users are external. External users do not count against Jive SBS licenses seats.

Returns:
Since:
2.0

isSetPasswordSupported

boolean isSetPasswordSupported()
Indicates whether modifying the user's password is supported.

Returns:
true if modifying the user's password is supported.

isGetPasswordHashSupported

boolean isGetPasswordHashSupported()
Indicates whether retrieving a password hash is supported for this user.

Returns:
true if you can retrieve a password hash.

isSetPasswordHashSupported

boolean isSetPasswordHashSupported()
Indicates whether modifying the hash of the user's password is supported for this user.

Returns:
true if setting the hash is supported.

isSetNameSupported

boolean isSetNameSupported()
Indicates whether setting the full name is supported for this user.

Returns:
true if setting the name is supported.

isSetUsernameSupported

boolean isSetUsernameSupported()
Indicates whether setting the username is supported for this user.

Returns:
true if setting the username is supported.

isSetEmailSupported

boolean isSetEmailSupported()
Indicates whether setting the email address is supported for this user.

Returns:
true if setting the email is supported.

isSetNameVisibleSupported

boolean isSetNameVisibleSupported()
Indicates whether setting the visibility of the name is supported for this user.

Returns:
true if setting the name visibility flag is supported.

isSetEmailVisibleSupported

boolean isSetEmailVisibleSupported()
Indicates whether setting the visibility of the email address is supported for this user.

Returns:
true if setting the email visibility flag is supported.

isPropertyEditSupported

boolean isPropertyEditSupported()
Indicates whether the property methods (get, set, delete, etc.) are supported.

Returns:
true if the property methods are supported.

getStatus

User.Status getStatus()
Returns the current status of the user in regards to moderation.

Returns:
the current status of the user in regards to moderation.

isAnonymous

boolean isAnonymous()
Returns true if the user represents an anonymous user.

Returns:

Jive Product Page

Copyright © 1999-2007 Jive Software.