***  This interface provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.user
Interface UserContextInterface

All Superinterfaces:
com.sas.metadata.remote.CredentialResolver, java.rmi.Remote
All Known Implementing Classes:
UserContext

public interface UserContextInterface
extends com.sas.metadata.remote.CredentialResolver

The UserContextInterface provides a mechanism for maintaining information about a user entity. The user authentication identities, and access to the user profile are provided from here, as well as a list of repositories that the user is connected to.

Since:
1.0

Field Summary
static java.lang.String IDPROPAGATION_SSPI
          Name of SSPI ID propagation mechanism.
static java.lang.String IDPROPAGATION_TRUSTED_PEER
          Name of Trusted Peer ID propagation mechanism.
static java.lang.String INTERNAL_AUTH_DOMAIN
          The internal authentication domain that will be set on an identity if the resolved domain matches the internal authenticator domain from the server.
static java.lang.String SHAREDRESOURCEKEY_CLIENT_TOKEN
          Key for a client token map in the shared resource map.
static java.lang.String SHAREDRESOURCEKEY_ENVIRONMENT
          Key for an environment object in the shared resource map.
static java.lang.String SHAREDRESOURCEKEY_SERVICEID
           
 
Method Summary
 void addException(java.lang.Exception exception)
          Add an exception to the list.
 void addIdentity(UserIdentityInterface identity)
          Add an identity to the context.
 void addLogChangeListener(LogChangeListener listener)
          Receive a notification when the UserContext's logger is changed.
 void addRepository(java.lang.Object repository)
          Add a repository to this user context.
 void addRepositoryGroup(RepositoryGroup group)
          Add a repository group to this UserContext.
 void addServer(ServerInterface server)
          Add a server to the list that this user is connected to.
 boolean authenticate()
          Authenticate a user based on their current OS identity.
 boolean authenticate(UserIdentityInterface ident, java.util.Map options)
          Authenticates a user identity.
 void clearExceptions()
          Clear the exception list.
 void destroy()
          Destroy the user context.
 void enableLocalAdminMode(java.lang.String authDomain)
          This sets up a special case where an administrative user with an internal account is used to authenticate a user.
 java.util.List getActions(java.lang.String appName)
          Get a List of actions associated with an application that this user can perform.
 java.util.List getActions(java.lang.String appName, boolean onlyGrantedActions)
          Get a List of actions associated with an application.
 java.lang.String getAppSource()
          Get the name of the application that initiated the login request for this UserContext.
 RepositoryInterface getAuthRepository()
          Deprecated. Use getAuthServer instead.
 java.lang.String getAuthRepositoryName()
          Deprecated. Use getAuthServerName instead.
 ServerInterface getAuthServer()
          Get a handle to the metadata server the user authenticated against.
 java.lang.String getAuthServerName()
          Get the definition name of the server the user authenticated against.
 RemoteCallbackHandler getChallengeCallbackHandler()
          Get the object that will handle credential challenge callbacks.
 java.lang.String getClientSource()
          Get the client location idetifier where the login request originated.
 java.lang.String getDescription()
          Get the common description for this user.
 java.lang.Exception[] getExceptions()
          Get an array of exceptions that have occurred since the last time they were cleared.
 java.util.List getGroups()
          Get a List of the groups this user is a member of.
 java.util.List getIdentities()
          Get an iterator of UserIdentityInterface objects that represent the currently available authentication identities for the user.
 java.util.List getIdentitiesByDomain(java.lang.String domain, boolean issueChallenge, java.lang.String challengePrompt)
          This method returns a list of all the credential sets that are available for the requested domain.
 UserIdentityInterface getIdentityByDomain(java.lang.String domain)
          Get an authentication identity for the given domain.
 UserIdentityInterface getIdentityByDomain(java.lang.String domain, boolean issueChallenge)
          Get an identity by domain.
 UserIdentityInterface getIdentityByDomain(java.lang.String domain, boolean issueChallenge, java.lang.String challengePrompt)
          Get an identity by domain.
 java.lang.String getIDPropagation()
          If the UserContext was authenticated using an ID propagation mechanism such as SSPI, the name of the ID propagation mechanism is returned.
 java.lang.String getKey()
          Get the user key.
 java.util.Locale getLocale()
          Get the locale for this user.
 LoggerInterface getLogger()
          Get the LoggerInterface for this user.
 LoginCallbackHandler getLoginCallback()
          Get the callback handler.
 long getLoginTime()
          Get the timestamp when the user was authenticated.
 java.lang.String getName()
          Get the name of this user.
 IdentityInterface getPerson()
          Return the IdentityInterface object that represents this user.
 java.lang.String getPersonFQID()
          Get the FQID of the authenticated Identity.
 java.util.Set getPrincipals()
          Gets the set of principals.
 java.util.Set getPrivateCredentials()
          Gets the set of private credentials.
 ProfileInterface getProfile()
          Get the user's profile set.
 java.util.Set getPublicCredentials()
          Gets the set of public credentials.
 java.util.List getRepositories()
          Get a List of the repositories this user is connected to.
 RepositoryInterface getRepository(java.lang.String name)
          Get a repository based on the name.
 RepositoryGroup getRepositoryGroup(java.lang.String name)
          Get a repository group from this UserContext.
 java.lang.String getResolvedUserId()
          Return the metadata server resolved user id.
 java.util.List getRoles()
          Get a List of the roles this user is a member of.
 ServerInterface getServer(java.lang.String name)
          Get a specific named Information Service server from this user.
 java.util.List getServers()
          Get a List of the servers this user is connected to.
 SessionContextInterface getSessionContext()
          Get the session context for this user.
 java.lang.Object getSharedResource(java.lang.String key)
          Get an object from the shared resource map.
 java.lang.String getUniqueId()
          Returns a unique identifier for this object.
 boolean hasCapability(java.lang.String appName, java.lang.String action)
          Check whether this user has the capability to perform a specific action for a particular application.
 boolean isDestroyed()
          Return true if this User Context has been destroyed, or is in the process of being destroyed.
 boolean isInAnyGroup(java.util.List groupList)
          Check whether the user is a member of any of the groups in the list.
 boolean isInAnyRole(java.util.List roleList)
          Check whether the user is a member of any of the roles in the list.
 boolean isInGroup(java.lang.String group)
          Check whether the user is a member of a given group.
 boolean isInRole(java.lang.String role)
          Check whether the user is a member of a given role.
 boolean isInternalUser()
          Return a boolean indicating if this user was created using an internal userid.
 java.lang.Object putSharedResource(java.lang.String key, java.lang.Object value)
          Put an object into the shared resource map.
 void refreshRepositoryData()
          Refresh all of the data that's been retrieved using the Information Service during the life of this UserContext.
 void removeIdentity(UserIdentityInterface identity)
          Remove an identity from the context.
 void removeRepository(java.lang.Object repository)
          Remove a repository from this context.
 void removeRepositoryGroup(RepositoryGroup group)
          Remove a repository group from this UserContext.
 void removeServer(ServerInterface server)
          Remove a server from the list that this user is currently connected to.
 void setAppSource(java.lang.String source)
          Set the application source identifier that initiated the logon request for this UserContext.
 void setChallengeCallbackHandler(RemoteCallbackHandler handler)
          Set the object that will be used to handle credential challenge callbacks.
 void setClientSource(java.lang.String source)
          Set the source location identifier for this UserContext.
 void setKey(java.lang.String key)
          Set the user key.
 void setLocale(java.util.Locale locale)
          Set the locale to use for this user session.
 void setName(java.lang.String name)
          Set the name of the user.
 void setPerson(IdentityInterface identity)
          This method gets called by UserService as part of the UserContext initialization.
 void setSessionContext(SessionContextInterface session)
          Set the session context that this user context will use for logging, etc.
 byte[] toByteArray()
           
 

Field Detail

SHAREDRESOURCEKEY_ENVIRONMENT

static final java.lang.String SHAREDRESOURCEKEY_ENVIRONMENT
Key for an environment object in the shared resource map. An environment object encapsulates resources provided by the container.

See Also:
getSharedResource(String), putSharedResource(String, Object), Constant Field Values

SHAREDRESOURCEKEY_SERVICEID

static final java.lang.String SHAREDRESOURCEKEY_SERVICEID
See Also:
Constant Field Values

SHAREDRESOURCEKEY_CLIENT_TOKEN

static final java.lang.String SHAREDRESOURCEKEY_CLIENT_TOKEN
Key for a client token map in the shared resource map. The client token map maps service principal names to authentication tokens. The connection service will search the map for an appropriate token to use when connecting to a server.

See Also:
Constant Field Values

IDPROPAGATION_SSPI

static final java.lang.String IDPROPAGATION_SSPI
Name of SSPI ID propagation mechanism.

See Also:
getIDPropagation(), Constant Field Values

IDPROPAGATION_TRUSTED_PEER

static final java.lang.String IDPROPAGATION_TRUSTED_PEER
Name of Trusted Peer ID propagation mechanism.

See Also:
getIDPropagation(), Constant Field Values

INTERNAL_AUTH_DOMAIN

