public abstract class AbstractUserContext extends Object implements UserContext
UserContext.self()
and
UserContext.getAuthenticationProvider()
, but otherwise need only override an
implemented function if they wish to actually implement the functionality
defined for that function by the UserContext interface.Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_ROOT_CONNECTION_GROUP
The unique identifier that will be used for the root connection group if
getRootConnectionGroup() is not overridden. |
Constructor and Description |
---|
AbstractUserContext() |
Modifier and Type | Method and Description |
---|---|
Directory<ActiveConnection> |
getActiveConnectionDirectory()
Retrieves a Directory which can be used to view and manipulate
active connections, but only as allowed by the permissions given to the
user.
|
Collection<Form> |
getConnectionAttributes()
Retrieves a collection of all attributes applicable to connections.
|
Directory<Connection> |
getConnectionDirectory()
Retrieves a Directory which can be used to view and manipulate
connections and their configurations, but only as allowed by the
permissions given to the user.
|
Collection<Form> |
getConnectionGroupAttributes()
Retrieves a collection of all attributes applicable to connection
groups.
|
Directory<ConnectionGroup> |
getConnectionGroupDirectory()
Retrieves a Directory which can be used to view and manipulate
connection groups and their members, but only as allowed by the
permissions given to the user.
|
ActivityRecordSet<ConnectionRecord> |
getConnectionHistory()
Retrieves all connection records visible to current user.
|
Object |
getResource()
Returns an arbitrary REST resource representing this UserContext.
|
ConnectionGroup |
getRootConnectionGroup()
Retrieves a connection group which can be used to view and manipulate
connections, but only as allowed by the permissions given to the user of
this UserContext.
|
Collection<Form> |
getSharingProfileAttributes()
Retrieves a collection of all attributes applicable to sharing profiles.
|
Directory<SharingProfile> |
getSharingProfileDirectory()
Retrieves a Directory which can be used to view and manipulate
sharing profiles and their configurations, but only as allowed by the
permissions given to the user.
|
Collection<Form> |
getUserAttributes()
Retrieves a collection of all attributes applicable to users.
|
Directory<User> |
getUserDirectory()
Retrieves a Directory which can be used to view and manipulate other
users, but only as allowed by the permissions given to the user of this
UserContext.
|
Collection<Form> |
getUserGroupAttributes()
Retrieves a collection of all attributes applicable to user groups.
|
Directory<UserGroup> |
getUserGroupDirectory()
Retrieves a Directory which can be used to view and manipulate user
groups, but only as allowed by the permissions given to the user of this
UserContext.
|
ActivityRecordSet<ActivityRecord> |
getUserHistory()
Retrieves all user history records visible to current user.
|
void |
invalidate()
Invalidates this user context, releasing all associated resources.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAuthenticationProvider, self
protected static final String DEFAULT_ROOT_CONNECTION_GROUP
getRootConnectionGroup()
is not overridden.public Object getResource() throws org.apache.guacamole.GuacamoleException
This implementation simply returns null
. Implementations that
wish to expose REST resources specific to a user's session should
override this function.
getResource
in interface UserContext
org.apache.guacamole.GuacamoleException
- If the REST resource cannot be returned due to an error.public Directory<User> getUserDirectory() throws org.apache.guacamole.GuacamoleException
This implementation returns a Directory
which contains only
the User
returned by UserContext.self()
(the current user
associated with this UserContext
. Implementations that wish to
expose the existence of other users should override this function.
getUserDirectory
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while creating the
Directory.public Directory<UserGroup> getUserGroupDirectory() throws org.apache.guacamole.GuacamoleException
This implementation simply returns an empty Directory
.
Implementations that wish to expose user groups should override this
function.
getUserGroupDirectory
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while creating the Directory.public Directory<Connection> getConnectionDirectory() throws org.apache.guacamole.GuacamoleException
This implementation simply returns an empty Directory
.
Implementations that wish to expose connections should override this
function.
getConnectionDirectory
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while creating the
Directory.public Directory<ConnectionGroup> getConnectionGroupDirectory() throws org.apache.guacamole.GuacamoleException
This implementation returns a Directory
which contains only
the root connection group returned by getRootConnectionGroup()
.
Implementations that wish to provide a structured connection hierarchy
should override this function. If only a flat list of connections will
be used, only getConnectionDirectory()
needs to be overridden.
getConnectionGroupDirectory
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while creating the
Directory.public Directory<ActiveConnection> getActiveConnectionDirectory() throws org.apache.guacamole.GuacamoleException
This implementation simply returns an empty Directory
.
Implementations that wish to expose the status of active connections
should override this function.
getActiveConnectionDirectory
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while creating the Directory.public Directory<SharingProfile> getSharingProfileDirectory() throws org.apache.guacamole.GuacamoleException
This implementation simply returns an empty Directory
.
Implementations that wish to provide screen sharing functionality
through the use of sharing profiles should override this function.
getSharingProfileDirectory
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while creating the Directory.public ActivityRecordSet<ConnectionRecord> getConnectionHistory() throws org.apache.guacamole.GuacamoleException
This implementation simply returns an empty ActivityRecordSet
.
Implementations that wish to expose connection usage history should
override this function.
getConnectionHistory
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while retrieving the connection records.public ActivityRecordSet<ActivityRecord> getUserHistory() throws org.apache.guacamole.GuacamoleException
This implementation simply returns an empty ActivityRecordSet
.
Implementations that wish to expose user login/logout history should
override this function.
getUserHistory
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while retrieving the user records.public ConnectionGroup getRootConnectionGroup() throws org.apache.guacamole.GuacamoleException
This implementation returns a new ConnectionGroup
with the
identifier defined by DEFAULT_ROOT_CONNECTION_GROUP
and
containing all connections exposed by the Directory
returned by
getConnectionDirectory()
. Implementations that wish to provide
a structured connection hierarchy should override this function. If only
a flat list of connections will be used, only
getConnectionDirectory()
needs to be overridden.
getRootConnectionGroup
in interface UserContext
org.apache.guacamole.GuacamoleException
- If an error occurs while creating the
Directory.public Collection<Form> getUserAttributes()
This implementation simply returns an empty Collection
.
Implementations that wish to expose custom user attributes as fields
within user edit screens should override this function.
getUserAttributes
in interface UserContext
public Collection<Form> getUserGroupAttributes()
This implementation simply returns an empty Collection
.
Implementations that wish to expose custom user group attributes as
fields within user group edit screens should override this function.
getUserGroupAttributes
in interface UserContext
public Collection<Form> getConnectionAttributes()
This implementation simply returns an empty Collection
.
Implementations that wish to expose custom connection attributes as
fields within connection edit screens should override this function.
getConnectionAttributes
in interface UserContext
public Collection<Form> getConnectionGroupAttributes()
This implementation simply returns an empty Collection
.
Implementations that wish to expose custom connection group attributes
as fields within connection group edit screens should override this
function.
getConnectionGroupAttributes
in interface UserContext
public Collection<Form> getSharingProfileAttributes()
This implementation simply returns an empty Collection
.
Implementations that wish to expose custom sharing profile attributes as
fields within sharing profile edit screens should override this function.
getSharingProfileAttributes
in interface UserContext
public void invalidate()
This implementation does nothing. Implementations that wish to perform
cleanup tasks when the user associated with this UserContext
is
being logged out should override this function.
invalidate
in interface UserContext
Copyright © 2018. All rights reserved.