|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectomero.client
public class client
Central client-side blitz entry point. This class uses solely Ice
functionality to provide access to blitz (as opposed to also using Spring)
and should be in sync with the OmeroPy omero.client class as well as the
OmeroCpp omero::client class.
In order to more closely map the destructors in Python and C++, this class
keeps a collection
of client
instances, which
are destroyed on program termination.
Typical usage:
omero.client client = new omero.client(); // Uses ICE_CONFIG
omero.client client = new omero.client(host); // Defines "omero.host"
omero.client client = new omero.client(host, port); // Defines "omero.host" and "omero.port"
More more information, see
https://trac.openmicroscopy.org.uk/omero/wiki/ClientDesign
Constructor Summary | |
---|---|
client()
Calls client(Ice.InitializationData) with a new
InitializationData |
|
client(File... files)
Creates an Communicator from multiple files. |
|
client(Ice.InitializationData id)
Creates an Communicator from a InitializationData
instance. |
|
client(Map p)
Creates an Communicator from a Map instance. |
|
client(String host)
Creates an Communicator pointing at the given server using
the #DEFAULT_PORT . |
|
client(String[] args)
Calls client(String[], Ice.InitializationData) with a new
InitializationData |
|
client(String[] args,
Ice.InitializationData id)
Creates an Communicator from command-line arguments. |
|
client(String host,
int port)
Creates an Communicator pointing at the given server with the
non-standard port. |
Method Summary | |
---|---|
protected void |
__del__()
Calls closeSession() and ignores any exceptions. |
void |
closeSession()
Closes the session and nulls out the communicator. |
omero.api.ServiceFactoryPrx |
createSession()
Calls createSession(String, String) with null values |
omero.api.ServiceFactoryPrx |
createSession(String username,
String password)
Performs the actual logic of logging in, which is done via the #getRouter() . |
void |
enableKeepAlive(int seconds)
Resets the "omero.keep_alive" property on the current Communicator which is used on initialization to determine the
time-period between checks . |
protected omero.api.ISessionPrx |
env()
Helper method to access session environment |
protected static String |
filesToString(File... files)
|
Ice.Communicator |
getCommunicator()
Returns the Communicator for this instance or throws an
exception if null. |
Ice.ImplicitContext |
getImplicitContext()
Returns the ImplicitContext which defines what properties
will be sent on every method invocation. |
omero.RType |
getInput(String key)
Retrieves an item from the "input" shared (session) memory. |
List<String> |
getInputKeys()
Returns a list of keys for all items in the "input" shared (session) memory |
omero.RType |
getOutput(String key)
Retrieves an item from the "output" shared (session) memory. |
List<String> |
getOutputKeys()
Returns a list of keys for all items in the "output" shared (session) memory |
Ice.Properties |
getProperties()
Returns the active properties for this instance. |
String |
getProperty(String key)
Returns the property value for this key or the empty string if none. |
static Glacier2.RouterPrx |
getRouter(Ice.Communicator comm)
Acquires the default router ,
and throws an exception if it is not of type {Glacier2.RouterPrx}. |
omero.api.ServiceFactoryPrx |
getServiceFactory()
Deprecated. |
omero.api.ServiceFactoryPrx |
getSession()
Returns the current active session or throws an exception if none has been created since the last
closeSession() |
omero.api.ServiceFactoryPrx |
joinSession(String session)
Uses the given session uuid as name and password to rejoin a running session. |
void |
onHearbeat(Runnable runnable)
|
void |
onSessionClosed(Runnable runnable)
|
void |
onShutdown(Runnable runnable)
|
protected String |
parseAndSetInt(Ice.InitializationData data,
String key,
int newValue)
|
protected String |
sess()
Helper method to access session id |
void |
setInput(String key,
omero.RType value)
Sets an item in the "input" shared (session) memory under the given name. |
void |
setOutput(String key,
omero.RType value)
Sets an item in the "output" shared (session) memory under the given name. |
String |
sha1(File file)
Calculates the local sha1 for a file. |
void |
upload(File file,
omero.model.OriginalFile fileObject,
Integer blockSize)
Utility method to upload a file to the server |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public client()
client(Ice.InitializationData)
with a new
InitializationData
public client(Ice.InitializationData id)
Communicator
from a InitializationData
instance. Cannot be null.
public client(String host)
Communicator
pointing at the given server using
the #DEFAULT_PORT
.
public client(String host, int port)
Communicator
pointing at the given server with the
non-standard port.
public client(String[] args)
client(String[], Ice.InitializationData)
with a new
InitializationData
public client(String[] args, Ice.InitializationData id)
Communicator
from command-line arguments. These
are parsed via Ice.Properties.parseIceCommandLineOptions(args) and
Ice.Properties.parseCommandLineOptions("omero", args)
public client(File... files)
Communicator
from multiple files.
public client(Map p)
Communicator
from a Map
instance. The
String
representation of each member is added to the
Properties
under the String
representation of the
key.
Method Detail |
---|
protected void __del__()
public Ice.Communicator getCommunicator()
Communicator
for this instance or throws an
exception if null.
public omero.api.ServiceFactoryPrx getSession()
created
since the last
closeSession()
@Deprecated public omero.api.ServiceFactoryPrx getServiceFactory()
getSession()
public Ice.ImplicitContext getImplicitContext()
ImplicitContext
which defines what properties
will be sent on every method invocation.
public Ice.Properties getProperties()
active properties
for this instance.
public String getProperty(String key)
public omero.api.ServiceFactoryPrx joinSession(String session) throws Glacier2.CannotCreateSessionException, Glacier2.PermissionDeniedException, omero.ServerError
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
omero.ServerError
public omero.api.ServiceFactoryPrx createSession() throws Glacier2.CannotCreateSessionException, Glacier2.PermissionDeniedException, omero.ServerError
createSession(String, String)
with null values
Glacier2.CannotCreateSessionException
Glacier2.PermissionDeniedException
omero.ServerError
public omero.api.ServiceFactoryPrx createSession(String username, String password) throws Glacier2.CannotCreateSessionException, Glacier2.PermissionDeniedException, omero.ServerError
#getRouter()
. Disallows an extant ServiceFactoryPrx
, and
tries to re-create a null Communicator
. A null or empty
username will throw an exception, but an empty password is allowed.
username
- password
-
Glacier2.CannotCreateSessionException
Glacier2.PermissionDeniedException
omero.ServerError
public static Glacier2.RouterPrx getRouter(Ice.Communicator comm)
default router
,
and throws an exception if it is not of type {Glacier2.RouterPrx}. Also
sets the ImplicitContext
on the router proxy.
public void enableKeepAlive(int seconds)
Communicator
which is used on initialization to determine the
time-period between checks
. If no
__resources
is available currently, one is also created.
public void closeSession()
public String sha1(File file)
public void upload(File file, omero.model.OriginalFile fileObject, Integer blockSize)
file
- Cannot be null.fileObject
- Can be null.blockSize
- Can be null.public omero.RType getInput(String key) throws omero.ServerError
omero.ServerError
public omero.RType getOutput(String key) throws omero.ServerError
omero.ServerError
public void setInput(String key, omero.RType value) throws omero.ServerError
omero.ServerError
public void setOutput(String key, omero.RType value) throws omero.ServerError
omero.ServerError
public List<String> getInputKeys() throws omero.ServerError
omero.ServerError
public List<String> getOutputKeys() throws omero.ServerError
omero.ServerError
protected String parseAndSetInt(Ice.InitializationData data, String key, int newValue)
protected static String filesToString(File... files)
protected omero.api.ISessionPrx env() throws omero.ServerError
omero.ServerError
protected String sess() throws omero.ServerError
omero.ServerError
public void onHearbeat(Runnable runnable)
public void onSessionClosed(Runnable runnable)
public void onShutdown(Runnable runnable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta-4.1.1-r5927-b91
Copyright © 2009 The University of Dundee. All Rights Reserved.