static final java.lang.String INTERNAL_AUTH_DOMAIN
The internal authentication domain that will be set on an identity if the resolved domain matches the internal authenticator domain from the server.

See Also:
Constant Field Values
Method Detail

setSessionContext

void setSessionContext(SessionContextInterface session)
                       throws java.rmi.RemoteException
Set the session context that this user context will use for logging, etc.

Parameters:
session - The session context.
Throws:
java.rmi.RemoteException - in the event of network failure.

getSessionContext

SessionContextInterface getSessionContext()
                                          throws java.rmi.RemoteException
Get the session context for this user.

Returns:
The session context.
Throws:
java.rmi.RemoteException - in the event of network failure.

getLogger

LoggerInterface getLogger()
                          throws java.rmi.RemoteException
Get the LoggerInterface for this user. This method is used by some of the classes contained by the UserContext.

Returns:
The LoggerInterface
Throws:
java.rmi.RemoteException - in the event of network problems.

getPersonFQID

java.lang.String getPersonFQID()
                               throws java.rmi.RemoteException
Get the FQID of the authenticated Identity. This may actually be a Person or an IdentityGroup, if group logins are enabled.

Returns:
The FQID of the authenticated user.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

getName

java.lang.String getName()
                         throws java.rmi.RemoteException
Get the name of this user. The name can be any String which represents the entity. This may be set by the application, or by a login module, if it can determine the name during the authentication process.

Returns:
The user name;
Throws:
java.rmi.RemoteException - in the event of network problems.

setName

void setName(java.lang.String name)
             throws java.rmi.RemoteException
Set the name of the user. The name can be any String which represents the user. It should be the name by which the user is commonly known.

Parameters:
name - The user name.
Throws:
java.rmi.RemoteException - in the event of network problems.

getDescription

java.lang.String getDescription()
                                throws java.rmi.RemoteException
Get the common description for this user. This should come from the repository that the user's global profile is defined in. As a fallback, it will get the description from the primary authentication repository (in case they're different).

Returns:
A String with a description of the user.
Throws:
java.rmi.RemoteException - in the event of remote object failure.

getKey

java.lang.String getKey()
                        throws java.rmi.RemoteException
Get the user key. This is probably a user ID, a UUID, or some other unique identitfier for this user. Since names aren't always unique, this is necessary to uniquely locate a user context from the user service.

Returns:
A unique identifier for this user.
Throws:
java.rmi.RemoteException - in the event of network problems.

setKey

void setKey(java.lang.String key)
            throws java.rmi.RemoteException
Set the user key. This should be unique within the context of the user service. If this isn't set, the name is used to store this user with the UserServices, which may cause conflicts. Setting this before adding to the UserService is strongly recommended.

Parameters:
key - The key that identifies this user.
Throws:
java.rmi.RemoteException - in the event of network problems.

getClientSource

java.lang.String getClientSource()
                                 throws java.rmi.RemoteException
Get the client location idetifier where the login request originated.

Returns:
The client identifier (usually a TCP/IP address) where the login request originated for this UserContext.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

setClientSource

void setClientSource(java.lang.String source)
                     throws java.rmi.RemoteException
