uk.ac.vamsas.client
Interface IClientFactory

All Known Implementing Classes:
SimpleClientFactory

public interface IClientFactory

Defines methods for instantiating Vorba client application agents

Author:
jimp (it's VORBA, not CORBA!)

Method Summary
 java.lang.String[] getCurrentSessions()
          enumerate the active sessions this IClientFactory instance knows about.
 IClient getIClient(ClientHandle applicationHandle)
          Create a new Vorba Session
 IClient getIClient(ClientHandle applicationHandle, java.lang.String sessionUrn)
          returns new Vorba for a given session.
 IClient getIClient(ClientHandle applicationHandle, UserHandle userId)
          New session for application and specific user
 IClient getIClient(ClientHandle applicationHandle, UserHandle userId, java.lang.String sessionUrn)
          returns new vorba for a given session acting as a particular identity
 IClient getNewSessionIClient(ClientHandle applicationHandle)
          Create a new sesssion for the application with the current user
 IClient getNewSessionIClient(ClientHandle applicationHandle, UserHandle userId)
          Create a new session for the application using a particular user identity
 IClient openAsNewSessionIClient(ClientHandle applicationHandle, java.io.File vamsasDocument)
          Create a new session and import an existing vamsas document into it.
 IClient openAsNewSessionIClient(ClientHandle applicationHandle, UserHandle userId, java.io.File vamsasDocument)
          Create a new session as a particular user and import an existing vamsas document into it.
 

Method Detail

getIClient

public IClient getIClient(ClientHandle applicationHandle)
                   throws NoDefaultSessionException
Create a new Vorba Session

Parameters:
applicationHandle - is the application's VAMSAS handle string
Throws:
NoDefaultSessionException - if more than one session exists that the client may connect to

getIClient

public IClient getIClient(ClientHandle applicationHandle,
                          java.lang.String sessionUrn)
returns new Vorba for a given session.

Parameters:
applicationHandle -
sessionUrn - session to connect to (or null to create a new session)
Returns:

getIClient

public IClient getIClient(ClientHandle applicationHandle,
                          UserHandle userId,
                          java.lang.String sessionUrn)
returns new vorba for a given session acting as a particular identity

Parameters:
applicationHandle -
userId -
sessionUrn - session to connect to (or null to create a new session)
Returns:

getIClient

public IClient getIClient(ClientHandle applicationHandle,
                          UserHandle userId)
                   throws NoDefaultSessionException
New session for application and specific user

Parameters:
applicationHandle -
userId -
Returns:
Throws:
NoDefaultSessionException - if more than one session exists that the client may connect to

getNewSessionIClient

public IClient getNewSessionIClient(ClientHandle applicationHandle)
Create a new sesssion for the application with the current user

Parameters:
applicationHandle -
Returns:

getNewSessionIClient

public IClient getNewSessionIClient(ClientHandle applicationHandle,
                                    UserHandle userId)
Create a new session for the application using a particular user identity

Parameters:
applicationHandle -
userId -
Returns:

openAsNewSessionIClient

public IClient openAsNewSessionIClient(ClientHandle applicationHandle,
                                       java.io.File vamsasDocument)
                                throws InvalidSessionDocumentException
Create a new session and import an existing vamsas document into it.

Parameters:
applicationHandle -
vamsasDocument -
Returns:
Throws:
InvalidSessionDocumentException

openAsNewSessionIClient

public IClient openAsNewSessionIClient(ClientHandle applicationHandle,
                                       UserHandle userId,
                                       java.io.File vamsasDocument)
                                throws InvalidSessionDocumentException
Create a new session as a particular user and import an existing vamsas document into it.

Parameters:
applicationHandle -
userId -
vamsasDocument -
Returns:
Throws:
InvalidSessionDocumentException

getCurrentSessions

public java.lang.String[] getCurrentSessions()
enumerate the active sessions this IClientFactory instance knows about. Can be used by caller to pick a session on catching a NoDefaultSessionException. LATER: Define interface for discovering more information about a session (so it can be presented to a user in a meaningful way)

Returns:
possibly empty array of sessionUrn strings