Oracle® Collaboration Suite Workspaces API Reference
10g Release 1 (10.1.2)

B25479-01


oracle.workspaces
Class CwService

java.lang.Object
  extended byoracle.workspaces.CwService


public class CwService
extends java.lang.Object

Singleton class which represents the entry point for all Collaborative Workspaces operations. To use the Collaborative Workspaces API, first call CwService.init().


Constructor Summary
CwService()

Method Summary
void closeSession(CwSession session)
Close the session for a user to release all the resource-related stuffs in the session.
static void destroy()
Tear down the CwService and its internal references.
CwIdentity getIdentityById(java.lang.String id)
Get the CwIdentity by id
static CwService getInstance()
Returns the singleton instance of this class.
CwUser getUserByDn(java.lang.String szUserDn)
Return the user based on its distinguished name (DN).
CwUser getUserByEmail(java.lang.String szEmail)
Return the user based on its email.
CwUser getUserByName(java.lang.String szUserName)
Return the user based on its name.
CwUser getUserByNickname(java.lang.String szUserNickname)
Return the user based on its name.
static void init()
Initialize the CwService.
static void initResourceManagers()
Initialize the CwService with just the CW Managers.
static void initWorkspaceManagers()
Initialize the CwService with just the CW Managers.
CwSession openSession(CwUser user)
open a session for the give user with default locale
CwSession openSession(CwUser user, java.util.Locale locale)
Return a new session for a user.
void verifyInitialized(CwResourceType rsrcType)
Given a resource type, verify if it has been properly initialized

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CwService

public CwService()

Method Detail

closeSession

public void closeSession(CwSession session)
                  throws CwException
Close the session for a user to release all the resource-related stuffs in the session.
Throws:
CwException

destroy

public static void destroy()
                    throws CwException
Tear down the CwService and its internal references. This method should be called upon application shutdown.
Throws:
CwException

getIdentityById

public CwIdentity getIdentityById(java.lang.String id)
                           throws CwException
Get the CwIdentity by id
Parameters:
id - the ID of the user/group
Returns:
the requested user/group. It must be non-null.
Throws:
the - requested user/group does not exist.
CwException

getInstance

public static CwService getInstance()
                             throws CwException
Returns the singleton instance of this class.
Throws:
CwException

getUserByDn

public CwUser getUserByDn(java.lang.String szUserDn)
                   throws CwException
Return the user based on its distinguished name (DN). The name should be the same as what oracle.workspaces.authentication.CwUser#getDN returns.
Returns:
the user based on its DN.
Throws:
CwException - requested user does not exist.

getUserByEmail

public CwUser getUserByEmail(java.lang.String szEmail)
                      throws CwException
Return the user based on its email. We assume that the user email is unique in OID. The email should be the same as what oracle.workspaces.authentication.CwUser#getEmailAddress returns.
Returns:
the user based on its email.
Throws:
CwException - requested user does not exist.

getUserByName

public CwUser getUserByName(java.lang.String szUserName)
                     throws CwException
Return the user based on its name. We assume that the user name is unique in OID. The name should be the same as what oracle.workspaces.authentication.CwUser#getName returns. We can not get the group based on its name since group name is not unipue in OID.
Parameters:
szUserName - the name of the user
Returns:
the user based on its name.
Throws:
CwException - requested user does not exist.

getUserByNickname

public CwUser getUserByNickname(java.lang.String szUserNickname)
                         throws CwException
Return the user based on its name. We assume that the user name is unique in OID. The name should be the same as what oracle.workspaces.authentication.CwUser#getNickname returns. We can not get the group based on its name since group name is not unipue in OID.
Parameters:
szUserNickname - the nickname of the user
Returns:
the user based on its name.
Throws:
CwException - requested user does not exist.

init

public static void init()
                 throws CwException
Initialize the CwService. NOTE: This method MUST be called before calling getInstance() or performing any other Collaborative Workspaces operations. To initialize the Workpsaces server, either the init() method can be called or the initWorkpaceManagers(0 followed by the initResourceManagers() method can called in that order. These two paths are equivalent and have been provided only to allow the calling application to initialize the workspace managers and the resource managers at different execution points.
Throws:
CwException

initResourceManagers

public static void initResourceManagers()
                                 throws CwException
Initialize the CwService with just the CW Managers. NOTE: This method MUST be called before calling getInstance() or performing any other Collaborative Workspaces operations. This method just initializes all the Resource managers. This method cannot be called before the init() or the initWorkspaceManagers() method has been invoked.
Throws:
CwException

initWorkspaceManagers

public static void initWorkspaceManagers()
                                  throws CwException
Initialize the CwService with just the CW Managers. NOTE: This method MUST be called before calling getInstance() or performing any other Collaborative Workspaces operations. This method just initializes all the Workspace managers but NOT the resource managers. The initResourceManagers method has to be called before any resource specific APIs can be used. The two initialization methods have been split to allow them to be called separately at different points in the execution (for instance, invoke the initWorkspaceManagers at system startup and initialize the resource managers at the first request).
Throws:
CwException

openSession

public CwSession openSession(CwUser user)
                      throws CwException
open a session for the give user with default locale
Parameters:
user - the user object for which session needs to be created
Returns:
the CwSession for the user
Throws:
CwException
See Also:
openSession(CwUser user, Locale locale)

openSession

public CwSession openSession(CwUser user,
                             java.util.Locale locale)
                      throws CwException
Return a new session for a user. The caller needs to make sure not to call this method more than once for a user in a session. Otherwise, a new session is returned. Currently, there is no authentication is done for this user since we rely on the SSO to do the authentication. Later on, when we expose the Workspace to other non-web based client, the authentication could be done here.
Returns:
a new session for the user
Throws:
CwException - if user is a deleted user

verifyInitialized

public void verifyInitialized(CwResourceType rsrcType)
                       throws CwException
Given a resource type, verify if it has been properly initialized
Throws:
CwException - if not properly initialized

Copyright © 2001, 2005, Oracle. All rights reserved.