Set the source location identifier for this UserContext.

Parameters:
source - The source location identifier (usually a TCP/IP address).
Throws:
java.rmi.RemoteException - In the event of remote object failure.

getAppSource

java.lang.String getAppSource()
                              throws java.rmi.RemoteException
Get the name of the application that initiated the login request for this UserContext.

Returns:
The application source identifier.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

setAppSource

void setAppSource(java.lang.String source)
                  throws java.rmi.RemoteException
Set the application source identifier that initiated the logon request for this UserContext.

Parameters:
source - The application source that requested the creation of the UserContext. This is usualy either the main Java class name, or an identifiable application name.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

getIDPropagation

java.lang.String getIDPropagation()
                                  throws ServiceException,
                                         java.rmi.RemoteException
If the UserContext was authenticated using an ID propagation mechanism such as SSPI, the name of the ID propagation mechanism is returned. Otherwise, null is returned

Returns:
the name of the ID propagation mechanism used to authenticate this UserContext, if any.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.
See Also:
IDPROPAGATION_SSPI, IDPROPAGATION_TRUSTED_PEER

addIdentity

void addIdentity(UserIdentityInterface identity)
                 throws java.rmi.RemoteException
Add an identity to the context. Identities are credential sets used to authenticate a user to a specific security domain. The UserService can be used to create a new identity, or to look up indentities that may be stored in a repository.

Parameters:
identity - The new identity for this user.
Throws:
java.rmi.RemoteException - in the event of network problems.

removeIdentity

void removeIdentity(UserIdentityInterface identity)
                    throws java.rmi.RemoteException
Remove an identity from the context.

Parameters:
identity - The identity to remove.
Throws:
java.rmi.RemoteException - In the event of network object failure.

getIdentities

java.util.List getIdentities()
                             throws java.rmi.RemoteException
Get an iterator of UserIdentityInterface objects that represent the currently available authentication identities for the user. If the current user (as set by a call to Subject.doAs() ) is different from the Subject in the local LoginContext, the user must have the CredentialPermission "readCredential" granted to perform this operation.

Returns:
An Iterator of UserIdentityInterface objects.
Throws:
java.rmi.RemoteException - in the event of network problems.

getIdentityByDomain

UserIdentityInterface getIdentityByDomain(java.lang.String domain)
                                          throws java.rmi.RemoteException
Get an authentication identity for the given domain. If the current user (as set by a call to Subject.doAs() ) is different from the Subject in the local LoginContext, the user must have the CredentialPermission "readCredential" granted to perform this operation.

Parameters:
domain - The domain for which to retrieve an identity.
Returns:
The user identity, or null if none is found.
Throws:
java.rmi.RemoteException - in the event of network problems.

getIdentityByDomain

UserIdentityInterface getIdentityByDomain(java.lang.String domain,
                                          boolean issueChallenge)
                                          throws java.rmi.RemoteException,
                                                 ServiceException
Get an identity by domain.

Parameters:
domain - The domain to search for in the identities.
issueChallenge - If true, the callback handler set in the User Service will be used to challenge the user to provide the requested credentials.
Returns:
An identity matching the domain requested.
Throws:
java.rmi.RemoteException - in the event of network problems.
ServiceException - if unable to obtain the identity by domain.

getIdentityByDomain

UserIdentityInterface getIdentityByDomain(java.lang.String domain,
                                          boolean issueChallenge,
                                          java.lang.String challengePrompt)
                                          throws java.rmi.RemoteException,
                                                 ServiceException
Get an identity by domain.

Parameters:
domain - The domain to search for in the identities.
issueChallenge - If true, the callback handler set in the User Service will be used to challenge the user to provide the requested credentials.
challengePrompt - A string to present to the user to get the desired credentials.
Returns:
An identity matching the domain requested.
Throws:
java.rmi.RemoteException - in the event of network problems.
ServiceException - if unable to obtain the identity by domain.

getIdentitiesByDomain

java.util.List getIdentitiesByDomain(java.lang.String domain,
                                     boolean issueChallenge,
                                     java.lang.String challengePrompt)
                                     throws java.rmi.RemoteException,
                                            ServiceException
