Class MultiplexingClientService

All Implemented Interfaces:
ADEPT2Service, AuthenticatingService, LogService, NameResolution, ServiceAccess, ServiceThreadHandling, CapabilityChecker, ActivityManagerService, ADEPT2ClientService, AdministrationService, ClientService, ExecutionClientService, LocalExecutionClientService, ModellingClientService, RemoteClient, RemoteExecutionClientService, WorklistClientService, ModelViewerProvider

@ConfigurationDescription(properties={@Property(name="ExecutorPoolSize",type=INT,defaultValue="10",description="The amount of threads used for the shared executor service."),,,}) public abstract class MultiplexingClientService extends AbstractAuthenticatedService implements ADEPT2ClientService
The MultiplexingClientService is a broker for service requests from various web clients. It manages several client service, one client service per user. A user-specific client service is created each time a user logs on. All requests for this user are then forwarded to the appropriate client service. However, some methods of this multiplexing service are not user-specific but global. This is stated in the documentation of these methods.

Implementations of this class need to map a user request (that is the current thread) to a string representing the user request (for instance the session ID of a HTTP-request or RAP). This can be achieved by registering the session ID for the current string when retrieving the corresponding request and deregistering it before finishing the request handling.
If the user session is not registered, most methods will throw an IllegalStateException.
Note that implementations of this class need a public constructor accepting a Configuration and a Registry.

  • Field Details

    • sessionServiceMapping

      protected final Map<String,ADEPT2ClientService> sessionServiceMapping
      Mapping between a user-session-ID and an ADEPT2 client service.
    • activeAgentLock

      protected final ReadWriteLock activeAgentLock
      The lock for synchronising all access concerning the active agent, which is mainly sessionServiceMapping.
  • Constructor Details

    • MultiplexingClientService

      public MultiplexingClientService(Configuration configuration, Registry registry) throws ConfigurationException
      Creates a MultiplexingClientService with the designated registry, a logger for this and the designated required services.
      Parameters:
      configuration - The configuration providing the logon credentials for this service.
      registry - The registry to be used for accessing services by this service. This is provided as parameter to the constructor when creating a service.
      Throws:
      ConfigurationException - If the password for this authenticated service cannot be parsed from the configuration, a ConfigurationException will be thrown.
  • Method Details

    • init

      public void init(URI[] localExportedUris, URI[] globalExportedUris) throws AbortServiceException
      Description copied from class: AbstractAuthenticatedService
      Copies the designated URI array and stores it internally and authenticates to the system and sets the session factory.
      This method can be called any time in overriding init-methods.

      In case of an early service, this will not authenticate to the system! Such a service need to AbstractAuthenticatedService.authenticateService() later when the security manager is available.

      Specified by:
      init in interface ADEPT2Service
      Overrides:
      init in class AbstractAuthenticatedService
      Parameters:
      localExportedUris - The URIs with which this service is exported locally or a local URI or an empty array for internal services.
      globalExportedUris - The URIs with which this service is published globally or null in case the service is not published.
      Throws:
      AbortServiceException - If authenticating at the security manager fails, an AbortServiceException will be thrown.
    • start

      public void start() throws AbortServiceException
      Description copied from class: AbstractADEPT2Service
      Method setting the status to the current time. Subclasses have to call this method!
      Specified by:
      start in interface ADEPT2Service
      Overrides:
      start in class AbstractADEPT2Service
      Throws:
      AbortServiceException - If this service cannot be started due to a severe problem, an AbortServiceException will be thrown. ADEPT2Service.shutdown(boolean) will not be called when aborting; the service has to shut down itself/clean up before throwing the exception.
    • shutdown

      public void shutdown(boolean emergency)
      Description copied from class: AbstractAuthenticatedService
      Awaits the termination of the active sessions and nulls the session factory.
      Specified by:
      shutdown in interface ADEPT2Service
      Overrides:
      shutdown in class AbstractAuthenticatedService
      Parameters:
      emergency - Whether the shutdown will be an emergency shutdown.
    • getAvailableLocales

      public Locale[] getAvailableLocales()
      Gets the locales the client supports, that is, the locales found as resources. This allows the user to choose an appropriate one in case the client does not have the locale the user prefers. The locales are global with respect to all client services, that is there is one array of locales for all user sessions.
      Specified by:
      getAvailableLocales in interface ClientService
      Returns:
      The locales available for the client.
    • getExecutorService

      public ExecutorService getExecutorService()
      Gets an ExecutorService for executing long lasting tasks asynchronously. Please do not start own threads but use this executor service instead otherwise the shutdown of the client will not work correctly since the threads cannot be reached. However, if you do, you will be responsible for terminating the threads correctly when shutting down.
      The returned service must not be shutdown; this is done by implementations of the client service. Additionally, it must not be configured since it is re-used for all users of the client service. The executor service is global with respect to all client services, that is there is only one for all user sessions.
      Specified by:
      getExecutorService in interface ClientService
      Returns:
      An ExecutorService for executing long lasting task asynchronously instead of creating own (local) threads.
    • getScheduledExecutorService

      public LoggingScheduledThreadPoolExecutor getScheduledExecutorService()
      Gets a ScheduledExecutorService for scheduling long lasting tasks asynchronously. Please do not start own threads but use this executor service instead otherwise the shutdown of the client will not work correctly since the threads cannot be reached. However, if you do, you will be responsible for terminating the threads correctly when shutting down.
      The returned service must not be shutdown; this is done by implementations of the client service. Additionally, it must not be configured since it is re-used for all users of the client service. The scheduled executor service is global with respect to all client services, that is there is only one for all user sessions.
      Specified by:
      getScheduledExecutorService in interface ClientService
      Returns:
      A ScheduledExecutorService for scheduling long lasting task asynchronously instead of creating own (local) threads.
    • isConnected

      public boolean isConnected(String serviceName)
      Description copied from interface: ClientService
      Returns whether this client is connected to the designated service or not. If the client is not connected, the corresponding (AristaFlow-)service (managers) will be available. Components using this service have to adhere to this. A ClientService.connectAll() can be tried, but this need not be successful. If the component could work offline, it should do so without accessing any server logic. Otherwise the component would have to terminate.
      Specified by:
      isConnected in interface ClientService
      Parameters:
      serviceName - The name of the service of which to check whether this client service is connected to.
      Returns:
      Whether this client is connected to the designated AristaFlow-service.
    • connectAll

      public boolean connectAll()
      Description copied from interface: ClientService
      Tries to connect this client service to all AristaFlow-services. Whether connecting has been successful will be indicated by the return value.
      Connecting an online client is a no-op.
      Specified by:
      connectAll in interface ClientService
      Returns:
      Whether connecting to the AristaFlow-services has been successful and the client is online now.
    • disconnectAll

      public void disconnectAll()
      Description copied from interface: ClientService
      Disconnects this client service from the AristaFlow-services. This does all the cleanup necessary when disconnecting, for instance logging off from the appropriate server-side services. However, the client (service) will not be shut down. This is done via the registry and incorporates logging off and shutting down local services.
      Disconnecting an offline client is a no-op.
      Specified by:
      disconnectAll in interface ClientService
    • addServiceStateListener

      public boolean addServiceStateListener(ADEPT2Service service, ClientService.ServiceStateListener listener)
      Description copied from interface: ClientService
      Registers a listener to be informed about a change in the availability of an ADEPT2Service.
      Specified by:
      addServiceStateListener in interface ClientService
      Parameters:
      service - The service for which to be informed about its availability.
      listener - The instance which to notify in case the availability of the designated service changes.
      Returns:
      Whether the designated service is currently available.
    • removeServiceStateListener

      public void removeServiceStateListener(ADEPT2Service service, ClientService.ServiceStateListener listener)
      Description copied from interface: ClientService
      Removes a listener from further notifications of the designated ADEPT2Service.
      Specified by:
      removeServiceStateListener in interface ClientService
      Parameters:
      service - The service for which to no longer be informed about its availability.
      listener - The instance which to remove from availability notifications.
    • logoff

      public void logoff()
      Logs the agent (that is with all organisational positions) off and invalidates the session factories. Afterwards no session token can be created any more.
      Active agent listeners will be notified with null as active agent. This removes the GUI manager of the current user session and shuts down and removes the corresponding client service.
      Specified by:
      logoff in interface ClientService
    • getSessionToken

      public SessionToken getSessionToken()
      Description copied from interface: ADEPT2ClientService
      Gets a session token for currently active agent and the URIs of this client.
      Specified by:
      getSessionToken in interface ADEPT2ClientService
      Specified by:
      getSessionToken in interface ClientService
      Returns:
      A session token for the currently active agent and the URIs of this client.
      See Also:
    • getSessionToken

      public SessionToken getSessionToken(Map<String,String> additionalAttributes)
      Description copied from interface: ClientService
      Gets a session token for currently active agent and the URIs of this client having the designated additional attributes.
      Specified by:
      getSessionToken in interface ClientService
      Parameters:
      additionalAttributes - Additional attributes which are provided by the created session token. This may be null.
      Returns:
      A session token for the currently active agent having the designated additional attributes and the URIs of this client or null in case no agent is active.
      See Also:
    • getSessionToken

      public SessionToken getSessionToken(QualifiedAgent agent)
      Description copied from interface: ClientService
      Gets a session token for the designated agent ignoring the currently active agent. If the designated agent is not logged on, an IllegalArgumentException will be thrown.
      Specified by:
      getSessionToken in interface ClientService
      Parameters:
      agent - The agent to retrieve a session token for.
      Returns:
      A session token for the designated agent.
    • getSessionToken

      public SessionToken getSessionToken(QualifiedAgent agent, Map<String,String> additionalAttributes)
      Description copied from interface: ClientService
      Gets a session token for the designated agent ignoring the currently active agent having the designated additional attributes. If the designated agent is not logged on, an IllegalArgumentException will be thrown.
      Specified by:
      getSessionToken in interface ClientService
      Parameters:
      agent - The agent to retrieve a session token for.
      additionalAttributes - Additional attributes which are provided by the created session token. This may be null.
      Returns:
      A session token for the designated agent having the designated additional attributes.
    • getFilterFactory

      public FilterFactory getFilterFactory()
      Description copied from interface: ADEPT2ClientService
      CL_ARCH client service documentation
      Specified by:
      getFilterFactory in interface ADEPT2ClientService
      Specified by:
      getFilterFactory in interface ClientService
      Returns:
      The factory for creating filters for models for this client.
    • getLocalisationFactory

      public LocalisationFactory getLocalisationFactory()
      Description copied from interface: ClientService
      Gets the localisation factory.
      Specified by:
      getLocalisationFactory in interface ClientService
      Returns:
      the localisation factory
    • getFormatterFactory

      public SystemDataFormatterFactory getFormatterFactory()
      Description copied from interface: ClientService
      Gets the system data formatter factory.
      Specified by:
      getFormatterFactory in interface ClientService
      Returns:
      the system data formatter factory
    • getGraphicalModelFactory

      public GraphicalModelFactory getGraphicalModelFactory()
      Description copied from interface: ADEPT2ClientService
      CL_ARCH client service documentation
      Specified by:
      getGraphicalModelFactory in interface ADEPT2ClientService
      Returns:
      The factory for creating graphical model elements for this client.
    • getInitTabFactory

      public InitTabFactory getInitTabFactory()
      Specified by:
      getInitTabFactory in interface AdministrationService
    • setAuthenticatedAgents

      public void setAuthenticatedAgents(ClientSessionFactory... csf)
      Sets the client session factories for this service which provide the session tokens for the using components. This method must only be called by the component managing the logon/logoff. The session factories have to be the ones provided by the authentication (Authentication.authenticate(String, long, String)). This method is client-session-specific. When setting the agents, a new client service will be created for the current user session and stored internally. All further user-session-specific calls to this service will be forwarded to this client service.
      There has to be a session ID registered before calling this method! Additionally the very same session ID has to be used when retrieving the designated client session factory via Authentication.
      Specified by:
      setAuthenticatedAgents in interface ClientService
      Parameters:
      csf - The client session factories provided when authenticating.
    • agentsChanged

      public RichAgent[] agentsChanged(QualifiedAgent... agents)
      Description copied from interface: ClientService
      Signals this client service that the designated agents changed. Implementations should do best effort to update the corresponding client session factory. If one of the designated agents is unknown by this client service, it will be ignored.
      Specified by:
      agentsChanged in interface ClientService
      Parameters:
      agents - The agents that have changed on the server.
      Returns:
      The designated agents which have been updated by this client service.
    • getAuthenticatedAgents

      public RichAgent[] getAuthenticatedAgents()
      Description copied from interface: ADEPT2ClientService
      Gets all authenticated agents of this clients usually this is one agent holding multiple organisational positions.
      Specified by:
      getAuthenticatedAgents in interface ADEPT2ClientService
      Specified by:
      getAuthenticatedAgents in interface ClientService
      Returns:
      All authenticated agents of this client.
    • getActiveAgent

      public RichAgent getActiveAgent()
      Description copied from interface: ADEPT2ClientService
      Gets the currently active agent. This is normally determined by a drop-down list or the active worklist if worklists are position-specific.
      Specified by:
      getActiveAgent in interface ADEPT2ClientService
      Specified by:
      getActiveAgent in interface ClientService
      Returns:
      The currently active agent.
      See Also:
    • getActiveClientSessionFactory

      public ClientSessionFactory getActiveClientSessionFactory()
      Description copied from interface: ClientService
      Gets the client session factory of the currently active agent.
      Specified by:
      getActiveClientSessionFactory in interface ClientService
      Returns:
      The client session factory of the currently active agent or null in case no agent is logged on.
    • setActiveAgent

      public void setActiveAgent(QualifiedAgent activeAgent)
      Description copied from interface: ClientService
      Sets the currently active agent. This is either determined by a drop-down list or the active worklist if worklists are position-specific. All registered listeners will be notified (asynchronously) about this.
      Specified by:
      setActiveAgent in interface ClientService
      Parameters:
      activeAgent - The currently active agent, this must not be null.
    • addActiveAgentListener

      public void addActiveAgentListener(ClientService.ActiveAgentChangedListener listener)
      Description copied from interface: ClientService
      Adds the listener to receive events when the active agent has been changed.
      Specified by:
      addActiveAgentListener in interface ClientService
      Parameters:
      listener - The listener to receive events when the active agent has been changed.
    • removeActiveAgentListener

      public void removeActiveAgentListener(ClientService.ActiveAgentChangedListener listener)
      Description copied from interface: ClientService
      Removes the listener to receive events when the active agent has been changed.
      Specified by:
      removeActiveAgentListener in interface ClientService
      Parameters:
      listener - The active agent listener to remove.
    • guiSelectionChanged

      public void guiSelectionChanged(SelectedGUIElementChangedEvent selectionChangeEvent)
      Description copied from interface: ClientService
      This method informs all interested listeners about a change in the currently selected graphical representation of a model element, for instance, selecting an instance from a list of instances or the GUI element that displays the user interface of a process step and thus represents a (running) EBP-instance.

      Implementations for the GUI element tracking should respect the order in which events are retrieved. Otherwise it may happen that some UI elements display an old event which has been signalled after a newer event.

      Specified by:
      guiSelectionChanged in interface ClientService
      Parameters:
      selectionChangeEvent - The event containing information like the selected element as well as the source of the event.
    • addGUIListener

      public void addGUIListener(SelectedGUIElementChangedListener selectedElementChangedListener)
      Description copied from interface: ClientService
      Registers a listener to be informed about a change in the currently selected GUI element representing a model element.
      Specified by:
      addGUIListener in interface ClientService
      Parameters:
      selectedElementChangedListener - The listener to be informed about a change in the currently selected GUI element representing a model element.
    • removeGUIListener

      public void removeGUIListener(SelectedGUIElementChangedListener selectedElementChangedListener)
      Description copied from interface: ClientService
      Removes a listener from further notifications of the selected GUI element.
      Specified by:
      removeGUIListener in interface ClientService
      Parameters:
      selectedElementChangedListener - The listener not to be informed any more about GUI selection changes.
    • getUpdateManager

      public UpdateManager getUpdateManager()
      Description copied from interface: ADEPT2ClientService
      Gets the update manager which informs about changes in process objects. This is only an intermediate solution. For now, only a local update manager will be returned since there is no server-side update manager.
      Specified by:
      getUpdateManager in interface ADEPT2ClientService
      Specified by:
      getUpdateManager in interface AdministrationService
      Specified by:
      getUpdateManager in interface ModellingClientService
      Returns:
      The (local) update manager for this client.
    • getAuthentication

      public Authentication getAuthentication()
      Description copied from interface: ClientService
      Gets the manager that handles authentication for the users of this client.
      Specified by:
      getAuthentication in interface ClientService
      Returns:
      The manager handling authentication for the users of this client.
    • hasOneCapability

      public boolean hasOneCapability(SessionToken sessionToken, String... capabilities) throws SecurityTokenIntegrityException
      Description copied from interface: CapabilityChecker
      Checks the integrity of the (security token of the) designated session token and returns whether the (security token of the) designated session has at least one of the designated capabilities.
      Specified by:
      hasOneCapability in interface CapabilityChecker
      Parameters:
      sessionToken - The session token of which to check the integrity and to return the capability of.
      capabilities - One ore more strings representing the capability/capabilities of the function the owner of this token wants to perform.
      Returns:
      Whether the (security token of the) designated session has at least one of the designated capabilities.
      Throws:
      SecurityTokenIntegrityException - If the designated session token has no integrity, a SecurityTokenIntegrityException will be thrown.
      See Also:
    • hasOneTopLevelCapability

      public boolean hasOneTopLevelCapability(SessionToken sessionToken, String... capabilities) throws SecurityTokenIntegrityException
      Description copied from interface: CapabilityChecker
      Checks the integrity of the (security token of the) top-level session of the designated session token and returns whether the (security token of the) top-level session of the designated session has at least one of the designated capabilities.
      Specified by:
      hasOneTopLevelCapability in interface CapabilityChecker
      Parameters:
      sessionToken - The session token of which to check the integrity and to return the capability of the corresponding top-level session token.
      capabilities - One or more strings representing the capability/capabilities of the function the owner of the top-level session token wants to perform.
      Returns:
      Whether the (security token of the) top-level parent session of the designated session has at least one of the designated capabilities.
      Throws:
      SecurityTokenIntegrityException - If the top-level parent session of the designated session token has no integrity, a SecurityTokenIntegrityException will be thrown.
      See Also:
    • hasAllCapabilities

      public boolean hasAllCapabilities(SessionToken sessionToken, String... capabilities) throws SecurityTokenIntegrityException
      Description copied from interface: CapabilityChecker
      Checks the integrity of the (security token of the) designated session token and returns whether the (security token of the) designated session has all of the designated capabilities.
      Specified by:
      hasAllCapabilities in interface CapabilityChecker
      Parameters:
      sessionToken - The session token of which to check the integrity and to return the capability of.
      capabilities - One ore more strings representing the capability/capabilities of the function the owner of this token wants to perform.
      Returns:
      Whether the (security token of the) designated session has all of the designated capabilities.
      Throws:
      SecurityTokenIntegrityException - If the designated session token has no integrity, a SecurityTokenIntegrityException will be thrown.
      See Also:
    • hasAllTopLevelCapabilities

      public boolean hasAllTopLevelCapabilities(SessionToken sessionToken, String... capabilities) throws SecurityTokenIntegrityException
      Description copied from interface: CapabilityChecker
      Checks the integrity of the (security token of the) top-level session of the designated session token and returns whether the (security token of the) top-level session of the designated session has all of the designated capabilities.
      Specified by:
      hasAllTopLevelCapabilities in interface CapabilityChecker
      Parameters:
      sessionToken - The session token of which to check the integrity and to return the capability of the corresponding top-level session token.
      capabilities - One or more strings representing the capability/capabilities of the function the owner of the top-level session token wants to perform.
      Returns:
      Whether the (security token of the) top-level parent session of the designated session has all of the designated capabilities.
      Throws:
      SecurityTokenIntegrityException - If the top-level parent session of the designated session token has no integrity, a SecurityTokenIntegrityException will be thrown.
      See Also:
    • getLicenceManager

      public LicenceManager getLicenceManager() throws ServiceNotKnownException
      Gets the licence manager that provides the licence for all AristaFlow-services and products. This method is not user-session-specific and retrieves the licence manager with a special session of this multiplexing client service. This allows to retrieve the licence manager independent from whether a user has been logged on (and retrieved a user-specific client service).
      Specified by:
      getLicenceManager in interface ClientService
      Returns:
      The licence manager providing the licence for all AristaFlow-services and products.
      Throws:
      ServiceNotKnownException - If there are problems retrieving the licence manager, a ServiceNotKnownException will be thrown.
    • getClusterName

      public String getClusterName()
      Description copied from interface: ClientService
      Gets the name of the cluster this service belongs to. Use this name for identification purpose across clusters.
      Specified by:
      getClusterName in interface ClientService
      Returns:
      The name of the cluster this service belongs to.
    • getActivityModelFactory

      public ActivityModelFactory getActivityModelFactory()
      Description copied from interface: ADEPT2ClientService
      CL_ARCH client service documentation
      Specified by:
      getActivityModelFactory in interface ActivityManagerService
      Specified by:
      getActivityModelFactory in interface ADEPT2ClientService
      Returns:
      The activity model factory for this client
    • getProcessModelFactory

      public ProcessModelFactory getProcessModelFactory()
      Description copied from interface: ADEPT2ClientService
      CL_ARCH client service documentation
      Specified by:
      getProcessModelFactory in interface ActivityManagerService
      Specified by:
      getProcessModelFactory in interface ADEPT2ClientService
      Specified by:
      getProcessModelFactory in interface AdministrationService
      Specified by:
      getProcessModelFactory in interface LocalExecutionClientService
      Specified by:
      getProcessModelFactory in interface ModellingClientService
      Returns:
      The process model factory for this client
    • getExecutionFactory

      public ExecutionFactory getExecutionFactory()
      Specified by:
      getExecutionFactory in interface WorklistClientService
    • getResourceModelFactory

      public de.aristaflow.adept2.model.resourcemodel.builder.ResourceModelFactory getResourceModelFactory()
      Specified by:
      getResourceModelFactory in interface AdministrationService
      Specified by:
      getResourceModelFactory in interface ModellingClientService
    • getWorklistModelFactory

      public WorklistModelFactory getWorklistModelFactory()
      Description copied from interface: WorklistClientService
      CL_ARCH client service documentation
      Specified by:
      getWorklistModelFactory in interface WorklistClientService
      Returns:
      The worklist model factory for this client
    • getProcessChecks

      public ProcessCheckService getProcessChecks()
      Specified by:
      getProcessChecks in interface ADEPT2ClientService
      Specified by:
      getProcessChecks in interface ModellingClientService
    • getActivityRepository

      public ActivityRepository getActivityRepository()
      Description copied from interface: ADEPT2ClientService
      CL_ARCH client service documentation
      Specified by:
      getActivityRepository in interface ActivityManagerService
      Specified by:
      getActivityRepository in interface ADEPT2ClientService
      Returns:
      The activity repository for this client
    • getProcessManager

      public ProcessManager getProcessManager()
      Description copied from interface: ADEPT2ClientService
      CL_ARCH client service documentation
      Specified by:
      getProcessManager in interface ADEPT2ClientService
      Specified by:
      getProcessManager in interface AdministrationService
      Specified by:
      getProcessManager in interface ModellingClientService
      Returns:
      The process manager for this client
    • getSimpleProcessImageRenderer

      public SimpleProcessImageRenderer getSimpleProcessImageRenderer()
      Specified by:
      getSimpleProcessImageRenderer in interface ADEPT2ClientService
      Specified by:
      getSimpleProcessImageRenderer in interface AdministrationService
      Specified by:
      getSimpleProcessImageRenderer in interface LocalExecutionClientService
    • getProcessImageRenderer

      public ProcessImageRenderer getProcessImageRenderer()
      Specified by:
      getProcessImageRenderer in interface ADEPT2ClientService
      Specified by:
      getProcessImageRenderer in interface AdministrationService
      Specified by:
      getProcessImageRenderer in interface LocalExecutionClientService
    • getProcessManager

      public ProcessManager getProcessManager(UUID instanceID)
      Description copied from interface: AdministrationService
      CL_ARCH client service documentation
      Specified by:
      getProcessManager in interface AdministrationService
      Specified by:
      getProcessManager in interface WorklistClientService
      Returns:
      The process manager for this client
    • getProcessRepository

      public ProcessRepository getProcessRepository()
      Specified by:
      getProcessRepository in interface AdministrationService
    • getOrgModelManager

      public OrgModelManager getOrgModelManager()
      Description copied from interface: ADEPT2ClientService
      CL_ARCH client service documentation
      Specified by:
      getOrgModelManager in interface ActivityManagerService
      Specified by:
      getOrgModelManager in interface ADEPT2ClientService
      Specified by:
      getOrgModelManager in interface AdministrationService
      Specified by:
      getOrgModelManager in interface WorklistClientService
      Returns:
      The org model manager for this client
    • getExecutionManager

      public ExecutionManager getExecutionManager()
      Specified by:
      getExecutionManager in interface ADEPT2ClientService
      Specified by:
      getExecutionManager in interface AdministrationService
    • getExecutionManagerForActivity

      public ExecutionManager getExecutionManagerForActivity(EBPInstanceReference ebpInstanceReference)
      Description copied from interface: LocalExecutionClientService
      Returns a reference to the execution manager that is responsible for the designated activity. If there is no running Execution Manager for the given activity an new one is created and registered with the URI provided by the Activity.
      Specified by:
      getExecutionManagerForActivity in interface LocalExecutionClientService
      Parameters:
      ebpInstanceReference - identifies the activity
      Returns:
      The execution manager which is requested or null in case it could not be retrieved.
    • getProcessManagerForInstanceId

      public ProcessManager getProcessManagerForInstanceId(URI[] execMgr, UUID instId)
      Description copied from interface: LocalExecutionClientService
      Gets the process manager that is responsible for the instance with the designated (logical) ID being executed on the designated execution manager.
      Specified by:
      getProcessManagerForInstanceId in interface LocalExecutionClientService
      Parameters:
      execMgr - The URIs of the execution manager executing the instance with the designated ID.
      instId - The (logical) ID of the instance for which to retrieve the corresponding process manager. This is resolved using the designated execution manager.
      Returns:
      The process manager handling the designated instance ID or null in case it could not be retrieved (or the corresponding execution manager).
    • getProcessManagerForInstanceLogId

      public ProcessManager getProcessManagerForInstanceLogId(URI[] execMgr, UUID instLogId)
      Description copied from interface: LocalExecutionClientService
      Gets the process manager that is responsible for the instance with the designated (internal) ID being executed on the designated execution manager.
      Specified by:
      getProcessManagerForInstanceLogId in interface LocalExecutionClientService
      Parameters:
      execMgr - The URIs of the execution manager executing the instance with the designated ID.
      instLogId - The (internal) ID of the instance for which to retrieve the corresponding process manager. This is resolved using the designated execution manager.
      Returns:
      The process manager handling the designated instance ID or null in case it could not be retrieved (or the corresponding execution manager).
    • getInstanceControl

      public InstanceControl getInstanceControl()
      Description copied from interface: ADEPT2ClientService
      Gets the interface for controlling an instance.
      This is a convenience method for getExecutionManager().getInstanceControl(). It may only be called when online.
      Specified by:
      getInstanceControl in interface ADEPT2ClientService
      Specified by:
      getInstanceControl in interface AdministrationService
      Specified by:
      getInstanceControl in interface WorklistClientService
      Returns:
      An interface allowing to control the execution of an instance.
      See Also:
    • getActivityExecutionControl

      public ActivityExecutionControl getActivityExecutionControl(EBPInstanceReference activity)
      Specified by:
      getActivityExecutionControl in interface AdministrationService
    • getActivityStarting

      public ActivityStarting getActivityStarting(EBPInstanceReference activity)
      Description copied from interface: LocalExecutionClientService
      Gets the interface for (asynchronous) start operations of the designated activity independently from the execution manager holding the activity.
      This is a convenience method for getExecutionManager().getActivityStarting() except that the returned interface also sets the appropriate RuntimeManager-URIs. It may only be called when online.
      Specified by:
      getActivityStarting in interface LocalExecutionClientService
      Specified by:
      getActivityStarting in interface WorklistClientService
      Parameters:
      activity - The activity for which to retrieve the corresponding (asynchronous) start interface of the appropriate execution manager.
      Returns:
      An interface allowing to perform (asynchronous) start operations on the designated activity.
      See Also:
    • getRemoteSynchronousActivityStarting

      public Pair<SynchronousActivityStarting,Boolean> getRemoteSynchronousActivityStarting(EBPInstanceReference activity) throws ServiceNotKnownException
      Description copied from interface: ExecutionClientService
      Gets the interface for (synchronous) start operations of the designated activity independently from the execution manager holding the activity and the local runtime manager. This is similar to LocalExecutionClientService.getSynchronousActivityStarting(EBPInstanceReference) but allows implementations to choose a specific runtime manager. For instance it may be desired to execute all HTML-activities on a specific central runtime manager.
      This is a convenience method for getRuntimeManager().getSynchronousActivityStarting() for a specific runtime manager. It may only be called when online.

      This method needs not be implemented and may return null! In this case use LocalExecutionClientService.getActivityStarting(EBPInstanceReference).

      Specified by:
      getRemoteSynchronousActivityStarting in interface ExecutionClientService
      Specified by:
      getRemoteSynchronousActivityStarting in interface RemoteExecutionClientService
      Parameters:
      activity - The activity for which to retrieve the corresponding (synchronous) start interface of the appropriate runtime manager.
      Returns:
      An interface allowing to perform (synchronous) start operations on the designated activity and whether this refers to a remote activity starting. In this case the corresponding GUI has to be registered appropriately since the remote runtime manager cannot register it at the local client.
      Throws:
      ServiceNotKnownException - If the runtime manager for the designated activity cannot be retrieved, a ServiceNotKnownException will be thrown.
      See Also:
    • getSynchronousActivityStarting

      public SynchronousActivityStarting getSynchronousActivityStarting(EBPInstanceReference activity)
      Description copied from interface: LocalExecutionClientService
      Gets the interface for (synchronous) start operations of the designated activity independently from the execution manager holding the activity. Synchronous activity starting allows to wait until the application has been fully initialised including its GUI. Afterwards the GUI is returned to the starting component.
      This is a convenience method for getRuntimeManager().getSynchronousActivityStarting(). It may only be called when online.

      This method needs not be implemented and may return null! In this case use LocalExecutionClientService.getActivityStarting(EBPInstanceReference).

      Specified by:
      getSynchronousActivityStarting in interface LocalExecutionClientService
      Specified by:
      getSynchronousActivityStarting in interface WorklistClientService
      Parameters:
      activity - The activity for which to retrieve the corresponding (synchronous) start interface of the appropriate runtime manager.
      Returns:
      An interface allowing to perform (synchronous) start operations on the designated activity.
      See Also:
    • getRemoteGUIManager

      public RemoteGUIManager getRemoteGUIManager() throws ServiceNotKnownException
      Description copied from interface: ExecutionClientService
      Gets the GUI manager for creating local GUI contexts for the GUI contexts that are transferred from a remotely executed activity. This GUI manager creates an appropriate local GUI context and usually handles the closing of this local GUI context which depends on the state of the remotely executed activity.
      Specified by:
      getRemoteGUIManager in interface ExecutionClientService
      Specified by:
      getRemoteGUIManager in interface RemoteExecutionClientService
      Returns:
      The GUI manager for creating local GUI contexts the GUI contexts that are transferred from a remotely executed activity.
      Throws:
      ServiceNotKnownException - If no remote GUI manager is available for this client, a ServicNotKnownException will be thrown. Usually this indicates a wrong configuration or the normal GUI manager of this client being unable to provide such local GUI contexts for remotely executed activities.
    • getInstanceChanging

      public InstanceChanging getInstanceChanging()
      Description copied from interface: ADEPT2ClientService
      Gets the interface for changing an instance.
      This is a convenience method for getExecutionManager().getInstanceChanging(). It may only be called when online.
      Specified by:
      getInstanceChanging in interface ADEPT2ClientService
      Returns:
      An interface allowing to control the change of an instance.
      See Also:
    • getExecutionHistory

      public ExecutionHistory getExecutionHistory()
      Description copied from interface: LocalExecutionClientService
      Gets the execution history.

      FIXME: the execution history is actually specific to a process manager, i.e. each p.m. can have its own execution history.

      Specified by:
      getExecutionHistory in interface LocalExecutionClientService
      Returns:
      the execution history
    • getInitTabManager

      public InitTabManager getInitTabManager()
      Specified by:
      getInitTabManager in interface AdministrationService
    • getResModelManager

      public de.aristaflow.adept2.core.resmodelmanager.ResModelManager getResModelManager()
      Specified by:
      getResModelManager in interface AdministrationService
      Specified by:
      getResModelManager in interface ModellingClientService
    • getResModelExplorer

      public de.aristaflow.adept2.core.resmodelmanager.ResModelExplorer getResModelExplorer()
      Specified by:
      getResModelExplorer in interface LocalExecutionClientService
      Specified by:
      getResModelExplorer in interface WorklistClientService
    • getWorklistManager

      public WorklistManager getWorklistManager()
      Description copied from interface: WorklistClientService
      Gets the worklist manager for logging on and retrieving a worklist and updates from.
      It may only be called when online.
      Specified by:
      getWorklistManager in interface WorklistClientService
      Returns:
      The worklist manager providing worklist(s) for this client.
    • getRuntimeEnvironmentFactory

      public RuntimeEnvironmentFactory getRuntimeEnvironmentFactory()
      Description copied from interface: LocalExecutionClientService
      Gets the anonymous instance of the runtime environment factory using the classloader of this registry.
      Specified by:
      getRuntimeEnvironmentFactory in interface LocalExecutionClientService
      Returns:
      The anonymous instance of the runtime environment factory.
    • getRuntimeService

      public RuntimeService getRuntimeService()
      Description copied from interface: LocalExecutionClientService
      Gets the runtime service for this client service allowing to execute activities directly by the caller and not in a runtime manager. The caller has complete responsibility for the execution of the activity!
      Specified by:
      getRuntimeService in interface LocalExecutionClientService
      Specified by:
      getRuntimeService in interface WorklistClientService
      Returns:
      The runtime service for this client service allowing to execute activities directly by the caller and not in a runtime manager.
    • getRuntimeManager

      public RuntimeManager getRuntimeManager()
      Description copied from interface: WorklistClientService
      Gets the runtime manager for this client service, which is usually a local runtime manager. This differs from a runtime manager for specific activities, e. g. HTML-activities.
      Specified by:
      getRuntimeManager in interface WorklistClientService
      Returns:
      The runtime manager for this client service, which is usually a local runtime manager.
    • getAutoStartRuntimeManager

      public URI[] getAutoStartRuntimeManager()
      Description copied from interface: LocalExecutionClientService
      Gets the URIs of the runtime manager for autostarting. Use this for starting a new instance thus allowing to autostart the first activity. In this case the first activity will be automatically started on the designated runtime manager right after instantiation.
      Specified by:
      getAutoStartRuntimeManager in interface LocalExecutionClientService
      Specified by:
      getAutoStartRuntimeManager in interface WorklistClientService
      Returns:
      The URIs of the runtime manager for autostarting.
    • getExecutionControlManager

      public ExecutionControlManager getExecutionControlManager(EBPInstanceReference activity)
      Description copied from interface: LocalExecutionClientService
      Gets the execution control manager for the designated activity. The execution control manager allows to control the execution of the running activity independently from where it is running.
      Specified by:
      getExecutionControlManager in interface LocalExecutionClientService
      Specified by:
      getExecutionControlManager in interface WorklistClientService
      Parameters:
      activity - The activity for which to retrieve the execution control manager of the appropriate runtime manager.
      Returns:
      A manager allowing to control the execution of the designated activity independently from where the execution is located.
      See Also:
    • getGUIManager

      public GUIManager getGUIManager()
      Description copied from interface: LocalExecutionClientService
      Gets the GUI manager responsible for synchronising the currently selected element in the GUI. This allows to for instance to select a worklist entry and the corresponding application is set visible and in the foreground.
      Specified by:
      getGUIManager in interface LocalExecutionClientService
      Returns:
      A GUI manager providing the means to synchronise on the currently selected element.
    • getModelViewerClass

      public Class<?> getModelViewerClass(String pluginID)
      Gets the model viewer class for the designated plugin ID that allows type-save access to plugin data at model elements. If there is no model viewer configured for the designated plugin ID, null will be returned. This ID usually equals the ID of the (service-) plugin that uses the model viewer. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getModelViewerClass in interface ADEPT2ClientService
      Specified by:
      getModelViewerClass in interface ModelViewerProvider
      Parameters:
      pluginID - The ID of the plugin for which to retrieve a model viewer, this ID is usually the same ID as the one of the (service-) plugin using the plugin data.
      Returns:
      The model viewer class for the designated plugin ID or null in case there is no model viewer for the designated plugin ID configured.
    • getModelFactory

      public <T> T getModelFactory(String modelFactoryName, Class<T> modelFactoryType) throws ServiceNotKnownException
      Gets the designated model factory registry. This method is not user-session-specific and retrieves the designated model factory globally.
      Specified by:
      getModelFactory in interface ServiceAccess
      Type Parameters:
      T - The type of the requested model factory registry.
      Parameters:
      modelFactoryName - The name of the requested model factory. Use the names declared in ModelRegistryConstants. No other model factory registries need to exist.
      modelFactoryType - The type of the requested model factory registry.
      Returns:
      The requested model factory registry. The object is never null.
      Throws:
      ServiceNotKnownException - If
      • the requested model factory registry is not configured properly,
      • the requested model factory registry cannot be created,
      a ServiceNotKnownException wrapping a ConfigurationException will be thrown.
    • getConfiguredPluginTypes

      public Map<String,Class<?>> getConfiguredPluginTypes(SessionToken session)
      Retrieves all plugin types declared for the instance using this interface. This method is not user-session-specific and retrieves the designated plugins globally.
      Specified by:
      getConfiguredPluginTypes in interface ServiceAccess
      Parameters:
      session - The session which is used to check for access rights on this method.
      Returns:
      All plugin types (names and corresponding classes) declared for the instance using this interface. This map may be empty.
    • getServiceOfType

      public <T extends ADEPT2Service> T getServiceOfType(SessionToken session, String typeName, Class<T> serviceType) throws ServiceNotKnownException
      Returns the service instance of the designated service type which is configured for usage by this (the requesting) service instance. If no special service instance is configured for usage, the default instance of the requested service type will be returned. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getServiceOfType in interface ServiceAccess
      Type Parameters:
      T - The type which the requested service is expected to be of. This is a subtype of ADEPT2Service and either the registered service type or a super type hereof.
      Parameters:
      session - The session which is used to check for access rights on this method.
      typeName - The type name of the requested service. Refer to ComponentTypes and BaseConstants for valid predefined service type names. Other service type names are also valid if the corresponding services are configured appropriately. ADEPT2Service and the interface configured for the service type or a super type hereof.
      serviceType - The type of the requested service. This is a subtype of ADEPT2Service and the interface configured for the service type or a super type hereof.
      Returns:
      The requested service (or a service stub). The object is never null.
      Throws:
      ServiceNotKnownException - If
      • the service is not configured properly,
      • the service cannot be created or started,
      • a required service is not configured properly or cannot be started,
      • the creation of a required service object fails,
      • the service does not fulfil the ADEPT2Service -interface appropriately,
      • an exception is thrown while creating or starting a required service,
      a ServiceNotKnownException will be thrown. This may encapsulate a ConfigurationException or an AbortServiceException.
    • getConfiguredPlugin

      public <T> T getConfiguredPlugin(SessionToken session, Object usingInstance, String pluginTypeName, Class<T> pluginType) throws ServiceNotKnownException
      Retrieves the default plugin of the designated type which is configured for the designated (using) instance. This is the same as ServiceAccess.getConfiguredPlugin(SessionToken, Object, String, Class, String) except that the default plugin instance is used, that is the first configured one. Therefore this will not be a runtime plugin. This method is not user-session-specific and retrieves the designated plugin globally.
      Specified by:
      getConfiguredPlugin in interface ServiceAccess
      Type Parameters:
      T - The type of the requested plugin.
      Parameters:
      session - The session which is used to check for access rights on this method.
      usingInstance - The instance which is using the plugin and which is provided in to the plugin when creating it. This allows the plugin to access the instance it extends.
      pluginTypeName - The component type of the plugin instance to be retrieved for usage. This may neither be null nor the empty string. The type name is specified in the configuration.
      pluginType - The type of the requested plugin.
      Returns:
      The requested plugin instance. The object is never null.
      Throws:
      ServiceNotKnownException - If
      • the plugin type is not configured for the designated object,
      • the plugin is not configured properly,
      • the creation or the initialisation of the plugin instance fails,
      a ServiceNotKnownException wrapping a ConfigurationException will be thrown.
    • getConfiguredPlugins

      public <T> Map<String,T> getConfiguredPlugins(SessionToken session, Object usingInstance, String pluginTypeName, Class<T> pluginType) throws ServiceNotKnownException
      Retrieves all plugin instances (pre-configured and dynamic) of the designated plugin type. A new plugin instance will be created if an instance is not singleton or it has not been instantiated before. This method is not user-session-specific and retrieves the designated plugins globally.
      Specified by:
      getConfiguredPlugins in interface ServiceAccess
      Type Parameters:
      T - The plugin type of the requested instances.
      Parameters:
      session - The session which is used to check for access rights on this method.
      usingInstance - The instance which is using the plugins and which is provided to the plugins when creating them. This allows the plugins to access the instance it extends.
      pluginTypeName - The component type of the plugin instance to be retrieved for usage. This may neither be null nor the empty string. The type name is specified in the configuration.
      pluginType - The type of the requested plugin.
      Returns:
      The requested plugin instances, indexed by their instance id. This map may be empty.
      Throws:
      ServiceNotKnownException - If
      • the plugin type is not configured for the designated object,
      • the configuration of a plugin instance does not provide required configuration values,
      • a plugin is not configured properly,
      • the creation or the initialisation of a plugin instance fails,
      a ServiceNotKnownException will be thrown.
    • getConfiguredPlugin

      public <T> T getConfiguredPlugin(SessionToken session, Object usingInstance, String pluginTypeName, Class<T> pluginType, String pluginInstanceName) throws ServiceNotKnownException
      Retrieves the plugin having the designated type and instance name as well as type and which is configured for the designated (using) instance. The designated using instance need to support plugins of the requested type. The plugin may be configured in the server/client configuration or it may be a runtime plugin that is found (together with its configuration) when requested. A new plugin instance will be created if the instance is not singleton or it has not been instantiated before. This method is not user-session-specific and retrieves the designated plugin globally.
      Specified by:
      getConfiguredPlugin in interface ServiceAccess
      Type Parameters:
      T - The type of the requested plugin.
      Parameters:
      session - The session which is used to check for access rights on this method.
      usingInstance - The instance which is using the plugin and which is provided in to the plugin when creating it. This allows the plugin to access the instance it extends.
      pluginTypeName - The component type of the plugin instance to be retrieved for usage. This may neither be null nor the empty string. The type name is specified in the configuration.
      pluginType - The type of the requested plugin.
      pluginInstanceName - The simple name of the plugin instance to retrieve. This is either configured in the server/client configuration or in a configuration found at runtime.
      Returns:
      The requested plugin instance. The object is never null.
      Throws:
      ServiceNotKnownException - If
      • the plugin type is not configured for the designated object,
      • the plugin is not configured properly,
      • the plugin is to be used as a runtime plugin but the designated object does not allow for runtime plugins,
      • the plugin is to be used as a runtime plugin but it is not found,
      • the creation or the initialisation of the plugin instance fails,
      a ServiceNotKnownException wrapping a ConfigurationException will be thrown.
    • getService

      public <T extends ADEPT2Service> T getService(SessionToken session, String serviceName, Class<T> serviceType) throws ServiceNotKnownException
      Returns the designated service which is either a local service or a service stub that is retrieved from the global registry if the service is not known to this registry but to the global registry. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getService in interface ServiceAccess
      Type Parameters:
      T - The type of the requested service. This is a subtype of ADEPT2Service and either interface configured for the service type or a super type hereof.
      Parameters:
      session - The session which is used to check for access rights on this method.
      serviceName - The hierarchical instance name of the service.
      serviceType - The type of the requested service. This is a subtype of ADEPT2Service and the interface configured for the service type or a super type hereof.
      Returns:
      The requested service (or a service stub). The object is never null.
      Throws:
      ServiceNotKnownException - If
      • the service is not configured properly,
      • the service cannot be created or started,
      • a required service is not configured properly or cannot be started,
      • the creation of a required service object fails,
      • the service does not fulfill the ADEPT2Service -interface appropriately,
      • an exception is thrown while creating or starting a required service,
      a ServiceNotKnownException will be thrown. This may encapsulate a ConfigurationException or an AbortServiceException.
    • getService

      public <T extends ADEPT2Service> T getService(SessionToken session, URI[] serviceURIs, Class<T> serviceType) throws ServiceNotKnownException
      Retrieves the service described by the URIs which is either a local service stub that is retrieved from the global registry if the service is not known to this registry but to the global registry. An appropriate URI will be chosen, that is, a URI with a protocol supported by this registry. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getService in interface ServiceAccess
      Type Parameters:
      T - The type of the requested service. This is a subtype of ADEPT2Service and either interface configured for the service type or a super type hereof.
      Parameters:
      session - The session which is used to check for access rights on this method.
      serviceURIs - The URIs of the service to be retrieved, the array has to contain at least one valid service URI.
      serviceType - The type of the requested service. This is a subtype of ADEPT2Service and the interface configured for the service type or a super type hereof.
      Returns:
      The requested service (or a service stub). The object is never null.
      Throws:
      ServiceNotKnownException - If
      • no appropriate communication service is available for the designated URIs,
      • the service is not configured properly,
      • the service cannot be created or started,
      • a required service is not configured properly or cannot be started,
      • the creation of a required service object fails,
      • the service does not fulfill the ADEPT2Service -interface appropriately,
      • an exception is thrown while creating or starting a required service,
      a ServiceNotKnownException will be thrown. This may encapsulate a ConfigurationException or an AbortServiceException.
    • getHierarchicalInstanceName

      public String getHierarchicalInstanceName(String componentType, String simpleName)
      Returns a hierarchical instance name containing the component type as well as the instance name. The returned string resembles, for instance, /ProcessManager/PM1. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getHierarchicalInstanceName in interface NameResolution
      Parameters:
      componentType - The type of the component to create the hierarchical name for.
      simpleName - The simple name of the component instance as defined in the configuration.
      Returns:
      An instance name containing the component type and the simple component instance name.
    • getSimpleInstanceName

      public String getSimpleInstanceName(String instanceName)
      Returns the simple name of the designated component instance as used in configuration files. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getSimpleInstanceName in interface NameResolution
      Parameters:
      instanceName - The hierarchical name of a component instance.
      Returns:
      The simple name without the prepending type of the component instance.
    • getComponentType

      public String getComponentType(String instanceName)
      Returns the name of the component type of the designated component instance as used in configuration files. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getComponentType in interface NameResolution
      Parameters:
      instanceName - The hierarchical name of a component instance.
      Returns:
      The name of the component type.
    • getNames

      public Pair<String,String> getNames(String instanceName)
      Gets the component type name and the simple instance name of the designated component instance at once. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getNames in interface NameResolution
      Parameters:
      instanceName - The hierarchical name of a component instance.
      Returns:
      The name of the component type and the simple name of the designated component instance.
    • getFormattedSignature

      public String getFormattedSignature(Class<?>[] parameterTypes)
      Helper method for getting a string describing the parameter types as method signature for use in log messages and exceptions. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getFormattedSignature in interface NameResolution
      Parameters:
      parameterTypes - All the parameter types of a method as instances of Class.
      Returns:
      A string describing the parameter types as method signature (concatenated and surrounded by parenthesis).
    • getInterfaceForComponentType

      public Class<?> getInterfaceForComponentType(String componentType) throws ConfigurationException
      Returns the class object of the corresponding interface / superclass, if the component type is declared. If not, the method throws a ConfigurationException. This method must not to be called by clients; it is only for the registry and the communication framework. This method is not user-session-specific and retrieves the designated service globally.
      Specified by:
      getInterfaceForComponentType in interface ServiceAccess
      Parameters:
      componentType - The name of the component type of which to retrieve the configured interface.
      Returns:
      The class object of the corresponding interface / superclass.
      Throws:
      ConfigurationException - If the designated component type is not configured for this registry, a ConfigurationException will be thrown.
    • getClientServiceOrException

      public ADEPT2ClientService getClientServiceOrException()
      Returns the ADEPT2ClientService which was mapped in addClientService or throws an IllegalStateException if no client session context is available.
      Returns:
      The ADEPT2ClientService of the current user session.
      Throws:
      IllegalStateException - If there is no client service found, an IllegalStateException will be thrown.
    • getClientService

      public ADEPT2ClientService getClientService()
      Returns the ADEPT2ClientService which was mapped in addClientService or null if none was found.
      Returns:
      The ADEPT2ClientService of the current user session or null in case no client service is found for the user session.
      Throws:
      InvalidServiceStateException - If no user session ID is registered (e. g. for the current thread), an InvalidServiceStateException will be thrown.
    • getClientService

      public ADEPT2ClientService getClientService(String userSessionId)
      Gets the ADEPT2ClientService for the designated user session ID allowing to retrieve the client service from a thread without user context.
      Parameters:
      userSessionId - The user session ID for which to get the corresponding client service.
      Returns:
      The ADEPT2ClientService of the designated user session or null in case no client service is found for the designated user session.
      Throws:
      InvalidServiceStateException - If the designated user session ID is null, an InvalidServiceStateException will be thrown.
    • getClientService

      public ADEPT2ClientService getClientService(SessionToken session)
      This method can be called to receive the ADEPT2ClientService which is mapped to the user session ID in the additionalAttributes of the SessionToken.
      Parameters:
      session - A session token containing the user session ID as an additional attribute.
      Returns:
      ADEPT2ClientService The client service associated to the user session id.
      Throws:
      ServiceAccessControlException - If the agent cannot be determined from the designated session token, a ServiceAccessControlException will be thrown.
      InvalidServiceStateException - If the agent of the designated session token does not have a valid user session ID or there is no client service due to the client session factories not being set properly, an InvalidServiceStateException will be thrown.
    • removeSession

      protected void removeSession(String sessionID, boolean emergency)
      Removes the designated session that is the corresponding client service and the GUI manager will be removed. The client service will be shut down.
      Callers must not have the active agent read lock!
      Parameters:
      sessionID - The session ID of which to remove the client service and the GUI manager.
      emergency - Whether the client service should be terminated quickly.
    • getUserSessionID

      protected abstract String getUserSessionID()
      Gets the session identifying the current request. This should usually be bound to the current thread.
      Returns:
      A string identifying the current user session or null in case the current user session cannot be determined.
    • getOperatingSystemName

      public String getOperatingSystemName()
      Description copied from interface: RemoteClient
      Returns the name of the operating system of the client as specified by System.getProperty("os.name").
      Specified by:
      getOperatingSystemName in interface RemoteClient
      Returns:
      The name of the operating system of the client as specified by System.getProperty("os.name").
    • getOperatingSystemVersion

      public String getOperatingSystemVersion()
      Description copied from interface: RemoteClient
      Returns the version of the operating system of the client as specified by System.getProperty("os.version").
      Specified by:
      getOperatingSystemVersion in interface RemoteClient
      Returns:
      The version of the operating system of the client as specified by System.getProperty("os.version").
    • getOperatingSystemArchitecture

      public String getOperatingSystemArchitecture()
      Description copied from interface: RemoteClient
      Returns the architecture of the operating system of the client as specified by System.getProperty("os.arch").
      Specified by:
      getOperatingSystemArchitecture in interface RemoteClient
      Returns:
      The architecture of the operating system of the client as specified by System.getProperty("os.arch").
    • getJavaVersion

      public String getJavaVersion()
      Description copied from interface: RemoteClient
      Returns the version of the running Java Virtual Machine of the client as specified by System.getProperty("java.version").
      Specified by:
      getJavaVersion in interface RemoteClient
      Returns:
      The version of the running Java Virtual Machine of the client as specified by System.getProperty("java.version").
    • getUsedLocale

      public Locale getUsedLocale(RichAgent agent)
      Returns the locale which the designated agent has chosen on this client. This may differ from the default locale of the client as well as the default locale for the agent. For instance, the default client locale is fr_FR, the default locale of the user is jp_JP. The client does not support asian languages, but the user can speak English, therefore en_GB is chosen as locale.
      Per default, the locale of the agent is used. This returns the locale of the first client service found for the designated agent. However, note that this agent may be logged on several times with different locales.
      Specified by:
      getUsedLocale in interface RemoteClient
      Parameters:
      agent - The agent for whom to retrieve the configured language.
      Returns:
      The configured language of the designated agent of the client or null in case the designated agent is not logged on.
    • getDefaultLocale

      public Locale getDefaultLocale()
      Description copied from interface: RemoteClient
      Returns the default locale of this client as specified by Locale.getDefault().
      Specified by:
      getDefaultLocale in interface RemoteClient
      Returns:
      The default locale of this client as specified by Locale.getDefault().
    • getDefaultCharset

      public String getDefaultCharset()
      Description copied from interface: RemoteClient
      Returns the default character set of this client as specified by Charset.defaultCharset().name().
      Specified by:
      getDefaultCharset in interface RemoteClient
      Returns:
      The default locale of this client as specified by Charset.defaultCharset().name().
    • getLoggedOnAgents

      public RichAgent[] getLoggedOnAgents()
      Description copied from interface: RemoteClient
      Returns the agents that are currently logged on this client.
      Specified by:
      getLoggedOnAgents in interface RemoteClient
      Returns:
      An array containing all currently logged on agents on this client.
    • getRuntimeManagerURIs

      public Map<RichAgent,URI[]> getRuntimeManagerURIs()
      Description copied from interface: RemoteClient
      Returns the runtime managers that are currently available on this client. These are indexed by the agents to which a runtime manager belongs to. The agents are all logged on agents. Since not every agent needs to have a runtime manager, there may be null values in the map.
      Specified by:
      getRuntimeManagerURIs in interface RemoteClient
      Returns:
      A map containing all currently available runtime managers on this client indexed by the corresponding agent.
    • serverShutdown

      public void serverShutdown(String serverName, URI[] serverURIs, long shutdownTime, long estimatedDowntime)
      Description copied from interface: RemoteClient
      Notifies this client that the designated server will be down in the designated period and for the estimated downtime. The designated URIs are the current URIs of the server, while the designated server name is logical. This allows to shutdown and return with different URIs.
      The estimated downtime allows to client to decide whether to shutdown itself or to keep on running.
      Specified by:
      serverShutdown in interface RemoteClient
      Parameters:
      serverName - The logical name of the server to identify the return of the server.
      serverURIs - The URIs of the server which is shutdown and which are invalid
      shutdownTime - The time period when the server will be shut down. Until then it still accepts requests, for instance to allow clients to logoff.
      estimatedDowntime - The estimated duration for the downtime of the designated server.
      See Also:
    • serverReturned

      public void serverReturned(String serverName, URI[] serverURIs)
      Description copied from interface: RemoteClient
      Notifies this client (if it has not shutdown itself) that the designated server is running again. The designated name allows the client to change the URIs and use the new URIs from now on.
      Specified by:
      serverReturned in interface RemoteClient
      Parameters:
      serverName - The logical name of the server to identify the corresponding shutdown.
      serverURIs - The (new) URIs of the server which should be used from now on.