Class BaseCommonService
- java.lang.Object
-
- sailpoint.server.Service
-
- com.identityworksllc.iiq.common.service.BaseCommonService
-
- All Implemented Interfaces:
BaseServiceImplementation
- Direct Known Subclasses:
BaseCommonPluginService
,SingleServerService
public abstract class BaseCommonService extends sailpoint.server.Service implements BaseServiceImplementation
Abstract super-class for services.This class provides some minimal services, such as tracking execution counts and last execution times, then delegates to the
BaseServiceImplementation.implementation(SailPointContext)
method.
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicBoolean
executedOnce
The execution count for this service, available to sub-classesprotected AtomicLong
executionCount
The execution count for this service, available to sub-classesprotected ServiceImplementationInvoker
invoker
The actual callback to the user’s implementation for this service
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseCommonService()
Base common plugin service constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterExecution(sailpoint.api.SailPointContext context)
Hook to execute after execution of the service implementation.void
beforeExecution(sailpoint.api.SailPointContext context)
Hook to execute before execution of the service implementation.void
execute(sailpoint.api.SailPointContext context)
The main entry point of the serviceprotected long
getElapsedRuntimeMillis()
Returns the elapsed runtime of this service, in milliseconds.void
incrementExecutions()
Increments the execution count and sets the executed-once flag to true-
Methods inherited from class sailpoint.server.Service
configure, getDefinition, getInterval, getLastEnd, getLastExecute, getName, getServiceLock, getStatusString, handleRequest, isEnabled, isPriority, isStarted, isStarting, isStopping, ping, setDefinition, setInterval, setLastEnd, setLastExecute, setStarted, setStarting, setStopping, start, suspend, terminate, waitForStart, wake
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.identityworksllc.iiq.common.service.BaseServiceImplementation
getDefinition, implementation, skipExecutionCount
-
-
-
-
Field Detail
-
executedOnce
protected AtomicBoolean executedOnce
The execution count for this service, available to sub-classes
-
executionCount
protected AtomicLong executionCount
The execution count for this service, available to sub-classes
-
invoker
protected ServiceImplementationInvoker invoker
The actual callback to the user’s implementation for this service
-
-
Constructor Detail
-
BaseCommonService
protected BaseCommonService()
Base common plugin service constructor
-
-
Method Detail
-
afterExecution
public void afterExecution(sailpoint.api.SailPointContext context) throws sailpoint.tools.GeneralException
Description copied from interface:BaseServiceImplementation
Hook to execute after execution of the service implementation.If you override this, be sure to invoke super.afterExecution() so that the default behaviors still occur.
- Specified by:
afterExecution
in interfaceBaseServiceImplementation
- Parameters:
context
- The IIQ context- Throws:
sailpoint.tools.GeneralException
- if anything goes wrong- See Also:
BaseServiceImplementation.afterExecution(SailPointContext)
-
beforeExecution
public void beforeExecution(sailpoint.api.SailPointContext context) throws sailpoint.tools.GeneralException
Description copied from interface:BaseServiceImplementation
Hook to execute before execution of the service implementation.If you override this, be sure to invoke super.afterExecution() so that the default behaviors still occur.
- Specified by:
beforeExecution
in interfaceBaseServiceImplementation
- Parameters:
context
- The IIQ context- Throws:
sailpoint.tools.GeneralException
- if anything goes wrong- See Also:
(SailPointContext)
-
execute
public final void execute(sailpoint.api.SailPointContext context) throws sailpoint.tools.GeneralException
The main entry point of the service- Specified by:
execute
in interfaceBaseServiceImplementation
- Overrides:
execute
in classsailpoint.server.Service
- Parameters:
context
- The IIQ context for this service run- Throws:
sailpoint.tools.GeneralException
- if the service execution failed- See Also:
Service.execute(SailPointContext)
-
getElapsedRuntimeMillis
protected long getElapsedRuntimeMillis()
Returns the elapsed runtime of this service, in milliseconds.Services should use this method to stop after a certain timeout period has been reached to avoid bogging down the
Servicer
.- Returns:
- The elapsed runtime of this service, in milliseconds
-
incrementExecutions
public final void incrementExecutions()
Increments the execution count and sets the executed-once flag to true- Specified by:
incrementExecutions
in interfaceBaseServiceImplementation
-
-