This method returns a list of all the credential sets that are available for the requested domain.

Parameters:
domain - The Authentication Domain to get credentials for.
issueChallenge - If true, if the user currently doesn't have credentials for the requested authentication domain, a challenge is issued back to the user for them.
challengePrompt - A string to present to the user with the challenge.
Returns:
A List of UserIdentityInterface objects with the credential sets for the requested domain.
Throws:
java.rmi.RemoteException - if the event of remote object failure.
ServiceException - if a service error occurs.

addRepositoryGroup

void addRepositoryGroup(RepositoryGroup group)
                        throws ServiceException,
                               java.rmi.RemoteException
Add a repository group to this UserContext. A repository group is a list of names of repositories to use for a search. They need not all be the same type of repository. That is, you may have OMR repositories and DAV repositories in the same group, if it makes sense to search both for some types of data. The group must have a name (non-null, and one or more characters), and must be unique for the groups managed by this UserContext. To perform a search using a group, call InformationServiceInterface.searchGroupName(UserContextInterface, String, com.sas.services.information.FilterInterface), or InformationServiceInterface.searchGroupNameWithFilterArray(UserContextInterface, String, com.sas.services.information.FilterInterface[]).

Parameters:
group - The repository group to add.
Throws:
ServiceException - If the group name is null, or if a group with the same name already exists in the UserContext.
java.rmi.RemoteException - In the event of remote object failure.

removeRepositoryGroup

void removeRepositoryGroup(RepositoryGroup group)
                           throws ServiceException,
                                  java.rmi.RemoteException
Remove a repository group from this UserContext.

Parameters:
group - The Group to remove.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getRepositoryGroup

RepositoryGroup getRepositoryGroup(java.lang.String name)
                                   throws ServiceException,
                                          java.rmi.RemoteException
Get a repository group from this UserContext. To perform a search using the returned group, call InformationServiceInterface.searchGroup(UserContextInterface, com.sas.services.information.RepositoryGroup, com.sas.services.information.FilterInterface), or InformationServiceInterface.searchGroupWithFilterArray(UserContextInterface, com.sas.services.information.RepositoryGroup, com.sas.services.information.FilterInterface[]).

Parameters:
name - The name of the group to return.
Returns:
The repository group specfied by name, or null if one by that name doesn't exist.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getProfile

ProfileInterface getProfile()
                            throws java.rmi.RemoteException
Get the user's profile set.

Returns:
a ProfileInterface for the user's profile instance.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

addRepository

void addRepository(java.lang.Object repository)
                   throws java.rmi.RemoteException
Add a repository to this user context.

Parameters:
repository - A connected repository that uses an identity for this user
Throws:
java.rmi.RemoteException - In the event of a remote failure.

removeRepository

void removeRepository(java.lang.Object repository)
                      throws java.rmi.RemoteException
Remove a repository from this context.

Parameters:
repository - The repository to remove from this context.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

getRepository

RepositoryInterface getRepository(java.lang.String name)
                                  throws ServiceException,
                                         java.rmi.RemoteException
Get a repository based on the name. In order for this to work, the name has to be defined in the Information Service as a ReposDef. If it's not, or if the user isn't connected to the requested repository, this will return null.

Parameters:
name - The name of the repository to return the handle to.
Returns:
The repository handle for the named repository, or null.
Throws:
ServiceException - in the event of a service failure.
java.rmi.RemoteException - in the event of a network failure.

getAuthRepository

RepositoryInterface getAuthRepository()
                                      throws ServiceException,
                                             java.rmi.RemoteException
Deprecated. Use getAuthServer instead.

Get a handle to the repository the user authenticated against. It's possible for a configuration to authenticate against multiple services. This will return the first server that was used to authenticate the user.

Returns:
The RepositoryInterface used for authentication.
Throws:
ServiceException - in the event of a service failure.
java.rmi.RemoteException - in the event of a network failure.

getAuthRepositoryName

java.lang.String getAuthRepositoryName()
                                       throws ServiceException,
                                              java.rmi.RemoteException
