Class StatePoller.Builder<S,F extends java.lang.Enum<F>>
- java.lang.Object
-
- net.officefloor.plugin.managedobject.poll.StatePoller.Builder<S,F>
-
- Enclosing class:
- StatePoller<S,F extends java.lang.Enum<F>>
public static class StatePoller.Builder<S,F extends java.lang.Enum<F>> extends java.lang.Object
Builder for theStatePoller
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StatePoller<S,F>
build()
Builds theStatePoller
.StatePoller.Builder<S,F>
defaultPollInterval(long defaultPollInterval, java.util.concurrent.TimeUnit unit)
Allows specifying the default poll interval.StatePoller.Builder<S,F>
identifier(java.lang.String identifier)
Allows providing an identifier in the log message to identify theStatePoller
.StatePoller.Builder<S,F>
logger(java.util.logging.Logger logger)
Allows specifying theLogger
.StatePoller.Builder<S,F>
parameter(java.util.function.Function<StatePollContext<S>,java.lang.Object> parameterFactory)
Allows providing a parameter to theProcessState
invoked from theManagedObjectExecuteContext
for polling.StatePoller.Builder<S,F>
pollMargin(long margin, java.util.concurrent.TimeUnit unit)
Allows specifying the poll margin.StatePoller.Builder<S,F>
startup(java.util.function.Consumer<ManagedObjectStartupProcess> startupProcessDecorator)
Provides a decorator of theManagedObjectStartupProcess
.StatePoller.Builder<S,F>
successLogLevel(java.util.logging.Level successLogLevel)
Allows specifying the success logLevel
.
-
-
-
Method Detail
-
defaultPollInterval
public StatePoller.Builder<S,F> defaultPollInterval(long defaultPollInterval, java.util.concurrent.TimeUnit unit)
Allows specifying the default poll interval.- Parameters:
defaultPollInterval
- Default poll interval.unit
-TimeUnit
for the default poll interval.- Returns:
this.
-
pollMargin
public StatePoller.Builder<S,F> pollMargin(long margin, java.util.concurrent.TimeUnit unit)
Allows specifying the poll margin. This is the margin before considering polling not triggering.- Parameters:
margin
- Margin before assuming polling not triggering.unit
-TimeUnit
.- Returns:
this
.
-
successLogLevel
public StatePoller.Builder<S,F> successLogLevel(java.util.logging.Level successLogLevel)
Allows specifying the success logLevel
.- Parameters:
successLogLevel
- Success logLevel
. Providingnull
will reset to default.- Returns:
this
.
-
logger
public StatePoller.Builder<S,F> logger(java.util.logging.Logger logger)
Allows specifying theLogger
.- Parameters:
logger
-Logger
. Providingnull
will reset to default.- Returns:
this
.
-
parameter
public StatePoller.Builder<S,F> parameter(java.util.function.Function<StatePollContext<S>,java.lang.Object> parameterFactory)
Allows providing a parameter to theProcessState
invoked from theManagedObjectExecuteContext
for polling.- Parameters:
parameterFactory
- Factory for parameter.- Returns:
this
.
-
identifier
public StatePoller.Builder<S,F> identifier(java.lang.String identifier)
Allows providing an identifier in the log message to identify theStatePoller
.- Parameters:
identifier
- Identifier.- Returns:
this
.
-
startup
public StatePoller.Builder<S,F> startup(java.util.function.Consumer<ManagedObjectStartupProcess> startupProcessDecorator)
Provides a decorator of theManagedObjectStartupProcess
.- Parameters:
startupProcessDecorator
- Decorate of theManagedObjectStartupProcess
.- Returns:
this
.
-
build
public StatePoller<S,F> build()
Builds theStatePoller
.- Returns:
StatePoller
.
-
-