Package ome.services.blitz.impl
Class ServiceFactoryI
- java.lang.Object
-
- omero.cmd.SessionI
-
- ome.services.blitz.impl.ServiceFactoryI
-
- All Implemented Interfaces:
Glacier2._SessionOperations,_ServiceFactoryOperations,_SessionOperations
public final class ServiceFactoryI extends SessionI implements _ServiceFactoryOperations
Responsible for maintaining all servants for a single session. In general, try to reduce access to theCurrentandUtilobjects.- Since:
- 3.0-Beta2
-
-
Constructor Summary
Constructors Constructor Description ServiceFactoryI(boolean reusedSession, Ice.Current current, ServantHolder holder, Glacier2.SessionControlPrx control, ome.system.OmeroContext context, ome.services.sessions.SessionManager manager, ome.services.util.Executor executor, ome.system.Principal p, java.util.List<ome.logic.HardWiredInterceptor> interceptors, TopicManager topicManager, Registry registry, java.lang.String token)ServiceFactoryI(Ice.Current current, ServantHolder holder, Glacier2.SessionControlPrx control, ome.system.OmeroContext context, ome.services.sessions.SessionManager manager, ome.services.util.Executor executor, ome.system.Principal p, java.util.List<ome.logic.HardWiredInterceptor> interceptors, TopicManager topicManager, Registry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>activeServices(Ice.Current __current)Returns a list of string ids for currently active services.voidcloseOnDestroy(Ice.Current current)Marks the session for closure rather than detachment, which will be triggered by the destruction of the Glacier2 connection via router.destroySession() Closing the session rather the detaching is more secure, since all resources are removed from the server and can safely be set once it is clear that a client is finished with those resources.StatefulServiceInterfacePrxcreateByName(java.lang.String name, Ice.Current current)Allows looking up any stateful service by name.StatefulServiceInterfacePrxcreateByName(java.lang.String name, Ice.Current current, boolean allowGuest)ExporterPrxcreateExporter(Ice.Current current)JobHandlePrxcreateJobHandle(Ice.Current current)RawFileStorePrxcreateRawFileStore(Ice.Current current)RawPixelsStorePrxcreateRawPixelsStore(Ice.Current current)RenderingEnginePrxcreateRenderingEngine(Ice.Current current)SearchPrxcreateSearchService(Ice.Current current)ThumbnailStorePrxcreateThumbnailStore(Ice.Current current)voiddetachOnDestroy(Ice.Current current)Marks the session for detachment rather than closure, which will be triggered by the destruction of the Glacier2 connection via router.destroySession() This is the default and allows a lost session to be reconnected, at a slight security cost since the session will persist longer and can be used by others if the UUID is intercepted.IAdminPrxgetAdminService(Ice.Current current)ServiceInterfacePrxgetByName(java.lang.String blankname, Ice.Current dontUse)Allows looking up any stateless service by name.ServiceInterfacePrxgetByName(java.lang.String blankname, Ice.Current dontUse, boolean allowGuest)IConfigPrxgetConfigService(Ice.Current current)IContainerPrxgetContainerService(Ice.Current current)ome.system.EventContextgetEventContext()Doesn't take current into accountome.system.EventContextgetEventContext(Ice.Current current)Takes current into accountILdapPrxgetLdapService(Ice.Current current)IMetadataPrxgetMetadataService(Ice.Current current)IPixelsPrxgetPixelsService(Ice.Current current)IProjectionPrxgetProjectionService(Ice.Current current)IQueryPrxgetQueryService(Ice.Current current)IRenderingSettingsPrxgetRenderingSettingsService(Ice.Current current)IRepositoryInfoPrxgetRepositoryInfoService(Ice.Current current)IRoiPrxgetRoiService(Ice.Current current)IScriptPrxgetScriptService(Ice.Current current)java.util.List<IObject>getSecurityContexts(Ice.Current __current)Provides a list of all valid security contexts for this session.java.lang.ObjectgetServant(Ice.Identity id)ISessionPrxgetSessionService(Ice.Current current)ISharePrxgetShareService(Ice.Current current)java.lang.StringgetStatefulServiceCount()NB: Much of the logic here is similar toSessionI.doCloseand should be pushed down.Ice.TieBasegetTie(Ice.Identity id)ITimelinePrxgetTimelineService(Ice.Current current)ITypesPrxgetTypesService(Ice.Current current)IUpdatePrxgetUpdateService(Ice.Current current)protected ServerErrorhandleException(java.lang.Throwable t)protected voidinternalServantConfig(java.lang.Object obj)booleankeepAlive(ServiceInterfacePrx proxy, Ice.Current __current)Currently ignoring the individual proxieslongkeepAllAlive(ServiceInterfacePrx[] proxies, Ice.Current __current)Requests that the given services be marked as alive.ServiceFactoryPrxproxy()voidsetCallback(ClientCallbackPrx callback, Ice.Current current)Sets the single callback used by the ServiceFactory to communicate with the client application.IObjectsetSecurityContext(IObject obj, Ice.Current __current)Changes the security context for the current session.voidsetSecurityPassword(java.lang.String password, Ice.Current __current)Re-validates the password for the current session.SharedResourcesPrxsharedResources(Ice.Current current)Returns a reference to a back-end manager.voidsubscribe(java.lang.String topicName, Ice.ObjectPrx prx, Ice.Current __current)Subscribe to a given topic.-
Methods inherited from class omero.cmd.SessionI
allow, callContextWrapper, cleanServants, cleanServants, cleanupSelf, clientId, configureServant, createServantDelegate, destroy, doDestroy, getAdapter, getExecutor, getIdentity, getPrincipal, handleCallbackException, newCurrent, newCurrent, registerServant, registerServant, sessionId, sessionId, submit_async, submit_async, toString, unregisterServant, unregisterServant
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface omero.cmd._SessionOperations
submit_async
-
-
-
-
Constructor Detail
-
ServiceFactoryI
public ServiceFactoryI(Ice.Current current, ServantHolder holder, Glacier2.SessionControlPrx control, ome.system.OmeroContext context, ome.services.sessions.SessionManager manager, ome.services.util.Executor executor, ome.system.Principal p, java.util.List<ome.logic.HardWiredInterceptor> interceptors, TopicManager topicManager, Registry registry) throws ApiUsageException- Throws:
ApiUsageException
-
ServiceFactoryI
public ServiceFactoryI(boolean reusedSession, Ice.Current current, ServantHolder holder, Glacier2.SessionControlPrx control, ome.system.OmeroContext context, ome.services.sessions.SessionManager manager, ome.services.util.Executor executor, ome.system.Principal p, java.util.List<ome.logic.HardWiredInterceptor> interceptors, TopicManager topicManager, Registry registry, java.lang.String token) throws ApiUsageException- Throws:
ApiUsageException
-
-
Method Detail
-
proxy
public ServiceFactoryPrx proxy()
-
getSecurityContexts
public java.util.List<IObject> getSecurityContexts(Ice.Current __current) throws ServerError
Description copied from interface:_ServiceFactoryOperationsProvides a list of all valid security contexts for this session. Each of the returnedIObjectinstances can be passed tosetSecurityContext.- Specified by:
getSecurityContextsin interface_ServiceFactoryOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
setSecurityContext
public IObject setSecurityContext(IObject obj, Ice.Current __current) throws ServerError
Description copied from interface:_ServiceFactoryOperationsChanges the security context for the current session.A security context limits the set of objects which will be returned by all queries and restricts what updates can be made.
Current valid values for security context:
ExperimenterGroup- logs into a specific groupShare- uses IShare to activate a share
Passing an unloaded version of either object type will change the way the current session operates. Note: only objects which are returned by the
getSecurityContextmethod are considered valid. Any other instance will cause an exception to be thrown.Example usage in Python:
sf = client.createSession() objs = sf.getSecurityContexts() old = sf.setSecurityContext(objs\[-1])
- Specified by:
setSecurityContextin interface_ServiceFactoryOperations__current- The Current object for the invocation.- Throws:
ServerError
-
setSecurityPassword
public void setSecurityPassword(java.lang.String password, Ice.Current __current) throws ServerErrorDescription copied from interface:_ServiceFactoryOperationsRe-validates the password for the current session. This prevents See methods that mention "HasPassword".- Specified by:
setSecurityPasswordin interface_ServiceFactoryOperations__current- The Current object for the invocation.- Throws:
ServerError
-
handleException
protected ServerError handleException(java.lang.Throwable t)
-
getAdminService
public IAdminPrx getAdminService(Ice.Current current) throws ServerError
- Specified by:
getAdminServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getConfigService
public IConfigPrx getConfigService(Ice.Current current) throws ServerError
- Specified by:
getConfigServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getLdapService
public ILdapPrx getLdapService(Ice.Current current) throws ServerError
- Specified by:
getLdapServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getPixelsService
public IPixelsPrx getPixelsService(Ice.Current current) throws ServerError
- Specified by:
getPixelsServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getContainerService
public IContainerPrx getContainerService(Ice.Current current) throws ServerError
- Specified by:
getContainerServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getProjectionService
public IProjectionPrx getProjectionService(Ice.Current current) throws ServerError
- Specified by:
getProjectionServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getQueryService
public IQueryPrx getQueryService(Ice.Current current) throws ServerError
- Specified by:
getQueryServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getRoiService
public IRoiPrx getRoiService(Ice.Current current) throws ServerError
- Specified by:
getRoiServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getScriptService
public IScriptPrx getScriptService(Ice.Current current) throws ServerError
- Specified by:
getScriptServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getSessionService
public ISessionPrx getSessionService(Ice.Current current) throws ServerError
- Specified by:
getSessionServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getShareService
public ISharePrx getShareService(Ice.Current current) throws ServerError
- Specified by:
getShareServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getTimelineService
public ITimelinePrx getTimelineService(Ice.Current current) throws ServerError
- Specified by:
getTimelineServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getTypesService
public ITypesPrx getTypesService(Ice.Current current) throws ServerError
- Specified by:
getTypesServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getUpdateService
public IUpdatePrx getUpdateService(Ice.Current current) throws ServerError
- Specified by:
getUpdateServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getRenderingSettingsService
public IRenderingSettingsPrx getRenderingSettingsService(Ice.Current current) throws ServerError
- Specified by:
getRenderingSettingsServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getRepositoryInfoService
public IRepositoryInfoPrx getRepositoryInfoService(Ice.Current current) throws ServerError
- Specified by:
getRepositoryInfoServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
getMetadataService
public IMetadataPrx getMetadataService(Ice.Current current) throws ServerError
- Specified by:
getMetadataServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
createExporter
public ExporterPrx createExporter(Ice.Current current) throws ServerError
- Specified by:
createExporterin interface_ServiceFactoryOperations- Throws:
ServerError
-
createJobHandle
public JobHandlePrx createJobHandle(Ice.Current current) throws ServerError
- Specified by:
createJobHandlein interface_ServiceFactoryOperations- Throws:
ServerError
-
createRenderingEngine
public RenderingEnginePrx createRenderingEngine(Ice.Current current) throws ServerError
- Specified by:
createRenderingEnginein interface_ServiceFactoryOperations- Throws:
ServerError
-
createRawFileStore
public RawFileStorePrx createRawFileStore(Ice.Current current) throws ServerError
- Specified by:
createRawFileStorein interface_ServiceFactoryOperations- Throws:
ServerError
-
createRawPixelsStore
public RawPixelsStorePrx createRawPixelsStore(Ice.Current current) throws ServerError
- Specified by:
createRawPixelsStorein interface_ServiceFactoryOperations- Throws:
ServerError
-
createSearchService
public SearchPrx createSearchService(Ice.Current current) throws ServerError
- Specified by:
createSearchServicein interface_ServiceFactoryOperations- Throws:
ServerError
-
createThumbnailStore
public ThumbnailStorePrx createThumbnailStore(Ice.Current current) throws ServerError
- Specified by:
createThumbnailStorein interface_ServiceFactoryOperations- Throws:
ServerError
-
sharedResources
public SharedResourcesPrx sharedResources(Ice.Current current) throws ServerError
Description copied from interface:_ServiceFactoryOperationsReturns a reference to a back-end manager. TheSharedResourcesservice provides look ups for various facilities offered by OMERO: These facilities may or may not be available on first request.- Specified by:
sharedResourcesin interface_ServiceFactoryOperations- Parameters:
current- The Current object for the invocation.- Throws:
ServerError- See Also:
SharedResources
-
getTie
public Ice.TieBase getTie(Ice.Identity id)
-
getServant
public java.lang.Object getServant(Ice.Identity id)
-
getByName
public ServiceInterfacePrx getByName(java.lang.String blankname, Ice.Current dontUse) throws ServerError
Description copied from interface:_ServiceFactoryOperationsAllows looking up any stateless service by name. See Constants.ice for examples of services. If a service has been added by third-parties, getByName can be used even though no concrete method is available.- Specified by:
getByNamein interface_ServiceFactoryOperationsdontUse- The Current object for the invocation.- Throws:
ServerError
-
getByName
public ServiceInterfacePrx getByName(java.lang.String blankname, Ice.Current dontUse, boolean allowGuest) throws ServerError
- Throws:
ServerError
-
createByName
public StatefulServiceInterfacePrx createByName(java.lang.String name, Ice.Current current) throws ServerError
Description copied from interface:_ServiceFactoryOperationsAllows looking up any stateful service by name. See Constants.ice for examples of services. If a service has been added by third-parties, createByName can be used even though no concrete method is available.- Specified by:
createByNamein interface_ServiceFactoryOperationscurrent- The Current object for the invocation.- Throws:
ServerError
-
createByName
public StatefulServiceInterfacePrx createByName(java.lang.String name, Ice.Current current, boolean allowGuest) throws ServerError
- Throws:
ServerError
-
subscribe
public void subscribe(java.lang.String topicName, Ice.ObjectPrx prx, Ice.Current __current) throws ServerErrorDescription copied from interface:_ServiceFactoryOperationsSubscribe to a given topic. The topic must exist and the user must have sufficient permissions for that topic. Further the proxy object must match the required type for the topic as encoded in the topic name.- Specified by:
subscribein interface_ServiceFactoryOperations__current- The Current object for the invocation.- Throws:
ServerError
-
setCallback
public void setCallback(ClientCallbackPrx callback, Ice.Current current) throws ServerError
Description copied from interface:_ServiceFactoryOperationsSets the single callback used by the ServiceFactory to communicate with the client application. A default callback is set by the omero::client object on session creation which should suffice for most usage. See the client object's documentation in each language mapping for ways to use the callback.- Specified by:
setCallbackin interface_ServiceFactoryOperationscurrent- The Current object for the invocation.- Throws:
ServerError
-
detachOnDestroy
public void detachOnDestroy(Ice.Current current)
Description copied from interface:_ServiceFactoryOperationsMarks the session for detachment rather than closure, which will be triggered by the destruction of the Glacier2 connection via router.destroySession() This is the default and allows a lost session to be reconnected, at a slight security cost since the session will persist longer and can be used by others if the UUID is intercepted.- Specified by:
detachOnDestroyin interface_ServiceFactoryOperations- Parameters:
current- The Current object for the invocation.
-
closeOnDestroy
public void closeOnDestroy(Ice.Current current)
Description copied from interface:_ServiceFactoryOperationsMarks the session for closure rather than detachment, which will be triggered by the destruction of the Glacier2 connection via router.destroySession() Closing the session rather the detaching is more secure, since all resources are removed from the server and can safely be set once it is clear that a client is finished with those resources.- Specified by:
closeOnDestroyin interface_ServiceFactoryOperations- Parameters:
current- The Current object for the invocation.
-
getStatefulServiceCount
public java.lang.String getStatefulServiceCount()
NB: Much of the logic here is similar toSessionI.doCloseand should be pushed down.
-
activeServices
public java.util.List<java.lang.String> activeServices(Ice.Current __current)
Description copied from interface:_ServiceFactoryOperationsReturns a list of string ids for currently active services. This will _not_ keep services alive, and in fact checks for all expired services and removes them.- Specified by:
activeServicesin interface_ServiceFactoryOperations- Parameters:
__current- The Current object for the invocation.
-
getEventContext
public ome.system.EventContext getEventContext()
Doesn't take current into account
-
getEventContext
public ome.system.EventContext getEventContext(Ice.Current current)
Takes current into account
-
keepAllAlive
public long keepAllAlive(ServiceInterfacePrx[] proxies, Ice.Current __current) throws ServerError
Description copied from interface:_ServiceFactoryOperationsRequests that the given services be marked as alive. It is possible that one of the services has already timed out, in which case the returned long value will be non-zero. Specifically, the bit representing the 0-based index will be 1:if (retval & 1<<idx == 1<<idx) { // not alive }Except for fatal server or session errors, this method should never throw an exception.- Specified by:
keepAllAlivein interface_ServiceFactoryOperations__current- The Current object for the invocation.- Throws:
ServerError
-
keepAlive
public boolean keepAlive(ServiceInterfacePrx proxy, Ice.Current __current) throws ServerError
Currently ignoring the individual proxies- Specified by:
keepAlivein interface_ServiceFactoryOperations__current- The Current object for the invocation.- Throws:
ServerError
-
internalServantConfig
protected void internalServantConfig(java.lang.Object obj) throws ServerError- Overrides:
internalServantConfigin classSessionI- Throws:
ServerError
-
-