Deprecated. Use getAuthServerName instead.

Get the Information Service configured name of the repository that was used for authentication. It's possible for a configuration to authenticate against multiple services. This will return the first server that was used to authenticate the user.

Returns:
The name of the repository that was used for authentication.
Throws:
ServiceException - in the event of a service failure.
java.rmi.RemoteException - in the event of a network failure.

getAuthServer

ServerInterface getAuthServer()
                              throws ServiceException,
                                     java.rmi.RemoteException
Get a handle to the metadata server the user authenticated against.

Returns:
The ServerInterface that the user authenticated against.
Throws:
ServiceException - If a server error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getAuthServerName

java.lang.String getAuthServerName()
                                   throws ServiceException,
                                          java.rmi.RemoteException
Get the definition name of the server the user authenticated against.

Returns:
The Information Service configured Server definition name of the server that the user authenticated against.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getRepositories

java.util.List getRepositories()
                               throws java.rmi.RemoteException
Get a List of the repositories this user is connected to.

Returns:
The connected repositories
Throws:
java.rmi.RemoteException - In the event of a remote failure.

getServers

java.util.List getServers()
                          throws java.rmi.RemoteException
Get a List of the servers this user is connected to.

Returns:
A List of ServerInterface objects this user has connections to.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

addServer

void addServer(ServerInterface server)
               throws ServiceException,
                      java.rmi.RemoteException
Add a server to the list that this user is connected to.

Parameters:
server - A server to which this user has an active connection.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

removeServer

void removeServer(ServerInterface server)
                  throws ServiceException,
                         java.rmi.RemoteException
Remove a server from the list that this user is currently connected to.

Parameters:
server - The server to remove from the active list.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getServer

ServerInterface getServer(java.lang.String name)
                          throws ServiceException,
                                 java.rmi.RemoteException
Get a specific named Information Service server from this user.

Parameters:
name - The configured name of the server to get from the connected list.
Returns:
The ServerInterface with the requested name, or null if it's not connected.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getPrincipals

java.util.Set getPrincipals()
                            throws java.rmi.RemoteException
Gets the set of principals.

Returns:
Set containing principals.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

getPublicCredentials

java.util.Set getPublicCredentials()
                                   throws java.rmi.RemoteException
Gets the set of public credentials.

Returns:
Set containing public credentials.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

getPrivateCredentials

java.util.Set getPrivateCredentials()
                                    throws java.rmi.RemoteException
Gets the set of private credentials.

Returns:
Set containing private credentials.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

getLoginCallback

LoginCallbackHandler getLoginCallback()
                                      throws java.rmi.RemoteException
Get the callback handler. This is used by the Authenticator class to set information needed by the login modules to perform the authenticaton.

Returns:
Login callback handler.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

authenticate

boolean authenticate()
                     throws java.rmi.RemoteException
Authenticate a user based on their current OS identity.

Returns:
true if the authentication was successful, false otherwise.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

authenticate

boolean authenticate(UserIdentityInterface ident,
                     java.util.Map options)
                     throws java.rmi.RemoteException
Authenticates a user identity.

Parameters:
ident - The identity to authenticate.
options - Additional options for the authentication process (this may include a host and port for an authentication server and other information).
Returns:
true if the authentication was successful, false otherwise.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

destroy

void destroy()
             throws java.rmi.RemoteException
Destroy the user context. Release all resources in use.

Throws:
java.rmi.RemoteException - In the event of a remote failure.

addException

void addException(java.lang.Exception exception)
                  throws java.rmi.RemoteException
Add an exception to the list.

Parameters:
exception - Exception to be added to the list.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

clearExceptions

void clearExceptions()
                     throws java.rmi.RemoteException
Clear the exception list.

Throws:
java.rmi.RemoteException - In the event of a remote failure.

getExceptions

java.lang.Exception[] getExceptions()
                                    throws java.rmi.RemoteException
Get an array of exceptions that have occurred since the last time they were cleared.

Returns:
an array of Exceptions, or null if there have been none.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

setChallengeCallbackHandler

void setChallengeCallbackHandler(RemoteCallbackHandler handler)
                                 throws java.rmi.RemoteException
