Class AuthenticatedInjectedService
java.lang.Object
de.aristaflow.adept2.core.registry.InjectedADEPT2Service
de.aristaflow.adept2.core.registry.InitialisedInjectedService
de.aristaflow.adept2.core.registry.AuthenticatedInjectedService
- All Implemented Interfaces:
ADEPT2Service,LogService,ServiceThreadHandling
- Direct Known Subclasses:
ClusterNode
@ConfigurationDescription(properties={@Property(name="ServiceAuthUserName",type=STRING,defaultValue="${arflow:confVar.SystemUserName}"),,})
public abstract class AuthenticatedInjectedService
extends InitialisedInjectedService
This class is similar to
AbstractAuthenticatedService. Like
InitialisedInjectedService this injected service will not be of much
use before initialised by
the platform. For instance, there will be no session factory, so no creation
and no verification of session tokens can take place. Check with
InitialisedInjectedService.isInitialised() whether the injected service is usable. Methods that
usually wait for this service to be started, will not block but throw an
exception before the initialisation. This is similar to their behaviour after
the service has been shut down.-
Field Summary
Fields inherited from class de.aristaflow.adept2.core.registry.InitialisedInjectedService
adept2Service, loggerClass, NOT_INITIALISED_EXCEPTIONFields inherited from class de.aristaflow.adept2.core.registry.InjectedADEPT2Service
EMPTY_STRING_ARRAY, logger, runtimeRequiredServices, startupRequiredServices -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticatedInjectedService(Logger logger) Creates an injected service that can be initialised by the platform and provides a session factory.AuthenticatedInjectedService(Logger logger, String[] startupRequiredServices, String[] runtimeRequiredServices, Class<?> cls) Creates an injected service that can be initialised by the platform and provides a session factory. -
Method Summary
Modifier and TypeMethodDescriptionprotected SessionTokencreateChildSession(SessionToken parentSession) protected SessionTokenprotected QualifiedAgentgetAgent(SessionToken session) Gets the (optional) cluster name, the unique node name and the hierarchical instance name of this service.protected SessionFactoryprotected QualifiedAgentgetTopLevelAgent(SessionToken session) protected Pair<QualifiedAgent,QualifiedAgent> getUserCredentials(SessionToken session) voidinitPlatform(Configuration conf, Registry registry) Creates a wrappedAbstractAuthenticatedService.protected booleansessionHasAllCapabilities(SessionToken session, String... capabilities) protected booleansessionHasOneCapability(SessionToken session, String... capabilities) Methods inherited from class de.aristaflow.adept2.core.registry.InitialisedInjectedService
_sessionActive, _sessionFinished, changeLogContext, changeLogContext, changeLogContext, csvLoggingEnabled, getClassSpecificJulLogger, getLogger, getRelease, init, isActive, isInitialised, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionFinished, shutdown, signalShutdown, signalStart, start, unprivilegeThreadMethods inherited from class de.aristaflow.adept2.core.registry.InjectedADEPT2Service
getLocalUris, getRuntimeRequiredServices, getStartupRequiredServices, getURIs, ping, preShutdown
-
Constructor Details
-
AuthenticatedInjectedService
Creates an injected service that can be initialised by the platform and provides a session factory. It assumes that there are no other services required.- Parameters:
logger- The logger which to use for this service. This will only be used until initialisation by the platform. Afterwards the logger of theAbstractADEPT2Servicewill be used.
-
AuthenticatedInjectedService
public AuthenticatedInjectedService(Logger logger, String[] startupRequiredServices, String[] runtimeRequiredServices, Class<?> cls) Creates an injected service that can be initialised by the platform and provides a session factory. It uses the designated services from the platform.- Parameters:
logger- The logger which to use for this service. This will only be used until initialisation by the platform. Afterwards the logger of theAbstractADEPT2Servicewill be used.startupRequiredServices- The service type names of services required at startup time (inInitialisedInjectedService.init(URI[], URI[])andInitialisedInjectedService.start()).runtimeRequiredServices- The service type names of services required at runtime (after startup time).cls- The class which to use for the logger provided byAbstractADEPT2Service, this is usually the interface of the service.
-
-
Method Details
-
initPlatform
Creates a wrappedAbstractAuthenticatedService.- Overrides:
initPlatformin classInitialisedInjectedService- Parameters:
conf- The configuration provided by the platform.registry- The registry allowing to access the platform.- Throws:
AbortServiceException- If there are problems initialising this service, anAbortServiceExceptionwill be thrown.
-
getServiceInstanceName
Description copied from interface:ADEPT2ServiceGets the (optional) cluster name, the unique node name and the hierarchical instance name of this service.- Specified by:
getServiceInstanceNamein interfaceADEPT2Service- Overrides:
getServiceInstanceNamein classInjectedADEPT2Service- Returns:
- The (optional) cluster name, the unique node name and the hierarchical instance name of this service.
-
getSessionFactory
- Throws:
InvalidServiceStateException- If this service has not been initialised by the platform yet, anInvalidServiceStateExceptionwill be thrown.- See Also:
-
createSession
- Throws:
InvalidServiceStateException- If this service has not been initialised by the platform yet, anInvalidServiceStateExceptionwill be thrown.- See Also:
-
createChildSession
- Throws:
InvalidServiceStateException- If this service has not been initialised by the platform yet, anInvalidServiceStateExceptionwill be thrown.- See Also:
-
sessionHasOneCapability
- Throws:
InvalidServiceStateException- If this service has not been initialised by the platform yet, anInvalidServiceStateExceptionwill be thrown.- See Also:
-
sessionHasAllCapabilities
- Throws:
InvalidServiceStateException- If this service has not been initialised by the platform yet, anInvalidServiceStateExceptionwill be thrown.- See Also:
-
getUserCredentials
- Throws:
InvalidServiceStateException- If this service has not been initialised by the platform yet, anInvalidServiceStateExceptionwill be thrown.- See Also:
-
getTopLevelAgent
- Throws:
InvalidServiceStateException- If this service has not been initialised by the platform yet, anInvalidServiceStateExceptionwill be thrown.- See Also:
-
getAgent
- Throws:
InvalidServiceStateException- If this service has not been initialised by the platform yet, anInvalidServiceStateExceptionwill be thrown.- See Also:
-