Class MultiplexingClientService
- java.lang.Object
-
- de.aristaflow.adept2.base.service.AbstractADEPT2Service
-
- de.aristaflow.adept2.base.service.AbstractAuthenticatedService
-
- de.aristaflow.adept2.core.client.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
TheMultiplexingClientService
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 userlogs 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 anIllegalStateException
.
Note that implementations of this class need a public constructor accepting aConfiguration
and aRegistry
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
AbstractADEPT2Service.ActiveSessions
-
Nested classes/interfaces inherited from interface de.aristaflow.adept2.core.client.ClientService
ClientService.ActiveAgentChangedListener, ClientService.ServiceStateListener
-
-
Field Summary
Fields Modifier and Type Field Description protected ReadWriteLock
activeAgentLock
The lock for synchronising all access concerning the active agent, which is mainlysessionServiceMapping
.protected Map<String,ADEPT2ClientService>
sessionServiceMapping
Mapping between a user-session-ID and an ADEPT2 client service.-
Fields inherited from class de.aristaflow.adept2.base.service.AbstractAuthenticatedService
CFG_EARLY_SERVICEAUTH_ORGPOSID, CFG_EARLY_SERVICEAUTH_ORGPOSNAME, CFG_EARLY_SERVICEAUTH_PASSWORD, CFG_EARLY_SERVICEAUTH_USERNAME, CFG_SERVICEAUTH_ORGPOSID, CFG_SERVICEAUTH_ORGPOSNAME, CFG_SERVICEAUTH_PASSWORD, CFG_SERVICEAUTH_USERNAME
-
Fields inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices
-
-
Constructor Summary
Constructors Constructor Description MultiplexingClientService(org.apache.commons.configuration2.Configuration configuration, Registry registry)
Creates a MultiplexingClientService with the designated registry, a logger for this and the designated required services.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addActiveAgentListener(ClientService.ActiveAgentChangedListener listener)
Adds the listener to receive events when the active agent has been changed.void
addGUIListener(SelectedGUIElementChangedListener selectedElementChangedListener)
Registers a listener to be informed about a change in the currently selected GUI element representing a model element.boolean
addServiceStateListener(ADEPT2Service service, ClientService.ServiceStateListener listener)
Registers a listener to be informed about a change in the availability of anADEPT2Service
.RichAgent[]
agentsChanged(QualifiedAgent... agents)
Signals this client service that the designated agents changed.boolean
connectAll()
Tries to connect this client service to all AristaFlow-services.void
disconnectAll()
Disconnects this client service from the AristaFlow-services.RichAgent
getActiveAgent()
Gets the currently active agent.ActivityExecutionControl
getActivityExecutionControl(EBPInstanceReference activity)
ActivityModelFactory
getActivityModelFactory()
CL_ARCH client service documentationActivityRepository
getActivityRepository()
CL_ARCH client service documentationActivityStarting
getActivityStarting(EBPInstanceReference activity)
Gets the interface for (asynchronous) start operations of the designated activity independently from the execution manager holding the activity.RichAgent[]
getAuthenticatedAgents()
Gets all authenticated agents of this clients usually this is one agent holding multiple organisational positions.Authentication
getAuthentication()
Gets the manager that handles authentication for the users of this client.URI[]
getAutoStartRuntimeManager()
Gets the URIs of the runtime manager for autostarting.Locale[]
getAvailableLocales()
Gets the locales the client supports, that is, the locales found as resources.ADEPT2ClientService
getClientService()
Returns the ADEPT2ClientService which was mapped inaddClientService
ornull
if none was found.ADEPT2ClientService
getClientService(SessionToken session)
This method can be called to receive theADEPT2ClientService
which is mapped to the user session ID in the additionalAttributes of the SessionToken.ADEPT2ClientService
getClientServiceOrException()
Returns the ADEPT2ClientService which was mapped inaddClientService
or throws anIllegalStateException
if no client session context is available.String
getClusterName()
Gets the name of the cluster this service belongs to.String
getComponentType(String instanceName)
Returns the name of the component type of the designated component instance as used in configuration files.<T> T
getConfiguredPlugin(SessionToken session, Object usingInstance, String pluginTypeName, Class<T> pluginType)
Retrieves the default plugin of the designated type which is configured for the designated (using) instance.<T> T
getConfiguredPlugin(SessionToken session, Object usingInstance, String pluginTypeName, Class<T> pluginType, String pluginInstanceName)
Retrieves the plugin having the designated type and instance name as well as type and which is configured for the designated (using) instance.<T> Map<String,T>
getConfiguredPlugins(SessionToken session, Object usingInstance, String pluginTypeName, Class<T> pluginType)
Retrieves all plugin instances (pre-configured and dynamic) of the designated plugin type.Map<String,Class<?>>
getConfiguredPluginTypes(SessionToken session)
Retrieves all plugin types declared for the instance using this interface.String
getDefaultCharset()
Returns the default character set of this client as specified byCharset.defaultCharset().name()
.Locale
getDefaultLocale()
Returns the default locale of this client as specified byLocale.getDefault()
.ExecutionControlManager
getExecutionControlManager(EBPInstanceReference activity)
Gets the execution control manager for the designated activity.ExecutionFactory
getExecutionFactory()
ExecutionHistory
getExecutionHistory()
Gets the execution history.ExecutionManager
getExecutionManager()
ExecutionManager
getExecutionManagerForActivity(EBPInstanceReference ebpInstanceReference)
Returns a reference to the execution manager that is responsible for the designated activity.ExecutorService
getExecutorService()
Gets anExecutorService
for executing long lasting tasks asynchronously.FilterFactory
getFilterFactory()
CL_ARCH client service documentationString
getFormattedSignature(Class<?>[] parameterTypes)
Helper method for getting a string describing the parameter types as method signature for use in log messages and exceptions.SystemDataFormatterFactory
getFormatterFactory()
Gets the system data formatter factory.GraphicalModelFactory
getGraphicalModelFactory()
CL_ARCH client service documentationGUIManager
getGUIManager()
Gets the GUI manager responsible for synchronising the currently selected element in the GUI.String
getHierarchicalInstanceName(String componentType, String simpleName)
Returns a hierarchical instance name containing the component type as well as the instance name.InitTabFactory
getInitTabFactory()
InitTabManager
getInitTabManager()
InstanceChanging
getInstanceChanging()
Gets the interface for changing an instance.InstanceControl
getInstanceControl()
Gets the interface for controlling an instance.Class<?>
getInterfaceForComponentType(String componentType)
Returns the class object of the corresponding interface / superclass, if the component type is declared.String
getJavaVersion()
Returns the version of the running Java Virtual Machine of the client as specified bySystem.getProperty("java.version")
.LicenceManager
getLicenceManager()
Gets the licence manager that provides the licence for all AristaFlow-services and products.LocalisationFactory
getLocalisationFactory()
Gets the localisation factory.RichAgent[]
getLoggedOnAgents()
Returns the agents that are currently logged on this client.<T> T
getModelFactory(String modelFactoryName, Class<T> modelFactoryType)
Gets the designated model factory registry.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.Pair<String,String>
getNames(String instanceName)
Gets the component type name and the simple instance name of the designated component instance at once.String
getOperatingSystemArchitecture()
Returns the architecture of the operating system of the client as specified bySystem.getProperty("os.arch")
.String
getOperatingSystemName()
Returns the name of the operating system of the client as specified bySystem.getProperty("os.name")
.String
getOperatingSystemVersion()
Returns the version of the operating system of the client as specified bySystem.getProperty("os.version")
.OrgModelManager
getOrgModelManager()
CL_ARCH client service documentationProcessCheckService
getProcessChecks()
ProcessImageRenderer
getProcessImageRenderer()
ProcessManager
getProcessManager()
CL_ARCH client service documentationProcessManager
getProcessManager(UUID instanceID)
CL_ARCH client service documentationProcessManager
getProcessManagerForInstanceId(URI[] execMgr, UUID instId)
Gets the process manager that is responsible for the instance with the designated (logical) ID being executed on the designated execution manager.ProcessManager
getProcessManagerForInstanceId(UUID instId)
Gets the process manager that is responsible for the instance with the designated (logical) ID.ProcessManager
getProcessManagerForInstanceLogId(URI[] execMgr, UUID instLogId)
Gets the process manager that is responsible for the instance with the designated (internal) ID being executed on the designated execution manager.ProcessModelFactory
getProcessModelFactory()
CL_ARCH client service documentationProcessRepository
getProcessRepository()
RemoteGUIManager
getRemoteGUIManager()
Gets the GUI manager for creating local GUI contexts for the GUI contexts that are transferred from a remotely executed activity.Pair<SynchronousActivityStarting,Boolean>
getRemoteSynchronousActivityStarting(EBPInstanceReference activity)
Gets the interface for (synchronous) start operations of the designated activity independently from the execution manager holding the activity and the local runtime manager.de.aristaflow.adept2.core.resmodelmanager.ResModelExplorer
getResModelExplorer()
de.aristaflow.adept2.core.resmodelmanager.ResModelManager
getResModelManager()
de.aristaflow.adept2.model.resourcemodel.builder.ResourceModelFactory
getResourceModelFactory()
RuntimeEnvironmentFactory
getRuntimeEnvironmentFactory()
Gets the anonymous instance of the runtime environment factory using the classloader of this registry.RuntimeManager
getRuntimeManager()
Gets the runtime manager for this client service, which is usually a local runtime manager.Map<RichAgent,URI[]>
getRuntimeManagerURIs()
Returns the runtime managers that are currently available on this client.RuntimeService
getRuntimeService()
Gets the runtime service for this client service allowing to execute activities directly by the caller and not in a runtime manager.LoggingScheduledThreadPoolExecutor
getScheduledExecutorService()
Gets aScheduledExecutorService
for scheduling long lasting tasks asynchronously.<T extends ADEPT2Service>
TgetService(SessionToken session, String serviceName, Class<T> serviceType)
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.<T extends ADEPT2Service>
TgetService(SessionToken session, URI[] serviceURIs, Class<T> serviceType)
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.<T extends ADEPT2Service>
TgetServiceOfType(SessionToken session, String typeName, Class<T> serviceType)
Returns the service instance of the designated service type which is configured for usage by this (the requesting) service instance.SessionToken
getSessionToken()
Gets a session token for currently active agent and the URIs of this client.SessionToken
getSessionToken(QualifiedAgent agent)
Gets a session token for the designated agent ignoring the currently active agent.SessionToken
getSessionToken(QualifiedAgent agent, Map<String,String> additionalAttributes)
Gets a session token for the designated agent ignoring the currently active agent having the designated additional attributes.SessionToken
getSessionToken(Map<String,String> additionalAttributes)
Gets a session token for currently active agent and the URIs of this client having the designated additional attributes.String
getSimpleInstanceName(String instanceName)
Returns the simple name of the designated component instance as used in configuration files.SimpleProcessImageRenderer
getSimpleProcessImageRenderer()
SynchronousActivityStarting
getSynchronousActivityStarting(EBPInstanceReference activity)
Gets the interface for (synchronous) start operations of the designated activity independently from the execution manager holding the activity.UpdateManager
getUpdateManager()
Gets the update manager which informs about changes in process objects.Locale
getUsedLocale(RichAgent agent)
Returns the locale which the designated agent has chosen on this client.protected abstract String
getUserSessionID()
Gets the session identifying the current request.WorklistManager
getWorklistManager()
Gets the worklist manager for logging on and retrieving a worklist and updates from.WorklistModelFactory
getWorklistModelFactory()
CL_ARCH client service documentationvoid
guiSelectionChanged(SelectedGUIElementChangedEvent selectionChangeEvent)
This method informs all interestedlisteners
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.boolean
hasAllCapabilities(SessionToken sessionToken, String... capabilities)
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.boolean
hasAllTopLevelCapabilities(SessionToken sessionToken, String... capabilities)
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.boolean
hasOneCapability(SessionToken sessionToken, String... capabilities)
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.boolean
hasOneTopLevelCapability(SessionToken sessionToken, String... capabilities)
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.void
init(URI[] localExportedUris, URI[] globalExportedUris)
Copies the designated URI array and stores it internally and authenticates to the system and sets the session factory.boolean
isConnected(String serviceName)
Returns whether this client is connected to the designated service or not.void
logoff()
Logs the agent (that is with all organisational positions) off and invalidates the session factories.void
removeActiveAgentListener(ClientService.ActiveAgentChangedListener listener)
Removes the listener to receive events when the active agent has been changed.void
removeGUIListener(SelectedGUIElementChangedListener selectedElementChangedListener)
Removes a listener from further notifications of the selected GUI element.void
removeServiceStateListener(ADEPT2Service service, ClientService.ServiceStateListener listener)
Removes a listener from further notifications of the designatedADEPT2Service
.protected void
removeSession(String sessionID, boolean emergency)
Removes the designated session that is the corresponding client service and the GUI manager will be removed.void
serverReturned(String serverName, URI[] serverURIs)
Notifies this client (if it has not shutdown itself) that the designated server is running again.void
serverShutdown(String serverName, URI[] serverURIs, long shutdownTime, long estimatedDowntime)
Notifies this client that the designated server will be down in the designated period and for the estimated downtime.void
setActiveAgent(QualifiedAgent activeAgent)
Sets the currently active agent.void
setAuthenticatedAgents(ClientSessionFactory... csf)
Sets the client session factories for this service which provide the session tokens for the using components.void
shutdown(boolean emergency)
Awaits the termination of the active sessions and nulls the session factory.void
start()
Method setting the status to the current time.-
Methods inherited from class de.aristaflow.adept2.base.service.AbstractAuthenticatedService
_sessionActive, authenticateService, awaitActiveSessions, createChildSession, createSession, getAgent, getSecurityManager, getSessionFactory, getStartupRequired, getTopLevelAgent, getUserCredentials, globalSecurityManagerAvailable, isEarlyService, sessionHasAllCapabilities, sessionHasAllTopLevelCapabilities, sessionHasCapability, sessionHasOneCapability, sessionHasOneTopLevelCapability
-
Methods inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
_sessionFinished, activeOrInvalidServiceStateException, changeLogContext, changeLogContext, changeLogContext, consoleLog, csvLoggingEnabled, getClassSpecificJulLogger, getDependencyRegistry, getLocalUris, getLogger, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, isActive, isSessionActive, isShutdown, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, ping, preShutdown, privilegeSession, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionActive, sessionFinished, sessionFinished, signalShutdown, signalStart, unprivilegeThread
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, ping, preShutdown
-
Methods inherited from interface de.aristaflow.adept2.core.client.RemoteClient
ping
-
-
-
-
Field Detail
-
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 mainlysessionServiceMapping
.
-
-
Constructor Detail
-
MultiplexingClientService
public MultiplexingClientService(org.apache.commons.configuration2.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, aConfigurationException
will be thrown.
-
-
Method Detail
-
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 interfaceADEPT2Service
- Overrides:
init
in classAbstractAuthenticatedService
- 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 ornull
in case the service is not published.- Throws:
AbortServiceException
- If authenticating at the security manager fails, anAbortServiceException
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 interfaceADEPT2Service
- Overrides:
start
in classAbstractADEPT2Service
- Throws:
AbortServiceException
- If this service cannot be started due to a severe problem, anAbortServiceException
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 interfaceADEPT2Service
- Overrides:
shutdown
in classAbstractAuthenticatedService
- 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 interfaceClientService
- Returns:
- The locales available for the client.
-
getExecutorService
public ExecutorService getExecutorService()
Gets anExecutorService
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 interfaceClientService
- Returns:
- An
ExecutorService
for executing long lasting task asynchronously instead of creating own (local) threads.
-
getScheduledExecutorService
public LoggingScheduledThreadPoolExecutor getScheduledExecutorService()
Gets aScheduledExecutorService
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 interfaceClientService
- 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. AClientService.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 interfaceClientService
- 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 interfaceClientService
- 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 interfaceClientService
-
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 anADEPT2Service
.- Specified by:
addServiceStateListener
in interfaceClientService
- 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 designatedADEPT2Service
.- Specified by:
removeServiceStateListener
in interfaceClientService
- 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 withnull
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 interfaceClientService
-
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 interfaceADEPT2ClientService
- Specified by:
getSessionToken
in interfaceClientService
- Returns:
- A session token for the currently active agent and the URIs of this client.
- See Also:
ClientSessionFactory.getSessionToken(URI[])
-
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 interfaceClientService
- 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:
ClientSessionFactory.getSessionToken(Map)
-
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, anIllegalArgumentException
will be thrown.- Specified by:
getSessionToken
in interfaceClientService
- 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, anIllegalArgumentException
will be thrown.- Specified by:
getSessionToken
in interfaceClientService
- 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 interfaceADEPT2ClientService
- Specified by:
getFilterFactory
in interfaceClientService
- 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 interfaceClientService
- Returns:
- the localisation factory
-
getFormatterFactory
public SystemDataFormatterFactory getFormatterFactory()
Description copied from interface:ClientService
Gets the system data formatter factory.- Specified by:
getFormatterFactory
in interfaceClientService
- Returns:
- the system data formatter factory
-
getGraphicalModelFactory
public GraphicalModelFactory getGraphicalModelFactory()
Description copied from interface:ADEPT2ClientService
CL_ARCH client service documentation- Specified by:
getGraphicalModelFactory
in interfaceADEPT2ClientService
- Returns:
- The factory for creating graphical model elements for this client.
-
getInitTabFactory
public InitTabFactory getInitTabFactory()
- Specified by:
getInitTabFactory
in interfaceAdministrationService
-
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 viaAuthentication
.- Specified by:
setAuthenticatedAgents
in interfaceClientService
- 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 interfaceClientService
- 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 interfaceADEPT2ClientService
- Specified by:
getAuthenticatedAgents
in interfaceClientService
- 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 interfaceADEPT2ClientService
- Specified by:
getActiveAgent
in interfaceClientService
- Returns:
- The currently active agent.
- See Also:
ClientSessionFactory.getAuthenticatedAgent()
-
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 registeredlisteners
will be notified (asynchronously) about this.- Specified by:
setActiveAgent
in interfaceClientService
- 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 interfaceClientService
- 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 interfaceClientService
- Parameters:
listener
- The active agent listener to remove.
-
guiSelectionChanged
public void guiSelectionChanged(SelectedGUIElementChangedEvent selectionChangeEvent)
Description copied from interface:ClientService
This method informs all interestedlisteners
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 interfaceClientService
- 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 interfaceClientService
- 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 interfaceClientService
- 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 interfaceADEPT2ClientService
- Specified by:
getUpdateManager
in interfaceAdministrationService
- Specified by:
getUpdateManager
in interfaceModellingClientService
- 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 interfaceClientService
- 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 interfaceCapabilityChecker
- 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, aSecurityTokenIntegrityException
will be thrown.- See Also:
Capabilities
-
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 interfaceCapabilityChecker
- 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, aSecurityTokenIntegrityException
will be thrown.- See Also:
Capabilities
-
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 interfaceCapabilityChecker
- 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, aSecurityTokenIntegrityException
will be thrown.- See Also:
Capabilities
-
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 interfaceCapabilityChecker
- 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, aSecurityTokenIntegrityException
will be thrown.- See Also:
Capabilities
-
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 interfaceClientService
- Returns:
- The licence manager providing the licence for all AristaFlow-services and products.
- Throws:
ServiceNotKnownException
- If there are problems retrieving the licence manager, aServiceNotKnownException
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 interfaceClientService
- 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 interfaceActivityManagerService
- Specified by:
getActivityModelFactory
in interfaceADEPT2ClientService
- 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 interfaceActivityManagerService
- Specified by:
getProcessModelFactory
in interfaceADEPT2ClientService
- Specified by:
getProcessModelFactory
in interfaceAdministrationService
- Specified by:
getProcessModelFactory
in interfaceLocalExecutionClientService
- Specified by:
getProcessModelFactory
in interfaceModellingClientService
- Returns:
- The process model factory for this client
-
getExecutionFactory
public ExecutionFactory getExecutionFactory()
- Specified by:
getExecutionFactory
in interfaceWorklistClientService
-
getResourceModelFactory
public de.aristaflow.adept2.model.resourcemodel.builder.ResourceModelFactory getResourceModelFactory()
- Specified by:
getResourceModelFactory
in interfaceAdministrationService
- Specified by:
getResourceModelFactory
in interfaceModellingClientService
-
getWorklistModelFactory
public WorklistModelFactory getWorklistModelFactory()
Description copied from interface:WorklistClientService
CL_ARCH client service documentation- Specified by:
getWorklistModelFactory
in interfaceWorklistClientService
- Returns:
- The worklist model factory for this client
-
getProcessChecks
public ProcessCheckService getProcessChecks()
- Specified by:
getProcessChecks
in interfaceADEPT2ClientService
- Specified by:
getProcessChecks
in interfaceModellingClientService
-
getActivityRepository
public ActivityRepository getActivityRepository()
Description copied from interface:ADEPT2ClientService
CL_ARCH client service documentation- Specified by:
getActivityRepository
in interfaceActivityManagerService
- Specified by:
getActivityRepository
in interfaceADEPT2ClientService
- 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 interfaceADEPT2ClientService
- Specified by:
getProcessManager
in interfaceAdministrationService
- Specified by:
getProcessManager
in interfaceModellingClientService
- Returns:
- The process manager for this client
-
getSimpleProcessImageRenderer
public SimpleProcessImageRenderer getSimpleProcessImageRenderer()
- Specified by:
getSimpleProcessImageRenderer
in interfaceADEPT2ClientService
- Specified by:
getSimpleProcessImageRenderer
in interfaceAdministrationService
- Specified by:
getSimpleProcessImageRenderer
in interfaceLocalExecutionClientService
-
getProcessImageRenderer
public ProcessImageRenderer getProcessImageRenderer()
- Specified by:
getProcessImageRenderer
in interfaceADEPT2ClientService
- Specified by:
getProcessImageRenderer
in interfaceAdministrationService
- Specified by:
getProcessImageRenderer
in interfaceLocalExecutionClientService
-
getProcessManager
public ProcessManager getProcessManager(UUID instanceID)
Description copied from interface:AdministrationService
CL_ARCH client service documentation- Specified by:
getProcessManager
in interfaceAdministrationService
- Specified by:
getProcessManager
in interfaceWorklistClientService
- Returns:
- The process manager for this client
-
getProcessRepository
public ProcessRepository getProcessRepository()
- Specified by:
getProcessRepository
in interfaceAdministrationService
-
getOrgModelManager
public OrgModelManager getOrgModelManager()
Description copied from interface:ADEPT2ClientService
CL_ARCH client service documentation- Specified by:
getOrgModelManager
in interfaceActivityManagerService
- Specified by:
getOrgModelManager
in interfaceADEPT2ClientService
- Specified by:
getOrgModelManager
in interfaceAdministrationService
- Specified by:
getOrgModelManager
in interfaceWorklistClientService
- Returns:
- The org model manager for this client
-
getExecutionManager
public ExecutionManager getExecutionManager()
- Specified by:
getExecutionManager
in interfaceADEPT2ClientService
- Specified by:
getExecutionManager
in interfaceAdministrationService
-
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 interfaceLocalExecutionClientService
- 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(UUID instId)
Description copied from interface:LocalExecutionClientService
Gets the process manager that is responsible for the instance with the designated (logical) ID.- Specified by:
getProcessManagerForInstanceId
in interfaceLocalExecutionClientService
- Parameters:
instId
- The (logical) ID of the instance for which to retrieve the corresponding process manager. This is resolved using the default execution manager.- Returns:
- The process manager handling the designated instance ID 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 interfaceLocalExecutionClientService
- 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 interfaceLocalExecutionClientService
- 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 forgetExecutionManager().getInstanceControl()
. It may only be called when online.- Specified by:
getInstanceControl
in interfaceADEPT2ClientService
- Specified by:
getInstanceControl
in interfaceAdministrationService
- Specified by:
getInstanceControl
in interfaceWorklistClientService
- Returns:
- An interface allowing to control the execution of an instance.
- See Also:
ExecutionManager.getInstanceControl()
-
getActivityExecutionControl
public ActivityExecutionControl getActivityExecutionControl(EBPInstanceReference activity)
- Specified by:
getActivityExecutionControl
in interfaceAdministrationService
-
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 forgetExecutionManager().getActivityStarting()
except that the returned interface also sets the appropriateRuntimeManager-URIs
. It may only be called when online.- Specified by:
getActivityStarting
in interfaceLocalExecutionClientService
- Specified by:
getActivityStarting
in interfaceWorklistClientService
- 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:
ExecutionManager.getActivityStarting()
-
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 toLocalExecutionClientService.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 forgetRuntimeManager().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 interfaceExecutionClientService
- Specified by:
getRemoteSynchronousActivityStarting
in interfaceRemoteExecutionClientService
- 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, aServiceNotKnownException
will be thrown.- See Also:
RuntimeManager.getSynchronousActivityStarting()
-
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 forgetRuntimeManager().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 interfaceLocalExecutionClientService
- Specified by:
getSynchronousActivityStarting
in interfaceWorklistClientService
- 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:
RuntimeManager.getSynchronousActivityStarting()
-
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 interfaceExecutionClientService
- Specified by:
getRemoteGUIManager
in interfaceRemoteExecutionClientService
- 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, aServicNotKnownException
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 forgetExecutionManager().getInstanceChanging()
. It may only be called when online.- Specified by:
getInstanceChanging
in interfaceADEPT2ClientService
- Returns:
- An interface allowing to control the change of an instance.
- See Also:
ExecutionManager.getInstanceChanging()
-
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 interfaceLocalExecutionClientService
- Returns:
- the execution history
-
getInitTabManager
public InitTabManager getInitTabManager()
- Specified by:
getInitTabManager
in interfaceAdministrationService
-
getResModelManager
public de.aristaflow.adept2.core.resmodelmanager.ResModelManager getResModelManager()
- Specified by:
getResModelManager
in interfaceAdministrationService
- Specified by:
getResModelManager
in interfaceModellingClientService
-
getResModelExplorer
public de.aristaflow.adept2.core.resmodelmanager.ResModelExplorer getResModelExplorer()
- Specified by:
getResModelExplorer
in interfaceLocalExecutionClientService
- Specified by:
getResModelExplorer
in interfaceWorklistClientService
-
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 interfaceWorklistClientService
- 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 interfaceLocalExecutionClientService
- 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 interfaceLocalExecutionClientService
- Specified by:
getRuntimeService
in interfaceWorklistClientService
- 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 interfaceWorklistClientService
- 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 interfaceLocalExecutionClientService
- Specified by:
getAutoStartRuntimeManager
in interfaceWorklistClientService
- 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 interfaceLocalExecutionClientService
- Specified by:
getExecutionControlManager
in interfaceWorklistClientService
- 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:
RuntimeManager.getExecutionControlManager()
-
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 interfaceLocalExecutionClientService
- 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 interfaceADEPT2ClientService
- Specified by:
getModelViewerClass
in interfaceModelViewerProvider
- 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 interfaceServiceAccess
- Type Parameters:
T
- The type of the requested model factory registry.- Parameters:
modelFactoryName
- The name of the requested model factory. Use the names declared inModelRegistryConstants
. 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,
ServiceNotKnownException
wrapping aConfigurationException
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 interfaceServiceAccess
- 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 interfaceServiceAccess
- Type Parameters:
T
- The type which the requested service is expected to be of. This is a subtype ofADEPT2Service
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 toComponentTypes
andBaseConstants
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 ofADEPT2Service
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,
ServiceNotKnownException
will be thrown. This may encapsulate aConfigurationException
or anAbortServiceException
.
-
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 asServiceAccess.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 interfaceServiceAccess
- 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,
ServiceNotKnownException
wrapping aConfigurationException
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 interfaceServiceAccess
- 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,
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 interfaceServiceAccess
- 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,
ServiceNotKnownException
wrapping aConfigurationException
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 interfaceServiceAccess
- Type Parameters:
T
- The type of the requested service. This is a subtype ofADEPT2Service
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 ofADEPT2Service
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,
ServiceNotKnownException
will be thrown. This may encapsulate aConfigurationException
or anAbortServiceException
.
-
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 interfaceServiceAccess
- Type Parameters:
T
- The type of the requested service. This is a subtype ofADEPT2Service
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 ofADEPT2Service
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,
ServiceNotKnownException
will be thrown. This may encapsulate aConfigurationException
or anAbortServiceException
.
-
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 interfaceNameResolution
- 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 interfaceNameResolution
- 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 interfaceNameResolution
- 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 interfaceNameResolution
- 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 interfaceNameResolution
- Parameters:
parameterTypes
- All the parameter types of a method as instances ofClass
.- 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 aConfigurationException
. 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 interfaceServiceAccess
- 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, aConfigurationException
will be thrown.
-
getClientServiceOrException
public ADEPT2ClientService getClientServiceOrException()
Returns the ADEPT2ClientService which was mapped inaddClientService
or throws anIllegalStateException
if no client session context is available.- Returns:
- The ADEPT2ClientService of the current user session.
- Throws:
IllegalStateException
- If there is no client service found, anIllegalStateException
will be thrown.
-
getClientService
public ADEPT2ClientService getClientService()
Returns the ADEPT2ClientService which was mapped inaddClientService
ornull
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), anInvalidServiceStateException
will be thrown.
-
getClientService
public ADEPT2ClientService getClientService(SessionToken session)
This method can be called to receive theADEPT2ClientService
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, aServiceAccessControlException
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, anInvalidServiceStateException
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 bySystem.getProperty("os.name")
.- Specified by:
getOperatingSystemName
in interfaceRemoteClient
- 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 bySystem.getProperty("os.version")
.- Specified by:
getOperatingSystemVersion
in interfaceRemoteClient
- 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 bySystem.getProperty("os.arch")
.- Specified by:
getOperatingSystemArchitecture
in interfaceRemoteClient
- 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 bySystem.getProperty("java.version")
.- Specified by:
getJavaVersion
in interfaceRemoteClient
- 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, thelocale 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 interfaceRemoteClient
- 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 byLocale.getDefault()
.- Specified by:
getDefaultLocale
in interfaceRemoteClient
- 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 byCharset.defaultCharset().name()
.- Specified by:
getDefaultCharset
in interfaceRemoteClient
- 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 interfaceRemoteClient
- 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 interfaceRemoteClient
- 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 interfaceRemoteClient
- 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 invalidshutdownTime
- 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:
RemoteClient.serverReturned(String, URI[])
-
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 interfaceRemoteClient
- 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.
-
-