Set the object that will be used to handle credential challenge callbacks.

Parameters:
handler - The credential callback handler. This object will have to be an implementation of the javax.security.auth.callback.CallbackHandler interface.
Throws:
java.rmi.RemoteException - In the event of a remote failure.

getChallengeCallbackHandler

RemoteCallbackHandler getChallengeCallbackHandler()
                                                  throws java.rmi.RemoteException
Get the object that will handle credential challenge callbacks.

Returns:
The callback handler
Throws:
java.rmi.RemoteException - In the event of a remote failure.

getPerson

IdentityInterface getPerson()
                            throws java.rmi.RemoteException
Return the IdentityInterface object that represents this user. This is the metadata object that the metadata server has determined represents the authenticated user. It may a PersonInterface or an IdentityGroupInterface object, if group logins are enabled in the UserService.

Returns:
An IdentityInterface representing this user, or null if the authenticated user has no metadata presence (a public user).
Throws:
java.rmi.RemoteException - in the event of remote object failure.

setPerson

void setPerson(IdentityInterface identity)
               throws java.rmi.RemoteException,
                      java.lang.IllegalStateException
This method gets called by UserService as part of the UserContext initialization. Client code should not call this method.

Parameters:
identity - The Person object that represents the user.
Throws:
java.rmi.RemoteException - In the event of remote object failure.
java.lang.IllegalStateException - If the identity object has already been set.

getUniqueId

java.lang.String getUniqueId()
                             throws java.rmi.RemoteException
Returns a unique identifier for this object.

Returns:
A String with a unique identifier. This is a per-instance identifier.
Throws:
java.rmi.RemoteException - in the event of remote object failure.

isDestroyed

boolean isDestroyed()
                    throws java.rmi.RemoteException
Return true if this User Context has been destroyed, or is in the process of being destroyed.

Returns:
true if this context has been destroyed.
Throws:
java.rmi.RemoteException - in the event of remote object failure.

getLoginTime

long getLoginTime()
                  throws java.rmi.RemoteException
Get the timestamp when the user was authenticated.

Returns:
A long representing the login date/time.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

getSharedResource

java.lang.Object getSharedResource(java.lang.String key)
                                   throws java.rmi.RemoteException
Get an object from the shared resource map. Shared resources are generally used between repository instances, but can be shared among other objects as well.

Parameters:
key - The key to the object in the resource map.
Returns:
The resource object, or null if nothing was found for the given key.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

putSharedResource

java.lang.Object putSharedResource(java.lang.String key,
                                   java.lang.Object value)
                                   throws java.rmi.RemoteException
Put an object into the shared resource map. This will make the object potentially available to other objects managed by the UserContext for sharing.

Parameters:
key - The lookup key for the resource.
value - The resource object to store.
Returns:
The old value at the resource key, or null if it's a new key.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

toByteArray

byte[] toByteArray()
                   throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

addLogChangeListener

void addLogChangeListener(LogChangeListener listener)
                          throws java.rmi.RemoteException
Receive a notification when the UserContext's logger is changed. This normally only happens when the session context is set on this user context. The main purpose for this notification is so that repositories can use the session logger for all of their output, which can include the session and user context information in the layout.

Parameters:
listener - An object that wishes to receive notification when the user context log changes.
Throws:
java.rmi.RemoteException - In the event of remote object failure.

isInRole

boolean isInRole(java.lang.String role)
                 throws ServiceException,
                        java.rmi.RemoteException
Check whether the user is a member of a given role.

Parameters:
role - The role name to check for.
Returns:
True if the user is a member of the role. False otherwise.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

isInAnyRole

boolean isInAnyRole(java.util.List roleList)
                    throws ServiceException,
                           java.rmi.RemoteException
Check whether the user is a member of any of the roles in the list.

Parameters:
roleList - A List of Strings representing role names.
Returns:
True if the user is a member of any roles in the list. False otherwise.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getRoles

java.util.List getRoles()
                        throws ServiceException,
                               java.rmi.RemoteException
Get a List of the roles this user is a member of.

Returns:
A List of Strings representing the role names this user is a member of.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

