public class Gateway extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_CONNECTOR_CLOSED
Property to indicate that a
Connector has been closed |
static String |
PROP_CONNECTOR_CREATED
Property to indicate that a
Connector has been created |
static String |
PROP_FACILITY_CLOSED
Property to indicate that a
Facility has been closed |
static String |
PROP_FACILITY_CREATED
Property to indicate that a
Facility has been created |
static String |
PROP_IMPORTSTORE_CLOSED
Property to indicate that an import store has been closed
|
static String |
PROP_IMPORTSTORE_CREATED
Property to indicate that an import store has been created
|
static String |
PROP_RENDERINGENGINE_CLOSED
Property to indicate that a rendering engine has been closed
|
static String |
PROP_RENDERINGENGINE_CREATED
Property to indicate that a rendering engine has been created
|
static String |
PROP_SESSION_CLOSED
Property to indicate that a session has been closed
|
static String |
PROP_SESSION_CREATED
Property to indicate that a session has been created
|
static String |
PROP_STATEFUL_SERVICE_CLOSED
Property to indicate that a stateful service has been closed
|
static String |
PROP_STATEFUL_SERVICE_CREATED
Property to indicate that a stateful service has been created
|
static String |
PROP_STATELESS_SERVICE_CREATED
Property to indicate that a stateless service has been created
|
| Constructor and Description |
|---|
Gateway(Logger log)
Creates a new Gateway instance
|
Gateway(Logger log,
CacheService cacheService)
Creates a new Gateway instance
|
Gateway(Logger log,
CacheService cacheService,
ExecutorService executorService,
boolean executorShutdownOnDisconnect)
Creates a new Gateway instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a
PropertyChangeListener |
void |
closeConnector(SecurityContext ctx)
Close a connector for a certain
SecurityContext |
void |
closeImport(SecurityContext ctx,
String userName)
Close Import for a certain user
|
void |
closeService(SecurityContext ctx,
omero.api.StatefulServiceInterfacePrx svc)
Close a service
|
ExperimenterData |
connect(LoginCredentials c)
Connect to the server
|
omero.api.RawPixelsStorePrx |
createPixelsStore(SecurityContext ctx)
Create a
RawPixelsStorePrx |
omero.api.ThumbnailStorePrx |
createThumbnailStore(SecurityContext ctx)
Create a
ThumbnailStorePrx |
void |
disconnect()
Disconnects from the server
|
omero.api.IAdminPrx |
getAdminService(SecurityContext ctx)
Returns the
IAdminPrx service. |
omero.api.IAdminPrx |
getAdminService(SecurityContext ctx,
boolean secure)
Returns the
IAdminPrx service. |
CacheService |
getCacheService()
Provides access to the
CacheService |
omero.api.IConfigPrx |
getConfigService(SecurityContext ctx)
Returns the
IConfigPrx service. |
omero.gateway.Connector |
getConnector(SecurityContext ctx)
Get a connector for a certain
SecurityContext |
omero.gateway.Connector |
getConnector(SecurityContext ctx,
boolean recreate,
boolean permitNull)
Returns the connector corresponding to the passed context.
|
omero.api.ExporterPrx |
getExporterService(SecurityContext ctx)
Returns the
ExporterPrx service. |
<T extends Facility> |
getFacility(Class<T> type)
Get a
Facility to perform further operations with the server |
OMEROMetadataStoreClient |
getImportStore(SecurityContext ctx)
Creates or recycles the import store.
|
OMEROMetadataStoreClient |
getImportStore(SecurityContext ctx,
String userName)
Creates or recycles the import store.
|
ExperimenterData |
getLoggedInUser()
Get the currently logged in user
|
Logger |
getLogger()
Provides access to the
Logger |
omero.api.IMetadataPrx |
getMetadataService(SecurityContext ctx)
Returns the
IMetadataPrx service. |
omero.api.IPixelsPrx |
getPixelsService(SecurityContext ctx)
Returns the
IPixelsPrx service. |
omero.api.RawPixelsStorePrx |
getPixelsStore(SecurityContext ctx)
Returns the
RawPixelsStorePrx service. |
omero.api.IContainerPrx |
getPojosService(SecurityContext ctx)
Returns the
IContainerPrx service. |
omero.api.IProjectionPrx |
getProjectionService(SecurityContext ctx)
Returns the
IProjectionPrx service. |
PropertyChangeListener[] |
getPropertyChangeListeners()
Get the
PropertyChangeListeners |
omero.api.IQueryPrx |
getQueryService(SecurityContext ctx)
Returns the
IQueryPrx service. |
omero.api.RawFileStorePrx |
getRawFileService(SecurityContext ctx)
Returns the
RawFileStorePrx service. |
Map<SecurityContext,Set<Long>> |
getRenderingEngines()
Returns the rendering engines to re-activate.
|
omero.api.RenderingEnginePrx |
getRenderingService(SecurityContext ctx,
long pixelsID)
Returns the
Rendering service. |
omero.api.IRenderingSettingsPrx |
getRenderingSettingsService(SecurityContext ctx)
Returns the
IRenderingSettingsPrx service. |
omero.api.IRepositoryInfoPrx |
getRepositoryService(SecurityContext ctx)
Returns the
IRepositoryInfoPrx service. |
omero.api.IRoiPrx |
getROIService(SecurityContext ctx)
Returns the
IRoiPrx service. |
omero.api.IScriptPrx |
getScriptService(SecurityContext ctx)
Returns the
IScriptPrx service. |
omero.api.SearchPrx |
getSearchService(SecurityContext ctx)
Returns the
SearchPrx service. |
String |
getServerVersion()
Get the version of the server the Gateway is connected to
|
String |
getSessionId(ExperimenterData user)
Get the ID of the current session
|
omero.grid.SharedResourcesPrx |
getSharedResources(SecurityContext ctx)
Returns the
SharedResourcesPrx service. |
omero.api.ThumbnailStorePrx |
getThumbnailService(SecurityContext ctx)
Returns the
ThumbnailStorePrx service. |
omero.api.ITypesPrx |
getTypesService(SecurityContext ctx)
Returns the
ITypesPrx service. |
omero.api.IUpdatePrx |
getUpdateService(SecurityContext ctx)
Returns the
IUpdatePrx service. |
omero.api.IUpdatePrx |
getUpdateService(SecurityContext ctx,
String userName)
Returns the
IUpdatePrx service. |
ExperimenterData |
getUserDetails(SecurityContext ctx,
String name)
Get the user details of a certain user
|
boolean |
isAlive(SecurityContext ctx)
Checks if there is a
Connector for a particular
SecurityContext |
boolean |
isConnected()
Check if the Gateway is still connected to the server
|
boolean |
isNetworkUp(boolean useCachedValue)
Checks if the network interface is up.
|
boolean |
joinSession()
Tries to rejoin the session.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a
PropertyChangeListener |
ProcessCallbackI |
runScript(SecurityContext ctx,
long scriptID,
Map<String,omero.RType> parameters)
Run a script on the server
|
void |
shutDownDerivedConnector(SecurityContext ctx)
Shuts down the connectors created while creating/importing data for other
users.
|
void |
shutdownRenderingEngine(SecurityContext ctx,
long pixelsID)
Shuts down the rendering engine
|
<T> Future<T> |
submit(Callable<T> task)
Submits an async task
|
CmdCallbackI |
submit(SecurityContext ctx,
List<omero.cmd.Request> commands,
SecurityContext target)
Executes the commands.
|
CmdCallbackI |
submit(SecurityContext ctx,
omero.cmd.Request cmd)
Directly submit a
Request to the server |
public static final String PROP_CONNECTOR_CREATED
Connector has been createdpublic static final String PROP_CONNECTOR_CLOSED
Connector has been closedpublic static final String PROP_SESSION_CREATED
public static final String PROP_SESSION_CLOSED
public static final String PROP_FACILITY_CREATED
Facility has been createdpublic static final String PROP_FACILITY_CLOSED
Facility has been closedpublic static final String PROP_IMPORTSTORE_CREATED
public static final String PROP_IMPORTSTORE_CLOSED
public static final String PROP_RENDERINGENGINE_CREATED
public static final String PROP_RENDERINGENGINE_CLOSED
public static final String PROP_STATEFUL_SERVICE_CREATED
public static final String PROP_STATEFUL_SERVICE_CLOSED
public static final String PROP_STATELESS_SERVICE_CREATED
public Gateway(Logger log, CacheService cacheService)
log - A LoggercacheService - A CacheService, can be nullpublic Gateway(Logger log, CacheService cacheService, ExecutorService executorService, boolean executorShutdownOnDisconnect)
log - A LoggercacheService - A CacheService, can be nullexecutorService - A ExecutorService for handling asynchronous tasks, can
be null (in which case the Java built-in cached
thread pool will be used)executorShutdownOnDisconnect - Flag to indicate that executor threads should be shutdown on
disconnect (only taken into account if an
ExecutorService was provided; the default cached
thread pool will be shut down by default)public <T> Future<T> submit(Callable<T> task)
task - The taskpublic ExperimenterData connect(LoginCredentials c) throws DSOutOfServiceException
c - The LoginCredentialsExperimenterData who is logged inDSOutOfServiceException - If the connection can't be establishedpublic ExperimenterData getLoggedInUser()
public void disconnect()
public boolean joinSession()
public boolean isConnected()
public String getSessionId(ExperimenterData user)
user - The user to get the session ID forpublic String getServerVersion() throws DSOutOfServiceException
DSOutOfServiceException - If the connection is broken, or not logged inpublic <T extends Facility> T getFacility(Class<T> type) throws ExecutionException
Facility to perform further operations with the servertype - The kind of Facility to requestExecutionException - If the Facility can't be retrieved or instantiatedpublic void addPropertyChangeListener(PropertyChangeListener listener)
PropertyChangeListenerlistener - The listenerpublic void removePropertyChangeListener(PropertyChangeListener listener)
PropertyChangeListenerlistener - The listenerpublic PropertyChangeListener[] getPropertyChangeListeners()
PropertyChangeListenerspublic CmdCallbackI submit(SecurityContext ctx, List<omero.cmd.Request> commands, SecurityContext target) throws Throwable
ctx - The SecurityContextcommands - The commands to execute.target - The target context is any.Throwable - If an error occurredpublic CmdCallbackI submit(SecurityContext ctx, omero.cmd.Request cmd) throws Throwable
Request to the serverctx - The SecurityContextcmd - The Request to submitCmdCallbackIThrowable - If an error occurredpublic void closeImport(SecurityContext ctx, String userName)
ctx - The SecurityContextuserName - The name of the user which import should be closedpublic ProcessCallbackI runScript(SecurityContext ctx, long scriptID, Map<String,omero.RType> parameters) throws DSOutOfServiceException, omero.ServerError
ctx - The SecurityContextscriptID - The ID of the scriptparameters - Parameters for the scriptProcessCallbackIDSOutOfServiceException - If the connection is broken, or not logged inomero.ServerError - If an error in the script execution occurredpublic CacheService getCacheService()
CacheServicepublic omero.grid.SharedResourcesPrx getSharedResources(SecurityContext ctx) throws DSOutOfServiceException
SharedResourcesPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IRenderingSettingsPrx getRenderingSettingsService(SecurityContext ctx) throws DSOutOfServiceException
IRenderingSettingsPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IRepositoryInfoPrx getRepositoryService(SecurityContext ctx) throws DSOutOfServiceException
IRepositoryInfoPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IScriptPrx getScriptService(SecurityContext ctx) throws DSOutOfServiceException
IScriptPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IContainerPrx getPojosService(SecurityContext ctx) throws DSOutOfServiceException
IContainerPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IQueryPrx getQueryService(SecurityContext ctx) throws DSOutOfServiceException
IQueryPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IUpdatePrx getUpdateService(SecurityContext ctx) throws DSOutOfServiceException
IUpdatePrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IUpdatePrx getUpdateService(SecurityContext ctx, String userName) throws DSOutOfServiceException
IUpdatePrx service.ctx - The SecurityContextuserName - The usernameDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IMetadataPrx getMetadataService(SecurityContext ctx) throws DSOutOfServiceException
IMetadataPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IRoiPrx getROIService(SecurityContext ctx) throws DSOutOfServiceException
IRoiPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IConfigPrx getConfigService(SecurityContext ctx) throws DSOutOfServiceException
IConfigPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.ThumbnailStorePrx getThumbnailService(SecurityContext ctx) throws DSOutOfServiceException
ThumbnailStorePrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.ExporterPrx getExporterService(SecurityContext ctx) throws DSOutOfServiceException
ExporterPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.RawFileStorePrx getRawFileService(SecurityContext ctx) throws DSOutOfServiceException
RawFileStorePrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.RawPixelsStorePrx getPixelsStore(SecurityContext ctx) throws DSOutOfServiceException
RawPixelsStorePrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IPixelsPrx getPixelsService(SecurityContext ctx) throws DSOutOfServiceException
IPixelsPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.SearchPrx getSearchService(SecurityContext ctx) throws DSOutOfServiceException
SearchPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IProjectionPrx getProjectionService(SecurityContext ctx) throws DSOutOfServiceException
IProjectionPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IAdminPrx getAdminService(SecurityContext ctx) throws DSOutOfServiceException
IAdminPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.IAdminPrx getAdminService(SecurityContext ctx, boolean secure) throws DSOutOfServiceException
IAdminPrx service.ctx - The SecurityContextsecure - Pass true to have a secure admin service,
false otherwise.DSOutOfServiceException - Thrown if the service cannot be initialized.public OMEROMetadataStoreClient getImportStore(SecurityContext ctx) throws DSOutOfServiceException
ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.public OMEROMetadataStoreClient getImportStore(SecurityContext ctx, String userName) throws DSOutOfServiceException
ctx - The SecurityContextuserName - The usernameDSOutOfServiceException - Thrown if the service cannot be initialized.public omero.api.RenderingEnginePrx getRenderingService(SecurityContext ctx, long pixelsID) throws DSOutOfServiceException, omero.ServerError
Rendering service.ctx - The SecurityContextpixelsID - The pixels IDDSOutOfServiceException - Thrown if the service cannot be initialized.omero.ServerError - Thrown if the service cannot be initialized.public ExperimenterData getUserDetails(SecurityContext ctx, String name) throws DSOutOfServiceException
ctx - The SecurityContextname - The name of the userDSOutOfServiceException - If the connection is broken, or not logged inpublic boolean isNetworkUp(boolean useCachedValue)
useCachedValue - Uses the result of the last check instead of really performing
the test if the last check is not older than 5 secpublic omero.gateway.Connector getConnector(SecurityContext ctx) throws DSOutOfServiceException
SecurityContextctx - The SecurityContextDSOutOfServiceException - If the connection is broken, or not logged inpublic void closeConnector(SecurityContext ctx)
SecurityContextctx - The SecurityContextpublic void closeService(SecurityContext ctx, omero.api.StatefulServiceInterfacePrx svc)
ctx - The SecurityContextsvc - The service to closepublic omero.api.RawPixelsStorePrx createPixelsStore(SecurityContext ctx) throws DSOutOfServiceException
RawPixelsStorePrxctx - The SecurityContextDSOutOfServiceException - If the connection is broken, or not logged inpublic omero.api.ThumbnailStorePrx createThumbnailStore(SecurityContext ctx) throws DSOutOfServiceException
ThumbnailStorePrxctx - The SecurityContextDSOutOfServiceException - If the connection is broken, or not logged inpublic boolean isAlive(SecurityContext ctx) throws DSOutOfServiceException
Connector for a particular
SecurityContextctx - The SecurityContexttrue if there is one, false otherwiseDSOutOfServiceException - If the connection is broken, or not logged inpublic omero.gateway.Connector getConnector(SecurityContext ctx, boolean recreate, boolean permitNull) throws DSOutOfServiceException
ctx - The security context.recreate - whether or not to allow the recreation of the
Connector. A DSOutOfServiceException is thrown
if this is set to false and no Connector is available.permitNull - whether or not to throw a DSOutOfServiceException if
no Connector is available by the end of the execution.DSOutOfServiceException - If the connection is broken, or not logged inpublic void shutDownDerivedConnector(SecurityContext ctx) throws DSOutOfServiceException
ctx - The SecurityContextDSOutOfServiceException - If the connection is broken, or not logged inpublic Map<SecurityContext,Set<Long>> getRenderingEngines()
public void shutdownRenderingEngine(SecurityContext ctx, long pixelsID)
ctx - The SecurityContextpixelsID - The pixels idpublic omero.api.ITypesPrx getTypesService(SecurityContext ctx) throws DSOutOfServiceException
ITypesPrx service.ctx - The SecurityContextDSOutOfServiceException - Thrown if the service cannot be initialized.
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.