public final class ExecOptions extends Object
ExecOptions
could define the allowed 'working time' for Tasks, maximum number of devices concurrently
executing a Rule, etc. All of the defined options are valid for Rules, but only two of them (concurrency(int, int)
and
timeConstraint(String)
) are applicable for Tasks. When a Task is automatically launched by a Rule trigger, those
two execution options are also automatically taken by the triggering Rule.
are applicable for Tasks.
Usage Example: new ExecOptions().oncePerDevice(true).timeConstraint( new DaylySchedule().addTimeSpan(new Date("00:00"), new Date("06:00")) )
Modifier and Type | Class and Description |
---|---|
static class |
ExecOptions.Overlapping
Defines whether multiple Tasks (launched out of the same Rule)
over a particular device can be overlapped or should be replaced.
|
Modifier and Type | Method and Description |
---|---|
ExecOptions |
autoDisable(boolean autoDisable)
Defines whether the Rule should be automatically disabled once all targets from the Scope pass through the triggering conditions.
|
ExecOptions |
concurrency(int limit,
int timeoutSeconds)
Defines concurrency limit execution option.
|
static ExecOptions |
create()
Creates ExecOptions instance ready to be filled with desired options.
|
int |
getConcurrencyLimit()
Returns the maximum number of concurrent device executions.
|
int |
getConcurrencyLimitTimeout() |
ExecOptions.Overlapping |
getOverlapping()
Returns the overlapping option.
|
int |
getPriority()
Returns the
priority value for this ExecOptions object. |
String |
getTimeConstraint()
Returns the time constraint option.
|
boolean |
isAutoDisable()
Returns the
autoDisable option for this ExecOptions object. |
boolean |
isOncePerDevice()
Returns the
oncePerDevice option for this ExecOptions object. |
ExecOptions |
oncePerDevice(boolean oncePerDevice)
Defines whether the Rule can be executed multiple times on a given device, or should be executed only once,
skipping subsequent triggers for that device.
|
ExecOptions |
overlap(ExecOptions.Overlapping option)
Sets
ExecOptions.Overlapping execution option. |
ExecOptions |
priority(int priority)
Defines a rule priority execution option.
|
ExecOptions |
timeConstraint(String timeConstraint)
Defines at what time-schedule it is permitted for the Task to act.
|
String |
toString() |
public static ExecOptions create()
public ExecOptions overlap(ExecOptions.Overlapping option)
ExecOptions.Overlapping
execution option.option
- overlapping option. This option is applicable only for Rules.ExecOptions
object having the provided option added.public ExecOptions concurrency(int limit, int timeoutSeconds)
limit
- concurrency limit number.timeoutSeconds
- timeout in seconds at which a non-confirmed execution expires and stops occupying room in the concurrency limit.
Passing a non-positive value will set this to default value of 30 seconds.ExecOptions
object having the provided option added.public ExecOptions oncePerDevice(boolean oncePerDevice)
oncePerDevice
- flag indicating whether the Rule should be triggered no more than once for the same device.ExecOptions
object having the provided option added.public ExecOptions autoDisable(boolean autoDisable)
oncePerDevice(boolean)
set to true
.
The option is not applicable for Tasks.autoDisable
- flag indicating whether autoDisable
option is switched on.ExecOptions
object having the provided option added.public ExecOptions timeConstraint(String timeConstraint)
timeConstraint
- time schedule constraint supplied as Cron-expression. Examples:
* * 9-17 ? * MON-FRI
: defines work time to be on working days (Monday to Friday) between 9.00-18.00h* * 00-01 * * ?
: defines work to be time every day between 00-02 in the morning. * * * 01 * ?
: defines work time to be on the 1st day of each month .ExecOptions
object having the provided option added.public ExecOptions priority(int priority)
priority
- rule priorityExecOptions
object having the provided option added.public int getConcurrencyLimit()
public int getConcurrencyLimitTimeout()
public ExecOptions.Overlapping getOverlapping()
public String getTimeConstraint()
ExecOptions
object or null
if such is not supplied.public boolean isOncePerDevice()
oncePerDevice
option for this ExecOptions
object.true
if the Rule should be triggered no more than once for the same device,
false
otherwise.public boolean isAutoDisable()
autoDisable
option for this ExecOptions
object.true
if the Rule should be automatically disabled once all targets from the Scope pass
through the triggering conditions, false
otherwise.public int getPriority()
priority
value for this ExecOptions
object.Copyright © 2022 Bosch.IO GmbH. All rights reserved.