hasCapability

boolean hasCapability(java.lang.String appName,
                      java.lang.String action)
                      throws ServiceException,
                             java.rmi.RemoteException
Check whether this user has the capability to perform a specific action for a particular application.

Parameters:
appName - The SoftwareComponent name associated with the application.
action - The action to perform.
Returns:
True if the user has permission to perform the action; otherwise, false.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getActions

java.util.List getActions(java.lang.String appName)
                          throws ServiceException,
                                 java.rmi.RemoteException
Get a List of actions associated with an application that this user can perform.

Parameters:
appName - The SoftwareComponent name associated with the application.
Returns:
A List of ApplicationAuthorizations representing the actions.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.
See Also:
com.sas.services.security.ApplicationAuthorization()

getActions

java.util.List getActions(java.lang.String appName,
                          boolean onlyGrantedActions)
                          throws ServiceException,
                                 java.rmi.RemoteException
Get a List of actions associated with an application.

Parameters:
appName - The SoftwareComponent name associated with the application.
onlyGrantedActions - If true then return only the actions that are granted to this user; otherwise, return all actions.
Returns:
A List of ApplicationAuthorizations representing the actions.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.
See Also:
com.sas.services.security.ApplicationAuthorization()

isInGroup

boolean isInGroup(java.lang.String group)
                  throws ServiceException,
                         java.rmi.RemoteException
Check whether the user is a member of a given group.

Parameters:
group - The group name to check for.
Returns:
True if the user is a member of the group. False otherwise.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

isInAnyGroup

boolean isInAnyGroup(java.util.List groupList)
                     throws ServiceException,
                            java.rmi.RemoteException
Check whether the user is a member of any of the groups in the list.

Parameters:
groupList - A List of Strings representing group names.
Returns:
True if the user is a member of any groups in the list. False otherwise.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getGroups

java.util.List getGroups()
                         throws ServiceException,
                                java.rmi.RemoteException
Get a List of the groups this user is a member of.

Returns:
A List of Strings representing the group names this user is a member of.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

refreshRepositoryData

void refreshRepositoryData()
                           throws ServiceException,
                                  java.rmi.RemoteException
Refresh all of the data that's been retrieved using the Information Service during the life of this UserContext. This is potentially a very expensive operation, so use it with care.

Throws:
ServiceException - If an exception occurs during the refresh operation.
java.rmi.RemoteException - In the event of remote object failure.

getResolvedUserId

java.lang.String getResolvedUserId()
                                   throws ServiceException,
                                          java.rmi.RemoteException
Return the metadata server resolved user id.

Returns:
the user id as resolved by the metadata server. This is a domain-qualified user id (e.g., user@DefaultAuth).
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

isInternalUser

boolean isInternalUser()
                       throws ServiceException,
                              java.rmi.RemoteException
Return a boolean indicating if this user was created using an internal userid.

Returns:
true if the user was created using an internal userid, false otherwise.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getLocale

java.util.Locale getLocale()
                           throws ServiceException,
                                  java.rmi.RemoteException
Get the locale for this user. If it has been set explicitly, return that value. If the user has a profile, return the profile setting. If there's no other locale available, return the JVM default.

Returns:
The user's current locale setting.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

setLocale

void setLocale(java.util.Locale locale)
               throws ServiceException,
                      java.rmi.RemoteException
Set the locale to use for this user session.

Parameters:
locale - The preferred locale for this user for the live of this session.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

enableLocalAdminMode

void enableLocalAdminMode(java.lang.String authDomain)
                          throws ServiceException,
                                 java.rmi.RemoteException
This sets up a special case where an administrative user with an internal account is used to authenticate a user. Since the internal account cannot be used to authenticate against other resources like a workspace server, this creates a problem because the UserContext won't go get other credentials in the primary authentication domain. This overrides that behavior and makes the primary credential "sticky", so it won't really be removed if requested.

Parameters:
authDomain - The domain to retrieve all credentials for. This overrides my default behavior of not getting any more credentials for the primary authentication domain.
Throws:
ServiceException - If a metadata or service-level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

***  This interface provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.