Package omero.gateway
Class Gateway
- java.lang.Object
-
- omero.gateway.Gateway
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class Gateway extends java.lang.Object implements java.lang.AutoCloseable
A Gateway for simplifying access to an OMERO server- Since:
- 5.1
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_CONNECTOR_CLOSED
Property to indicate that aConnector
has been closedstatic java.lang.String
PROP_CONNECTOR_CREATED
Property to indicate that aConnector
has been createdstatic java.lang.String
PROP_FACILITY_CLOSED
Property to indicate that aFacility
has been closedstatic java.lang.String
PROP_FACILITY_CREATED
Property to indicate that aFacility
has been createdstatic java.lang.String
PROP_IMPORTSTORE_CLOSED
Property to indicate that an import store has been closedstatic java.lang.String
PROP_IMPORTSTORE_CREATED
Property to indicate that an import store has been createdstatic java.lang.String
PROP_RENDERINGENGINE_CLOSED
Property to indicate that a rendering engine has been closedstatic java.lang.String
PROP_RENDERINGENGINE_CREATED
Property to indicate that a rendering engine has been createdstatic java.lang.String
PROP_SESSION_CLOSED
Property to indicate that a session has been closedstatic java.lang.String
PROP_SESSION_CREATED
Property to indicate that a session has been createdstatic java.lang.String
PROP_SESSION_DETACHED
Property to indicate that client got detached from a sessionstatic java.lang.String
PROP_STATEFUL_SERVICE_CLOSED
Property to indicate that a stateful service has been closedstatic java.lang.String
PROP_STATEFUL_SERVICE_CREATED
Property to indicate that a stateful service has been createdstatic java.lang.String
PROP_STATELESS_SERVICE_CREATED
Property to indicate that a stateless service has been created
-
Constructor Summary
Constructors Constructor Description Gateway(omero.log.Logger log)
Creates a new Gateway instanceGateway(omero.log.Logger log, java.util.concurrent.ExecutorService executorService, boolean executorShutdownOnDisconnect)
Creates a new Gateway instanceGateway(omero.log.Logger log, CacheService cacheService)
Deprecated.This constructor will be removed in future.Gateway(omero.log.Logger log, CacheService cacheService, java.util.concurrent.ExecutorService executorService, boolean executorShutdownOnDisconnect)
Deprecated.This constructor will be removed in future.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds aPropertyChangeListener
java.lang.Boolean
canCreate(SecurityContext ctx)
Get the read-only status of the server.void
close()
void
closeConnector(SecurityContext ctx)
Close a connector for a certainSecurityContext
void
closeImport(SecurityContext ctx, java.lang.String userName)
Close Import for a certain uservoid
closeService(SecurityContext ctx, omero.api.StatefulServiceInterfacePrx svc)
Close a servicevoid
closeSessionOnExit(SecurityContext ctx, boolean closeSession)
By default the session is closed if it was initialized by the gateway.ExperimenterData
connect(LoginCredentials c)
Connect to the serveromero.api.RawPixelsStorePrx
createPixelsStore(SecurityContext ctx)
Create aRawPixelsStorePrx
omero.api.ThumbnailStorePrx
createThumbnailStore(SecurityContext ctx)
Create aThumbnailStorePrx
void
disconnect()
Disconnects from the serveromero.api.IAdminPrx
getAdminService(SecurityContext ctx)
Returns theIAdminPrx
service.omero.api.IAdminPrx
getAdminService(SecurityContext ctx, boolean secure)
Returns theIAdminPrx
service.CacheService
getCacheService()
Deprecated.This method will be removed in future.omero.api.IConfigPrx
getConfigService(SecurityContext ctx)
Returns theIConfigPrx
service.omero.gateway.Connector
getConnector(SecurityContext ctx)
Get a connector for a certainSecurityContext
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 theExporterPrx
service.<T extends Facility>
TgetFacility(java.lang.Class<T> type)
Get aFacility
to perform further operations with the serverome.formats.OMEROMetadataStoreClient
getImportStore(SecurityContext ctx)
Creates or recycles the import store.ome.formats.OMEROMetadataStoreClient
getImportStore(SecurityContext ctx, java.lang.String userName)
Creates or recycles the import store.ExperimenterData
getLoggedInUser()
Get the currently logged in useromero.log.Logger
getLogger()
Provides access to theLogger
omero.api.IMetadataPrx
getMetadataService(SecurityContext ctx)
Returns theIMetadataPrx
service.omero.api.IPixelsPrx
getPixelsService(SecurityContext ctx)
Returns theIPixelsPrx
service.omero.api.RawPixelsStorePrx
getPixelsStore(SecurityContext ctx)
Returns theRawPixelsStorePrx
service.omero.api.IContainerPrx
getPojosService(SecurityContext ctx)
Returns theIContainerPrx
service.omero.api.IProjectionPrx
getProjectionService(SecurityContext ctx)
Returns theIProjectionPrx
service.java.beans.PropertyChangeListener[]
getPropertyChangeListeners()
Get thePropertyChangeListener
somero.api.IQueryPrx
getQueryService(SecurityContext ctx)
Returns theIQueryPrx
service.omero.api.RawFileStorePrx
getRawFileService(SecurityContext ctx)
Returns theRawFileStorePrx
service.java.util.Map<SecurityContext,java.util.Set<java.lang.Long>>
getRenderingEngines()
Returns the rendering engines to re-activate.omero.api.RenderingEnginePrx
getRenderingService(SecurityContext ctx, long pixelsID)
Returns theRendering service
.omero.api.IRenderingSettingsPrx
getRenderingSettingsService(SecurityContext ctx)
Returns theIRenderingSettingsPrx
service.omero.api.IRepositoryInfoPrx
getRepositoryService(SecurityContext ctx)
Returns theIRepositoryInfoPrx
service.omero.api.IRoiPrx
getROIService(SecurityContext ctx)
Returns theIRoiPrx
service.omero.api.IScriptPrx
getScriptService(SecurityContext ctx)
Returns theIScriptPrx
service.omero.api.SearchPrx
getSearchService(SecurityContext ctx)
Returns theSearchPrx
service.java.lang.String
getServerHost()
Get the hostname of the server the Gateway is connected tojava.lang.String
getServerVersion()
Get the version of the server the Gateway is connected tojava.lang.String
getSessionId(ExperimenterData user)
Get the ID of the current sessionomero.grid.SharedResourcesPrx
getSharedResources(SecurityContext ctx)
Returns theSharedResourcesPrx
service.omero.api.ThumbnailStorePrx
getThumbnailService(SecurityContext ctx)
Returns theThumbnailStorePrx
service.omero.api.ITypesPrx
getTypesService(SecurityContext ctx)
Returns theITypesPrx
service.omero.api.IUpdatePrx
getUpdateService(SecurityContext ctx)
Returns theIUpdatePrx
service.omero.api.IUpdatePrx
getUpdateService(SecurityContext ctx, java.lang.String userName)
Returns theIUpdatePrx
service.ExperimenterData
getUserDetails(SecurityContext ctx, java.lang.String name)
Get the user details of a certain userboolean
isAlive(SecurityContext ctx)
Checks if there is aConnector
for a particularSecurityContext
boolean
isConnected()
Check if the Gateway is still connected to the serverboolean
isNetworkUp(boolean useCachedValue)
Checks if the network interface is up.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes aPropertyChangeListener
omero.grid.ProcessCallbackI
runScript(SecurityContext ctx, long scriptID, java.util.Map<java.lang.String,omero.RType> parameters)
Run a script on the servervoid
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> java.util.concurrent.Future<T>
submit(java.util.concurrent.Callable<T> task)
Submits an async taskomero.cmd.CmdCallbackI
submit(SecurityContext ctx, java.util.List<omero.cmd.Request> commands, SecurityContext target)
Executes the commands.omero.cmd.CmdCallbackI
submit(SecurityContext ctx, omero.cmd.Request cmd)
Directly submit aRequest
to the server
-
-
-
Field Detail
-
PROP_CONNECTOR_CREATED
public static final java.lang.String PROP_CONNECTOR_CREATED
Property to indicate that aConnector
has been created- See Also:
- Constant Field Values
-
PROP_CONNECTOR_CLOSED
public static final java.lang.String PROP_CONNECTOR_CLOSED
Property to indicate that aConnector
has been closed- See Also:
- Constant Field Values
-
PROP_SESSION_CREATED
public static final java.lang.String PROP_SESSION_CREATED
Property to indicate that a session has been created- See Also:
- Constant Field Values
-
PROP_SESSION_CLOSED
public static final java.lang.String PROP_SESSION_CLOSED
Property to indicate that a session has been closed- See Also:
- Constant Field Values
-
PROP_SESSION_DETACHED
public static final java.lang.String PROP_SESSION_DETACHED
Property to indicate that client got detached from a session- See Also:
- Constant Field Values
-
PROP_FACILITY_CREATED
public static final java.lang.String PROP_FACILITY_CREATED
Property to indicate that aFacility
has been created- See Also:
- Constant Field Values
-
PROP_FACILITY_CLOSED
public static final java.lang.String PROP_FACILITY_CLOSED
Property to indicate that aFacility
has been closed- See Also:
- Constant Field Values
-
PROP_IMPORTSTORE_CREATED
public static final java.lang.String PROP_IMPORTSTORE_CREATED
Property to indicate that an import store has been created- See Also:
- Constant Field Values
-
PROP_IMPORTSTORE_CLOSED
public static final java.lang.String PROP_IMPORTSTORE_CLOSED
Property to indicate that an import store has been closed- See Also:
- Constant Field Values
-
PROP_RENDERINGENGINE_CREATED
public static final java.lang.String PROP_RENDERINGENGINE_CREATED
Property to indicate that a rendering engine has been created- See Also:
- Constant Field Values
-
PROP_RENDERINGENGINE_CLOSED
public static final java.lang.String PROP_RENDERINGENGINE_CLOSED
Property to indicate that a rendering engine has been closed- See Also:
- Constant Field Values
-
PROP_STATEFUL_SERVICE_CREATED
public static final java.lang.String PROP_STATEFUL_SERVICE_CREATED
Property to indicate that a stateful service has been created- See Also:
- Constant Field Values
-
PROP_STATEFUL_SERVICE_CLOSED
public static final java.lang.String PROP_STATEFUL_SERVICE_CLOSED
Property to indicate that a stateful service has been closed- See Also:
- Constant Field Values
-
PROP_STATELESS_SERVICE_CREATED
public static final java.lang.String PROP_STATELESS_SERVICE_CREATED
Property to indicate that a stateless service has been created- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Gateway
public Gateway(omero.log.Logger log)
Creates a new Gateway instance- Parameters:
log
- ALogger
-
Gateway
@Deprecated public Gateway(omero.log.Logger log, CacheService cacheService)
Deprecated.This constructor will be removed in future. Please useinstead
Creates a new Gateway instance- Parameters:
log
- ALogger
cacheService
- ACacheService
, can benull
-
Gateway
@Deprecated public Gateway(omero.log.Logger log, CacheService cacheService, java.util.concurrent.ExecutorService executorService, boolean executorShutdownOnDisconnect)
Deprecated.This constructor will be removed in future. Please useinstead
Creates a new Gateway instance- Parameters:
log
- ALogger
cacheService
- ACacheService
, can benull
executorService
- AExecutorService
for handling asynchronous tasks, can benull
(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 anExecutorService
was provided; the default cached thread pool will be shut down by default)
-
Gateway
public Gateway(omero.log.Logger log, java.util.concurrent.ExecutorService executorService, boolean executorShutdownOnDisconnect)
Creates a new Gateway instance- Parameters:
log
- ALogger
executorService
- AExecutorService
for handling asynchronous tasks, can benull
(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 anExecutorService
was provided; the default cached thread pool will be shut down by default)
-
-
Method Detail
-
submit
public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
Submits an async task- Parameters:
task
- The task- Returns:
- The callback reference
-
connect
public ExperimenterData connect(LoginCredentials c) throws DSOutOfServiceException
Connect to the server- Parameters:
c
- TheLoginCredentials
- Returns:
- The
ExperimenterData
who is logged in - Throws:
DSOutOfServiceException
- If the connection can't be established
-
getLoggedInUser
public ExperimenterData getLoggedInUser()
Get the currently logged in user- Returns:
- See above.
-
disconnect
public void disconnect()
Disconnects from the server
-
isConnected
public boolean isConnected()
Check if the Gateway is still connected to the server- Returns:
- See above.
-
getSessionId
public java.lang.String getSessionId(ExperimenterData user) throws DSOutOfServiceException
Get the ID of the current session- Parameters:
user
- The user to get the session ID for- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
getServerVersion
public java.lang.String getServerVersion() throws DSOutOfServiceException
Get the version of the server the Gateway is connected to- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
getServerHost
public java.lang.String getServerHost() throws DSOutOfServiceException
Get the hostname of the server the Gateway is connected to- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
getFacility
public <T extends Facility> T getFacility(java.lang.Class<T> type) throws java.util.concurrent.ExecutionException
Get aFacility
to perform further operations with the server
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds aPropertyChangeListener
- Parameters:
listener
- The listener
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes aPropertyChangeListener
- Parameters:
listener
- The listener
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Get thePropertyChangeListener
s- Returns:
- See above
-
submit
public omero.cmd.CmdCallbackI submit(SecurityContext ctx, java.util.List<omero.cmd.Request> commands, SecurityContext target) throws java.lang.Throwable
Executes the commands.- Parameters:
ctx
- TheSecurityContext
commands
- The commands to execute.target
- The target context is any.- Returns:
- See above.
- Throws:
java.lang.Throwable
- If an error occurred
-
submit
public omero.cmd.CmdCallbackI submit(SecurityContext ctx, omero.cmd.Request cmd) throws java.lang.Throwable
Directly submit aRequest
to the server- Parameters:
ctx
- TheSecurityContext
cmd
- TheRequest
to submit- Returns:
- A callback reference,
CmdCallbackI
- Throws:
java.lang.Throwable
- If an error occurred
-
closeImport
public void closeImport(SecurityContext ctx, java.lang.String userName)
Close Import for a certain user- Parameters:
ctx
- TheSecurityContext
userName
- The name of the user which import should be closed
-
runScript
public omero.grid.ProcessCallbackI runScript(SecurityContext ctx, long scriptID, java.util.Map<java.lang.String,omero.RType> parameters) throws DSOutOfServiceException, omero.ServerError
Run a script on the server- Parameters:
ctx
- TheSecurityContext
scriptID
- The ID of the scriptparameters
- Parameters for the script- Returns:
- A callback reference,
ProcessCallbackI
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inomero.ServerError
- If an error in the script execution occurred
-
getLogger
public omero.log.Logger getLogger()
Provides access to theLogger
- Returns:
- See above
-
getCacheService
@Deprecated public CacheService getCacheService()
Deprecated.This method will be removed in future.Provides access to theCacheService
- Returns:
- See above
-
getSharedResources
public omero.grid.SharedResourcesPrx getSharedResources(SecurityContext ctx) throws DSOutOfServiceException
Returns theSharedResourcesPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getRenderingSettingsService
public omero.api.IRenderingSettingsPrx getRenderingSettingsService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIRenderingSettingsPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getRepositoryService
public omero.api.IRepositoryInfoPrx getRepositoryService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIRepositoryInfoPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getScriptService
public omero.api.IScriptPrx getScriptService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIScriptPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getPojosService
public omero.api.IContainerPrx getPojosService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIContainerPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getQueryService
public omero.api.IQueryPrx getQueryService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIQueryPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getUpdateService
public omero.api.IUpdatePrx getUpdateService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIUpdatePrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getUpdateService
public omero.api.IUpdatePrx getUpdateService(SecurityContext ctx, java.lang.String userName) throws DSOutOfServiceException
Returns theIUpdatePrx
service.- Parameters:
ctx
- TheSecurityContext
userName
- The username- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getMetadataService
public omero.api.IMetadataPrx getMetadataService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIMetadataPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getROIService
public omero.api.IRoiPrx getROIService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIRoiPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getConfigService
public omero.api.IConfigPrx getConfigService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIConfigPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getThumbnailService
public omero.api.ThumbnailStorePrx getThumbnailService(SecurityContext ctx) throws DSOutOfServiceException
Returns theThumbnailStorePrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getExporterService
public omero.api.ExporterPrx getExporterService(SecurityContext ctx) throws DSOutOfServiceException
Returns theExporterPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getRawFileService
public omero.api.RawFileStorePrx getRawFileService(SecurityContext ctx) throws DSOutOfServiceException
Returns theRawFileStorePrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getPixelsStore
public omero.api.RawPixelsStorePrx getPixelsStore(SecurityContext ctx) throws DSOutOfServiceException
Returns theRawPixelsStorePrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getPixelsService
public omero.api.IPixelsPrx getPixelsService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIPixelsPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getSearchService
public omero.api.SearchPrx getSearchService(SecurityContext ctx) throws DSOutOfServiceException
Returns theSearchPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getProjectionService
public omero.api.IProjectionPrx getProjectionService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIProjectionPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getAdminService
public omero.api.IAdminPrx getAdminService(SecurityContext ctx) throws DSOutOfServiceException
Returns theIAdminPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getAdminService
public omero.api.IAdminPrx getAdminService(SecurityContext ctx, boolean secure) throws DSOutOfServiceException
Returns theIAdminPrx
service.- Parameters:
ctx
- TheSecurityContext
secure
- Passtrue
to have a secure admin service,false
otherwise.- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getImportStore
public ome.formats.OMEROMetadataStoreClient getImportStore(SecurityContext ctx) throws DSOutOfServiceException
Creates or recycles the import store.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getImportStore
public ome.formats.OMEROMetadataStoreClient getImportStore(SecurityContext ctx, java.lang.String userName) throws DSOutOfServiceException
Creates or recycles the import store.- Parameters:
ctx
- TheSecurityContext
userName
- The username- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
getRenderingService
public omero.api.RenderingEnginePrx getRenderingService(SecurityContext ctx, long pixelsID) throws DSOutOfServiceException, omero.ServerError
Returns theRendering service
.- Parameters:
ctx
- TheSecurityContext
pixelsID
- The pixels ID- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.omero.ServerError
- Thrown if the service cannot be initialized.
-
getUserDetails
public ExperimenterData getUserDetails(SecurityContext ctx, java.lang.String name) throws DSOutOfServiceException
Get the user details of a certain user- Parameters:
ctx
- TheSecurityContext
name
- The name of the user- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
isNetworkUp
public boolean isNetworkUp(boolean useCachedValue)
Checks if the network interface is up.- Parameters:
useCachedValue
- Uses the result of the last check instead of really performing the test if the last check is not older than 5 sec- Returns:
- See above
-
getConnector
public omero.gateway.Connector getConnector(SecurityContext ctx) throws DSOutOfServiceException
Get a connector for a certainSecurityContext
- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
closeConnector
public void closeConnector(SecurityContext ctx)
Close a connector for a certainSecurityContext
- Parameters:
ctx
- TheSecurityContext
-
closeSessionOnExit
public void closeSessionOnExit(SecurityContext ctx, boolean closeSession)
By default the session is closed if it was initialized by the gateway. This method allows to override this. Has to be called afterconnect()
.- Parameters:
closeSession
- Passfalse
to not close the session on disconnect
-
closeService
public void closeService(SecurityContext ctx, omero.api.StatefulServiceInterfacePrx svc)
Close a service- Parameters:
ctx
- TheSecurityContext
svc
- The service to close
-
createPixelsStore
public omero.api.RawPixelsStorePrx createPixelsStore(SecurityContext ctx) throws DSOutOfServiceException
Create aRawPixelsStorePrx
- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
createThumbnailStore
public omero.api.ThumbnailStorePrx createThumbnailStore(SecurityContext ctx) throws DSOutOfServiceException
Create aThumbnailStorePrx
- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
isAlive
public boolean isAlive(SecurityContext ctx) throws DSOutOfServiceException
Checks if there is aConnector
for a particularSecurityContext
- Parameters:
ctx
- TheSecurityContext
- Returns:
true
if there is one,false
otherwise- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
getConnector
public omero.gateway.Connector getConnector(SecurityContext ctx, boolean recreate, boolean permitNull) throws DSOutOfServiceException
Returns the connector corresponding to the passed context.- Parameters:
ctx
- The security context.recreate
- whether or not to allow the recreation of theConnector
. ADSOutOfServiceException
is thrown if this is set to false and noConnector
is available.permitNull
- whether or not to throw aDSOutOfServiceException
if noConnector
is available by the end of the execution.- Returns:
- See above.
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
shutDownDerivedConnector
public void shutDownDerivedConnector(SecurityContext ctx) throws DSOutOfServiceException
Shuts down the connectors created while creating/importing data for other users.- Parameters:
ctx
- TheSecurityContext
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in
-
getRenderingEngines
public java.util.Map<SecurityContext,java.util.Set<java.lang.Long>> getRenderingEngines()
Returns the rendering engines to re-activate.- Returns:
- See above.
-
shutdownRenderingEngine
public void shutdownRenderingEngine(SecurityContext ctx, long pixelsID)
Shuts down the rendering engine- Parameters:
ctx
- TheSecurityContext
pixelsID
- The pixels id
-
getTypesService
public omero.api.ITypesPrx getTypesService(SecurityContext ctx) throws DSOutOfServiceException
Returns theITypesPrx
service.- Parameters:
ctx
- TheSecurityContext
- Returns:
- See above.
- Throws:
DSOutOfServiceException
- Thrown if the service cannot be initialized.
-
canCreate
public java.lang.Boolean canCreate(SecurityContext ctx) throws DSOutOfServiceException
Get the read-only status of the server. Warning: This is experimental API that is subject to change.- Parameters:
ctx
- theSecurityContext
to use for the query- Returns:
true
if the server is wholly in read-write mode,false
if the server is wholly in read-only mode, otherwisenull
- Throws:
DSOutOfServiceException
- if the status query failed
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
-