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.AutoCloseableA Gateway for simplifying access to an OMERO server- Since:
- 5.1
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_CONNECTOR_CLOSEDProperty to indicate that aConnectorhas been closedstatic java.lang.StringPROP_CONNECTOR_CREATEDProperty to indicate that aConnectorhas been createdstatic java.lang.StringPROP_FACILITY_CLOSEDProperty to indicate that aFacilityhas been closedstatic java.lang.StringPROP_FACILITY_CREATEDProperty to indicate that aFacilityhas been createdstatic java.lang.StringPROP_IMPORTSTORE_CLOSEDProperty to indicate that an import store has been closedstatic java.lang.StringPROP_IMPORTSTORE_CREATEDProperty to indicate that an import store has been createdstatic java.lang.StringPROP_RENDERINGENGINE_CLOSEDProperty to indicate that a rendering engine has been closedstatic java.lang.StringPROP_RENDERINGENGINE_CREATEDProperty to indicate that a rendering engine has been createdstatic java.lang.StringPROP_SESSION_CLOSEDProperty to indicate that a session has been closedstatic java.lang.StringPROP_SESSION_CREATEDProperty to indicate that a session has been createdstatic java.lang.StringPROP_SESSION_DETACHEDProperty to indicate that client got detached from a sessionstatic java.lang.StringPROP_STATEFUL_SERVICE_CLOSEDProperty to indicate that a stateful service has been closedstatic java.lang.StringPROP_STATEFUL_SERVICE_CREATEDProperty to indicate that a stateful service has been createdstatic java.lang.StringPROP_STATELESS_SERVICE_CREATEDProperty 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 voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds aPropertyChangeListenerjava.lang.BooleancanCreate(SecurityContext ctx)Get the read-only status of the server.voidclose()voidcloseConnector(SecurityContext ctx)Close a connector for a certainSecurityContextvoidcloseImport(SecurityContext ctx, java.lang.String userName)Close Import for a certain uservoidcloseService(SecurityContext ctx, omero.api.StatefulServiceInterfacePrx svc)Close a servicevoidcloseSessionOnExit(SecurityContext ctx, boolean closeSession)By default the session is closed if it was initialized by the gateway.ExperimenterDataconnect(LoginCredentials c)Connect to the serveromero.api.RawPixelsStorePrxcreatePixelsStore(SecurityContext ctx)Create aRawPixelsStorePrxomero.api.ThumbnailStorePrxcreateThumbnailStore(SecurityContext ctx)Create aThumbnailStorePrxvoiddisconnect()Disconnects from the serveromero.api.IAdminPrxgetAdminService(SecurityContext ctx)Returns theIAdminPrxservice.omero.api.IAdminPrxgetAdminService(SecurityContext ctx, boolean secure)Returns theIAdminPrxservice.CacheServicegetCacheService()Deprecated.This method will be removed in future.omero.api.IConfigPrxgetConfigService(SecurityContext ctx)Returns theIConfigPrxservice.omero.gateway.ConnectorgetConnector(SecurityContext ctx)Get a connector for a certainSecurityContextomero.gateway.ConnectorgetConnector(SecurityContext ctx, boolean recreate, boolean permitNull)Returns the connector corresponding to the passed context.omero.api.ExporterPrxgetExporterService(SecurityContext ctx)Returns theExporterPrxservice.<T extends Facility>
TgetFacility(java.lang.Class<T> type)Get aFacilityto perform further operations with the serverome.formats.OMEROMetadataStoreClientgetImportStore(SecurityContext ctx)Creates or recycles the import store.ome.formats.OMEROMetadataStoreClientgetImportStore(SecurityContext ctx, java.lang.String userName)Creates or recycles the import store.ExperimenterDatagetLoggedInUser()Get the currently logged in useromero.log.LoggergetLogger()Provides access to theLoggeromero.api.IMetadataPrxgetMetadataService(SecurityContext ctx)Returns theIMetadataPrxservice.omero.api.IPixelsPrxgetPixelsService(SecurityContext ctx)Returns theIPixelsPrxservice.omero.api.RawPixelsStorePrxgetPixelsStore(SecurityContext ctx)Returns theRawPixelsStorePrxservice.omero.api.IContainerPrxgetPojosService(SecurityContext ctx)Returns theIContainerPrxservice.omero.api.IProjectionPrxgetProjectionService(SecurityContext ctx)Returns theIProjectionPrxservice.java.beans.PropertyChangeListener[]getPropertyChangeListeners()Get thePropertyChangeListenersomero.api.IQueryPrxgetQueryService(SecurityContext ctx)Returns theIQueryPrxservice.omero.api.RawFileStorePrxgetRawFileService(SecurityContext ctx)Returns theRawFileStorePrxservice.java.util.Map<SecurityContext,java.util.Set<java.lang.Long>>getRenderingEngines()Returns the rendering engines to re-activate.omero.api.RenderingEnginePrxgetRenderingService(SecurityContext ctx, long pixelsID)Returns theRendering service.omero.api.IRenderingSettingsPrxgetRenderingSettingsService(SecurityContext ctx)Returns theIRenderingSettingsPrxservice.omero.api.IRepositoryInfoPrxgetRepositoryService(SecurityContext ctx)Returns theIRepositoryInfoPrxservice.omero.api.IRoiPrxgetROIService(SecurityContext ctx)Returns theIRoiPrxservice.omero.api.IScriptPrxgetScriptService(SecurityContext ctx)Returns theIScriptPrxservice.omero.api.SearchPrxgetSearchService(SecurityContext ctx)Returns theSearchPrxservice.java.lang.StringgetServerHost()Get the hostname of the server the Gateway is connected tojava.lang.StringgetServerVersion()Get the version of the server the Gateway is connected tojava.lang.StringgetSessionId(ExperimenterData user)Get the ID of the current sessionomero.grid.SharedResourcesPrxgetSharedResources(SecurityContext ctx)Returns theSharedResourcesPrxservice.omero.api.ThumbnailStorePrxgetThumbnailService(SecurityContext ctx)Returns theThumbnailStorePrxservice.omero.api.ITypesPrxgetTypesService(SecurityContext ctx)Returns theITypesPrxservice.omero.api.IUpdatePrxgetUpdateService(SecurityContext ctx)Returns theIUpdatePrxservice.omero.api.IUpdatePrxgetUpdateService(SecurityContext ctx, java.lang.String userName)Returns theIUpdatePrxservice.ExperimenterDatagetUserDetails(SecurityContext ctx, java.lang.String name)Get the user details of a certain userbooleanisAlive(SecurityContext ctx)Checks if there is aConnectorfor a particularSecurityContextbooleanisConnected()Check if the Gateway is still connected to the serverbooleanisNetworkUp(boolean useCachedValue)Checks if the network interface is up.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes aPropertyChangeListeneromero.grid.ProcessCallbackIrunScript(SecurityContext ctx, long scriptID, java.util.Map<java.lang.String,omero.RType> parameters)Run a script on the servervoidshutDownDerivedConnector(SecurityContext ctx)Shuts down the connectors created while creating/importing data for other users.voidshutdownRenderingEngine(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.CmdCallbackIsubmit(SecurityContext ctx, java.util.List<omero.cmd.Request> commands, SecurityContext target)Executes the commands.omero.cmd.CmdCallbackIsubmit(SecurityContext ctx, omero.cmd.Request cmd)Directly submit aRequestto the server
-
-
-
Field Detail
-
PROP_CONNECTOR_CREATED
public static final java.lang.String PROP_CONNECTOR_CREATED
Property to indicate that aConnectorhas been created- See Also:
- Constant Field Values
-
PROP_CONNECTOR_CLOSED
public static final java.lang.String PROP_CONNECTOR_CLOSED
Property to indicate that aConnectorhas 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 aFacilityhas been created- See Also:
- Constant Field Values
-
PROP_FACILITY_CLOSED
public static final java.lang.String PROP_FACILITY_CLOSED
Property to indicate that aFacilityhas 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 useinsteadCreates a new Gateway instance- Parameters:
log- ALoggercacheService- 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 useinsteadCreates a new Gateway instance- Parameters:
log- ALoggercacheService- ACacheService, can benullexecutorService- AExecutorServicefor 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 anExecutorServicewas 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- ALoggerexecutorService- AExecutorServicefor 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 anExecutorServicewas 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
ExperimenterDatawho 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 DSOutOfServiceExceptionGet 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 DSOutOfServiceExceptionGet 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 aFacilityto 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 thePropertyChangeListeners- 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- TheSecurityContextcommands- 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 aRequestto the server- Parameters:
ctx- TheSecurityContextcmd- TheRequestto 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- TheSecurityContextuserName- 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- TheSecurityContextscriptID- 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 theSharedResourcesPrxservice.- 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 theIRenderingSettingsPrxservice.- 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 theIRepositoryInfoPrxservice.- 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 theIScriptPrxservice.- 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 theIContainerPrxservice.- 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 theIQueryPrxservice.- 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 theIUpdatePrxservice.- 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 theIUpdatePrxservice.- Parameters:
ctx- TheSecurityContextuserName- 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 theIMetadataPrxservice.- 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 theIRoiPrxservice.- 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 theIConfigPrxservice.- 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 theThumbnailStorePrxservice.- 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 theExporterPrxservice.- 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 theRawFileStorePrxservice.- 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 theRawPixelsStorePrxservice.- 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 theIPixelsPrxservice.- 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 theSearchPrxservice.- 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 theIProjectionPrxservice.- 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 theIAdminPrxservice.- 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 theIAdminPrxservice.- Parameters:
ctx- TheSecurityContextsecure- Passtrueto have a secure admin service,falseotherwise.- 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- TheSecurityContextuserName- 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- TheSecurityContextpixelsID- 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- TheSecurityContextname- 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- Passfalseto not close the session on disconnect
-
closeService
public void closeService(SecurityContext ctx, omero.api.StatefulServiceInterfacePrx svc)
Close a service- Parameters:
ctx- TheSecurityContextsvc- 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 aConnectorfor a particularSecurityContext- Parameters:
ctx- TheSecurityContext- Returns:
trueif there is one,falseotherwise- 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. ADSOutOfServiceExceptionis thrown if this is set to false and noConnectoris available.permitNull- whether or not to throw aDSOutOfServiceExceptionif noConnectoris 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- TheSecurityContextpixelsID- The pixels id
-
getTypesService
public omero.api.ITypesPrx getTypesService(SecurityContext ctx) throws DSOutOfServiceException
Returns theITypesPrxservice.- 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- theSecurityContextto use for the query- Returns:
trueif the server is wholly in read-write mode,falseif 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:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
-