|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.vamsas.client.simpleclient.SimpleClient
Field Summary | |
protected VamsasSession |
_session
|
protected ClientDocument |
cdocument
|
protected ClientHandle |
client
|
protected EventGeneratorThread |
evgen
|
protected java.util.Hashtable |
extantobjects
object hash table that persists in each client holding vorbaIds and hash values after a document write |
protected SessionUrn |
session
|
protected UserHandle |
user
|
Constructor Summary | |
protected |
SimpleClient(UserHandle user,
ClientHandle client,
VamsasSession sess)
construct SimpleClient for user, client and VamsasSession directory use the SimpleClientFactory rather than this constructor directly. |
Method Summary | |
void |
addDocumentUpdateHandler(java.beans.PropertyChangeListener evt)
register handler for updates for the current session |
void |
addVorbaEventHandler(java.lang.String EventChain,
java.beans.PropertyChangeListener evt)
Add a listener to a particular event chain. |
protected void |
createActiveClientFile()
|
void |
finalizeClient()
Method called by client application on exit. |
protected VamsasSession |
get_session()
retrieves the current VamsasSession to which belong the client |
java.lang.String |
getAbout()
construct new SimpleClientsession by importing objects from an existing vamsas document |
IClientDocument |
getClientDocument()
get vamsas document with user and app specific data IClientDocuments are not thread-safe. |
ClientHandle |
getClientHandle()
Included for applications with several ClientHandle identities. |
protected Lock |
getClientLock()
|
protected java.io.File |
getClientlockFile()
|
IPickManager |
getPickManager()
get the Vamsas Pick Manager for registering pick handlers and sending messages for the current session. |
protected Entry |
getProvenanceEntry(java.lang.String action)
construct a provenance entry for this client with the specified action string. |
protected java.lang.String |
getProvenanceUser()
|
SessionHandle |
getSessionHandle()
Returns a valid URN for other applications to connect to the vamsas session. |
java.lang.String |
getSessionUrn()
convenience method to get the SessionUrn as a string (for passing directly to a text box...). |
SimpleClientConfig |
getSimpleClientConfig()
|
IObjectUpdate |
getUpdateHandler(java.lang.Class rootObject)
|
IObjectUpdate[] |
getUpdateHandlers()
|
UserHandle |
getUserHandle()
|
void |
importDocument(java.io.File location)
Any application may call importDocument to merge a stored vamsasDocument into the current session. |
void |
joinSession()
Client application calls this after any pre-session initialization (registering of Handlers, etc) Exceptions are raised for any failures. |
void |
pollUpdate()
client application calls this to force the Vorba client to check for updates immediately. |
protected void |
releaseActiveClientFile()
|
void |
removeUpdateHandler(java.lang.Class rootObject)
|
void |
setUpdateHandler(IObjectUpdate handler)
Sets the update handler that will be called when any updates occur to objects of type rootObject. |
void |
storeDocument(java.io.File location)
Any application may call storeDocument to save a local copy of the current vamsas document including all application specific entries. |
protected void |
tidyAwaySessionDocumentState()
garbage collect the ClientDocument instance and re-enable watchers. |
void |
updateDocument(IClientDocument newdoc)
Queue new Vorba objects for storage and propagation to other clients (via Event.DOCUMENT_UPDATE based notification of document change) New objects without provenance information will be given a default entry using the IClient's application, user (and session) handles Validity of IClientDocument object instances after this call is implementation dependent TODO: consider refactoring to remove the redundant IClientDocument parameter for this method |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected UserHandle user
protected SessionUrn session
protected VamsasSession _session
protected ClientHandle client
protected EventGeneratorThread evgen
protected ClientDocument cdocument
protected java.util.Hashtable extantobjects
Constructor Detail |
protected SimpleClient(UserHandle user, ClientHandle client, VamsasSession sess) throws InvalidSessionUrnException
user
- client
- sess
- Method Detail |
public java.lang.String getAbout()
getAbout
in interface IClient
java.lang.Exception
- IOExceptions for Session IO problems, and general Exception if
importing document is invalid. protected SimpleClient(UserHandle
user, ClientHandle client, VamsasSession sess, File
importingArchive) throws Exception { this(user, client, sess); if
(log.isDebugEnabled()) {
log.debug("Attempting to overwrite session document with file: "
+importingArchive); } // TODO: write provenance entry for new
session indicating the import.
}public java.lang.String getSessionUrn()
IClient
getSessionUrn
in interface IClient
public SessionHandle getSessionHandle()
IClient
getSessionHandle
in interface IClient
public ClientHandle getClientHandle()
IClient
getClientHandle
in interface IClient
public UserHandle getUserHandle()
getUserHandle
in interface IClient
protected java.lang.String getProvenanceUser()
protected Entry getProvenanceEntry(java.lang.String action)
action
-
public void addDocumentUpdateHandler(java.beans.PropertyChangeListener evt)
IClient
addDocumentUpdateHandler
in interface IClient
public void finalizeClient()
IClient
finalizeClient
in interface IClient
public IClientDocument getClientDocument() throws java.io.IOException
IClient
getClientDocument
in interface IClient
java.io.IOException
- if lock is not obtainable for the document in the sessionpublic void updateDocument(IClientDocument newdoc)
IClient
updateDocument
in interface IClient
protected void tidyAwaySessionDocumentState()
public void storeDocument(java.io.File location)
IClient
storeDocument
in interface IClient
location
- to write zip filepublic void addVorbaEventHandler(java.lang.String EventChain, java.beans.PropertyChangeListener evt)
IClient
addVorbaEventHandler
in interface IClient
EventChain
- Name of event. Blank/null registers handler for all events.evt
- - event handler function.public void pollUpdate()
IClient
pollUpdate
in interface IClient
public void joinSession() throws java.lang.Exception
IClient
joinSession
in interface IClient
java.lang.Exception
public void importDocument(java.io.File location)
IClient
importDocument
in interface IClient
location
- public IObjectUpdate getUpdateHandler(java.lang.Class rootObject)
getUpdateHandler
in interface IClient
public IObjectUpdate[] getUpdateHandlers()
getUpdateHandlers
in interface IClient
public void removeUpdateHandler(java.lang.Class rootObject)
removeUpdateHandler
in interface IClient
public void setUpdateHandler(IObjectUpdate handler)
IClient
setUpdateHandler
in interface IClient
handler
- protected VamsasSession get_session()
public IPickManager getPickManager()
IClient
getPickManager
in interface IClient
protected void releaseActiveClientFile() throws java.io.IOException
java.io.IOException
protected void createActiveClientFile() throws java.io.IOException
java.io.IOException
protected java.io.File getClientlockFile()
protected Lock getClientLock()
public SimpleClientConfig getSimpleClientConfig()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |