Package org.apache.guacamole.net.auth
Class DelegatingUser
- java.lang.Object
-
- org.apache.guacamole.net.auth.DelegatingUser
-
- All Implemented Interfaces:
Attributes,Identifiable,Permissions,ReadableAttributes,User
public class DelegatingUser extends Object implements User
User implementation which simply delegates all function calls to an underlying User.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.guacamole.net.auth.User
User.Attribute
-
-
Constructor Summary
Constructors Constructor Description DelegatingUser(User user)Wraps the given User such that all function calls against this DelegatingUser will be delegated to it.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ObjectPermissionSetgetActiveConnectionPermissions()Returns all permissions given to this object regarding currently-active connections.Map<String,String>getAttributes()Returns all attributes associated with this object.ObjectPermissionSetgetConnectionGroupPermissions()Returns all connection group permissions given to this object.ObjectPermissionSetgetConnectionPermissions()Returns all connection permissions given to this object.protected UsergetDelegateUser()Returns the underlying User wrapped by this DelegatingUser.PermissionsgetEffectivePermissions()Returns a read-only view of all permissions granted to this user.List<? extends ActivityRecord>getHistory()Deprecated.StringgetIdentifier()Returns the unique identifier assigned to this object.DategetLastActive()Returns the date and time that this user was last active.StringgetPassword()Returns this user's password.ObjectPermissionSetgetSharingProfilePermissions()Returns all sharing profile permissions given to this object.SystemPermissionSetgetSystemPermissions()Returns all system-level permissions given to this object.ObjectPermissionSetgetUserGroupPermissions()Returns all user group permissions given to this object.RelatedObjectSetgetUserGroups()Returns a set of all readable user groups of which this user is a member.ActivityRecordSet<ActivityRecord>getUserHistory()Returns an ActivityRecordSet containing ActivityRecords representing the login history for this user, including any active sessions.ObjectPermissionSetgetUserPermissions()Returns all user permissions given to this object.voidsetAttributes(Map<String,String> attributes)Sets the given attributes.voidsetIdentifier(String identifier)Sets the identifier assigned to this object.voidsetPassword(String password)Sets this user's password.
-
-
-
Constructor Detail
-
DelegatingUser
public DelegatingUser(User user)
Wraps the given User such that all function calls against this DelegatingUser will be delegated to it.- Parameters:
user- The User to wrap.
-
-
Method Detail
-
getDelegateUser
protected User getDelegateUser()
Returns the underlying User wrapped by this DelegatingUser.- Returns:
- The User wrapped by this DelegatingUser.
-
getIdentifier
public String getIdentifier()
Description copied from interface:IdentifiableReturns the unique identifier assigned to this object. All identifiable objects must have a deterministic, unique identifier which may not be null.- Specified by:
getIdentifierin interfaceIdentifiable- Returns:
- The unique identifier assigned to this object, which may not be null.
-
setIdentifier
public void setIdentifier(String identifier)
Description copied from interface:IdentifiableSets the identifier assigned to this object.- Specified by:
setIdentifierin interfaceIdentifiable- Parameters:
identifier- The identifier to assign.
-
getPassword
public String getPassword()
Description copied from interface:UserReturns this user's password. Note that the password returned may be hashed or completely arbitrary.- Specified by:
getPasswordin interfaceUser- Returns:
- A String which may (or may not) be the user's password.
-
setPassword
public void setPassword(String password)
Description copied from interface:UserSets this user's password. Note that while this function is guaranteed to change the password of this User object, there is no guarantee that getPassword() will return the value given to setPassword().- Specified by:
setPasswordin interfaceUser- Parameters:
password- The password to set.
-
getAttributes
public Map<String,String> getAttributes()
Description copied from interface:ReadableAttributesReturns all attributes associated with this object. The returned map may not be modifiable.- Specified by:
getAttributesin interfaceReadableAttributes- Returns:
- A map of all attribute identifiers to their corresponding values, for all attributes associated with this object, which may not be modifiable.
-
setAttributes
public void setAttributes(Map<String,String> attributes)
Description copied from interface:AttributesSets the given attributes. If an attribute within the map is not supported, it will simply be dropped. Any attributes not within the given map will be left untouched. Attributes which are not declared within the associated UserContext MUST NOT be submitted, but other extensions may manipulate the declared attributes through decorate() and redecorate(). Implementations may optionally allow storage of unsupported attributes. Extensions which rely on other extensions to store their attribute values should verify that such storage is supported by first testing that the attribute value is retrievable via getAttributes() after being set.- Specified by:
setAttributesin interfaceAttributes- Parameters:
attributes- A map of all attribute identifiers to their corresponding values.
-
getLastActive
public Date getLastActive()
Description copied from interface:UserReturns the date and time that this user was last active. If the user was never active, the time that the user was last active is unknown, or this information is not visible to the current user, this may be null.- Specified by:
getLastActivein interfaceUser- Returns:
- The date and time this user was last active, or null if this information is unavailable or inapplicable.
-
getHistory
@Deprecated public List<? extends ActivityRecord> getHistory() throws org.apache.guacamole.GuacamoleException
Deprecated.Description copied from interface:UserReturns a list of ActivityRecords representing the login history of this user, including any active sessions. ActivityRecords in this list will be sorted in descending order of end time (active sessions are first), and then in descending order of start time (newer sessions are first). If user login history is not implemented this method should throw GuacamoleUnsupportedException.- Specified by:
getHistoryin interfaceUser- Returns:
- A list of ActivityRecords representing the login history of this User.
- Throws:
org.apache.guacamole.GuacamoleException- If history tracking is not implemented, if an error occurs while reading the history of this user, or if permission is denied.
-
getUserHistory
public ActivityRecordSet<ActivityRecord> getUserHistory() throws org.apache.guacamole.GuacamoleException
Description copied from interface:UserReturns an ActivityRecordSet containing ActivityRecords representing the login history for this user, including any active sessions. ActivityRecords in this list will be sorted in descending order of end time (active sessions are first), and then in descending order of start time (newer sessions are first). If login history tracking is not implemented, or is only implemented using the deprecatedUser.getHistory()method, this method should throw GuacamoleUnsupportedException.- Specified by:
getUserHistoryin interfaceUser- Returns:
- An ActivityRecordSet containing ActivityRecords representing the login history for this user.
- Throws:
org.apache.guacamole.GuacamoleException- If history tracking is not implemented, if an error occurs while reading the history of this user, or if permission is denied.
-
getSystemPermissions
public SystemPermissionSet getSystemPermissions() throws org.apache.guacamole.GuacamoleException
Description copied from interface:PermissionsReturns all system-level permissions given to this object.- Specified by:
getSystemPermissionsin interfacePermissions- Returns:
- A SystemPermissionSet of all system-level permissions granted to this object.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving permissions, or if reading all permissions is not allowed.
-
getConnectionPermissions
public ObjectPermissionSet getConnectionPermissions() throws org.apache.guacamole.GuacamoleException
Description copied from interface:PermissionsReturns all connection permissions given to this object.- Specified by:
getConnectionPermissionsin interfacePermissions- Returns:
- An ObjectPermissionSet of all connection permissions granted to this object.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving permissions, or if reading all permissions is not allowed.
-
getConnectionGroupPermissions
public ObjectPermissionSet getConnectionGroupPermissions() throws org.apache.guacamole.GuacamoleException
Description copied from interface:PermissionsReturns all connection group permissions given to this object.- Specified by:
getConnectionGroupPermissionsin interfacePermissions- Returns:
- An ObjectPermissionSet of all connection group permissions granted to this object.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving permissions, or if reading all permissions is not allowed.
-
getSharingProfilePermissions
public ObjectPermissionSet getSharingProfilePermissions() throws org.apache.guacamole.GuacamoleException
Description copied from interface:PermissionsReturns all sharing profile permissions given to this object.- Specified by:
getSharingProfilePermissionsin interfacePermissions- Returns:
- An ObjectPermissionSet of all sharing profile permissions granted to this object.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving permissions, or if reading all permissions is not allowed.
-
getActiveConnectionPermissions
public ObjectPermissionSet getActiveConnectionPermissions() throws org.apache.guacamole.GuacamoleException
Description copied from interface:PermissionsReturns all permissions given to this object regarding currently-active connections.- Specified by:
getActiveConnectionPermissionsin interfacePermissions- Returns:
- An ObjectPermissionSet of all active connection permissions granted to this object.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving permissions, or if reading all permissions is not allowed.
-
getUserPermissions
public ObjectPermissionSet getUserPermissions() throws org.apache.guacamole.GuacamoleException
Description copied from interface:PermissionsReturns all user permissions given to this object.- Specified by:
getUserPermissionsin interfacePermissions- Returns:
- An ObjectPermissionSet of all user permissions granted to this object.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving permissions, or if reading all permissions is not allowed.
-
getUserGroupPermissions
public ObjectPermissionSet getUserGroupPermissions() throws org.apache.guacamole.GuacamoleException
Description copied from interface:PermissionsReturns all user group permissions given to this object.- Specified by:
getUserGroupPermissionsin interfacePermissions- Returns:
- An ObjectPermissionSet of all user group permissions granted to this object.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving permissions, or if reading all permissions is not allowed.
-
getUserGroups
public RelatedObjectSet getUserGroups() throws org.apache.guacamole.GuacamoleException
Description copied from interface:UserReturns a set of all readable user groups of which this user is a member. If permission is granted for the current user to modify the membership of this user, then the returned set will be mutable, and any such modifications should be made through changes to the returned set.- Specified by:
getUserGroupsin interfaceUser- Returns:
- The set of all readable user groups of which this user is a member.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving the user groups.
-
getEffectivePermissions
public Permissions getEffectivePermissions() throws org.apache.guacamole.GuacamoleException
Description copied from interface:UserReturns a read-only view of all permissions granted to this user. The exact semantics of what permissions are granted are up to the implementation, and the permissions within this view may be implied, derived dynamically, inherited through multiple levels of group membership, etc.- Specified by:
getEffectivePermissionsin interfaceUser- Returns:
- A read-only view of the permissions which are granted to this user.
- Throws:
org.apache.guacamole.GuacamoleException- If an error occurs while retrieving permissions, or if reading all permissions is not allowed.
-
-