com.ibm.workplace.wcm.api
Interface Repository


public interface Repository

The entry point into the WCM repository.

This interface provides methods for obtaining a Workspace. A Workspace represents a view of the repository for the specified user.


Method Summary
 void endWorkspace()
          Performs a logout from the currently associated Workspace and unregisters the current thread from its session.
 com.ibm.workplace.wcm.api.Workspace getAnonymousWorkspace()
          Returns a Workspace object representing a view of the repository for the Anonymous user.
 com.ibm.workplace.wcm.api.Workspace getSystemWorkspace()
          Returns a Workspace object representing a sytem view of the repository.
 com.ibm.workplace.wcm.api.Workspace getWorkspace(java.security.Principal principal)
          Returns a Workspace object representing a view of the repository for the specified Principal.
 com.ibm.workplace.wcm.api.Workspace getWorkspace(java.lang.String username, java.lang.String password)
          Returns a Workspace object that represents a view of the repository for a user with the specified credentials.
 

Method Detail

getWorkspace

public com.ibm.workplace.wcm.api.Workspace getWorkspace(java.lang.String username,
                                                        java.lang.String password)
                                                 throws ServiceNotAvailableException,
                                                        OperationFailedException
Returns a Workspace object that represents a view of the repository for a user with the specified credentials.

Parameters:
username - the username of the user to get a Workspace for
password - the user's password
Returns:
a Workspace for the specified user; returns an Anonymous Workspace if the user could not be authenticated.
Throws:
ServiceNotAvailableException - if the WCM service is not available
OperationFailedException - if a Workspace could not be created for this user
java.lang.NullPointerException - if either of the arguments to this method is null

getAnonymousWorkspace

public com.ibm.workplace.wcm.api.Workspace getAnonymousWorkspace()
                                                          throws ServiceNotAvailableException,
                                                                 OperationFailedException
Returns a Workspace object representing a view of the repository for the Anonymous user.

Returns:
Workspace for the Anonymous user
Throws:
ServiceNotAvailableException - if the WCM service is not available
OperationFailedException - if a workspace could not be created for this user

getWorkspace

public com.ibm.workplace.wcm.api.Workspace getWorkspace(java.security.Principal principal)
                                                 throws ServiceNotAvailableException,
                                                        OperationFailedException
Returns a Workspace object representing a view of the repository for the specified Principal.

Parameters:
principal - The java.security.Principal to retrieve a Workspace for.
Returns:
Workspace for the specified Principal
Throws:
ServiceNotAvailableException - if the WCM service is not available
OperationFailedException - if a workspace could not be created for the specified Principal
java.lang.NullPointerException - if the argument to this method is null

getSystemWorkspace

public com.ibm.workplace.wcm.api.Workspace getSystemWorkspace()
                                                       throws ServiceNotAvailableException,
                                                              OperationFailedException
Returns a Workspace object representing a sytem view of the repository.

Throws:
ServiceNotAvailableException - if the WCM service is not available
OperationFailedException - if a workspace could not be created for the specified Principal
java.lang.NullPointerException - if the argument to this method is null

endWorkspace

public void endWorkspace()
Performs a logout from the currently associated Workspace and unregisters the current thread from its session. N.B. You don't need to call endWorkspace() when using a JSP component as rendering and session management is handled by Web Content Management.