login |
public Session login(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException(Code) |
| Authenticates the user using the supplied credentials . If workspaceName is
recognized as the name of an existing workspace in the repository and
authorization to access that workspace is granted, then a new Session object is returned.
The format of the string workspaceName depends upon the implementation.
If credentials is null , it is assumed that authentication is handled by a
mechanism external to the repository itself (for example, through the JAAS framework) and that the
repository implementation exists within a context (for example, an application server) that allows
it to handle authorization of the request for access to the specified workspace.
If workspaceName is null , a default workspace is automatically selected by
the repository implementation. This may, for example, be the "home workspace" of the user whose
credentials were passed, though this is entirely up to the configuration and implementation of the
repository. Alternatively, it may be a "null workspace" that serves only to provide the method
Workspace.getAccessibleWorkspaceNames , allowing the client to select from among available "real"
workspaces.
If authentication or authorization for the specified workspace fails, a LoginException is
thrown.
If workspaceName is not recognized, a NoSuchWorkspaceException is thrown.
Parameters: credentials - The credentials of the user Parameters: workspaceName - the name of a workspace. a valid session for the user to access the repository. throws: LoginException - If the login fails. throws: NoSuchWorkspaceException - If the specified workspaceName is not recognized. throws: RepositoryException - if another error occurs. |