|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BusinessInterval
Defines intervals of time that indicate when business operations may take place. Typically, these business operations include business days and hours, excluding weekends and holidays. However, a business interval can include arbitrary stretches of time, spanning any amount of time.
By default, all time is excluded from the BusinessInterval. You must "include" spans of time into the BusinessInterval. For example, to allow jobs to run Monday through Friday, you must include Monday through Friday. By doing so, you will leave the weekends (Saturday and Sunday) excluded from your BusinessInterval. Imagine a time line that stretches from left to right. Included in the time line are working days: Monday through Friday. Excluded from the time line are the weekends. For example, a business interval may include the days Monday through Friday, except weekends and holidays. The holidays are defined through this interface. For example, in the United States, these holidays may include Thanksgiving and New Year's Day.
Method Summary | |
---|---|
void |
addNewInterval(AllowableBusinessInterval newInterval,
AllowableBusinessInterval previousInterval,
BusinessIntervalOperation operation)
Adds a new business interval to this BusinessInterval after the "previous" location using the specified operation. |
void |
addNewInterval(AllowableBusinessInterval newInterval,
BusinessIntervalOperation operation)
Adds a new business interval to this BusinessInterval using operation. |
void |
changeOperation(AllowableBusinessInterval component,
BusinessIntervalOperation newOperation)
Changes the operator that this business interval uses to evaluate component. |
void |
exclude(java.lang.String name,
java.util.Date start,
java.util.Date stop,
java.lang.String duration,
java.lang.String repeatTimeExpression,
int count)
Excludes a span of time from execution. |
void |
exclude(java.lang.String name,
java.util.Date start,
java.lang.String duration,
java.lang.String repeatTimeExpression)
Excludes a span of time from execution. |
void |
exclude(java.lang.String name,
java.lang.String startTimeExpression,
java.lang.String stopTimeExpression,
java.lang.String duration,
java.lang.String repeatTimeExpression,
int count)
Excludes a span of time from execution. |
void |
excludeAll()
Excludes all times for this business interval. |
void |
excludeDay(java.lang.String name,
java.util.Date day)
Excludes a calendar day from execution. |
void |
excludeDay(java.lang.String name,
java.util.Date day,
java.lang.String repeatTimeExpression)
Excludes a calendar day from execution. |
java.util.List |
findPathToComponent(AllowableBusinessInterval component)
Returns a list of BusinessIntervalElements that represents the path to the specified component. |
java.util.List<BusinessIntervalElement> |
getBusinessIntervalElements()
Returns an ordered collection of BusinessIntervalElements that have been added to this business interval. |
void |
include(java.lang.String name,
java.util.Date start,
java.util.Date stop,
java.lang.String duration,
java.lang.String repeatTimeExpression,
int count)
Includes a span of time from execution. |
void |
include(java.lang.String name,
java.util.Date start,
java.lang.String duration,
java.lang.String repeatTimeExpression)
Includes a span of time from execution. |
void |
include(java.lang.String name,
java.lang.String startTimeExpression,
java.lang.String stopTimeExpression,
java.lang.String duration,
java.lang.String repeatTimeExpression,
int count)
Includes a span of time from execution. |
void |
includeAll()
Includes all times for this business interval. |
void |
includeDay(java.lang.String name,
java.util.Date day)
Includes a calendar day from execution. |
void |
includeDay(java.lang.String name,
java.util.Date day,
java.lang.String repeatTimeExpression)
Includes a calendar day for execution. |
boolean |
isFirstComponent(AllowableBusinessInterval component)
Indicates whether the specified component is the first component to be evaluated for this business interval. |
boolean |
isLastComponent(AllowableBusinessInterval component)
Indicates whether the specified component is the last component to be evaluated for this business interval. |
void |
moveBackward(AllowableBusinessInterval component)
Moves the specified component one step later in the evaluation process. |
void |
moveForward(AllowableBusinessInterval component)
Moves the specified component one step earlier in the evaluation process. |
void |
remove(AllowableBusinessInterval component)
Removes the specified component from this BusinessInterval. |
void |
remove(java.lang.String name)
Removes an interval that was previously included or excluded. |
void |
replace(AllowableBusinessInterval original,
AllowableBusinessInterval newInterval,
BusinessIntervalOperation newOperation)
Replaces one business interval with another business interval. |
Methods inherited from interface flux.AllowableBusinessInterval |
---|
getName, isAllowed, isAllowed, setName |
Method Detail |
---|
void addNewInterval(AllowableBusinessInterval newInterval, AllowableBusinessInterval previousInterval, BusinessIntervalOperation operation)
newInterval
- The business interval to add.previousInterval
- The new business interval is added immediately
after this business interval.operation
- The operation to use.void addNewInterval(AllowableBusinessInterval newInterval, BusinessIntervalOperation operation)
newInterval
- The business interval to add.operation
- The operation to use.void changeOperation(AllowableBusinessInterval component, BusinessIntervalOperation newOperation)
component
- The component whose operation will be changed.newOperation
- The newOperation to use.void exclude(java.lang.String name, java.util.Date start, java.lang.String duration, java.lang.String repeatTimeExpression) throws EngineException
exclude("my interval", null, "+2H", "0 0 0 6 * * mon-fri");
name
- The name of the time span.start
- The start date of the time span. The start date
includes the time of day. For example, the time
of day may begin at 08:00. If null, the
starting date is derived by applying the
repeatTimeExpression to the current date. If
null, repeatTimeExpression may not be null.duration
- Time expression indicating how long this
duration should last.repeatTimeExpression
- Time expression indicating when this duration
will start again. The repeateExpression is
relative to the start date. If null, start may
not be null.
EngineException
- If a Time Expression fails.void exclude(java.lang.String name, java.util.Date start, java.util.Date stop, java.lang.String duration, java.lang.String repeatTimeExpression, int count) throws EngineException
exclude("my interval", null, null, "+2H", "0 0 0 6 * * mon-fri", 25);
name
- The name of the time span.start
- The start date of the time span. The start date
includes the time of day. For example, the time
of day may begin at 08:00. If null, the
starting date is derived by applying the
repeatTimeExpression to the current date. If
null, repeatTimeExpression may not be null.stop
- The stop date of the time span. The stop date
is exclusive, that is, the excluded time span
includes the millisecond before the stop date
but not the stop date itself. If null, there is
no stop date.duration
- Time expression indicating how long this
duration should last.repeatTimeExpression
- Time expression indicating when this duration
will start again. The repeatTimeExpression is
relative to the start date. If null, start may
not be null.count
- The maximum number of times that the repeat
expression will be applied. If count is
negative, it is ignored, and the repeat
expression will be applied forever.
EngineException
- If a Time Expression fails.void exclude(java.lang.String name, java.lang.String startTimeExpression, java.lang.String stopTimeExpression, java.lang.String duration, java.lang.String repeatTimeExpression, int count) throws EngineException
exclude("my interval", "+10d", "+25d", "+2H", "0 0 0 6 * * mon-fri", -1);
name
- The name of the time span.startTimeExpression
- The start date of the time span, which is
calculated by applying the startTimeExpression
to the current date. The start date includes
the time of day. For example, the time of day
may begin at 08:00. If null, the starting date
is derived by applying the repeatTimeExpression
to the current date. If null, repeatTimeExpression
may not be null.stopTimeExpression
- The stop date of the time span, which is
calculated by applying the stopTimeExpression
to the start date. The stop date is exclusive,
that is, the excluded time span includes the
millisecond before the stop date but not the
stop date itself. If null, there is no stop
date.duration
- Time expression indicating how long this
duration should last.repeatTimeExpression
- Time expression indicating when this duration
will start again. The repeatTimeExpression is
relative to the start date. If null,
startTimeExpression may not be null.count
- The maximum number of times that the repeat
expression will be applied. If count is
negative, it is ignored, and the repeat
expression will be applied forever.
EngineException
- If a Time Expression fails.void excludeAll()
void excludeDay(java.lang.String name, java.util.Date day) throws EngineException
name
- The name of the day.day
- The calendar day to exclude. The time component of the day,
hour/minute/second/millisecond, is ignored.
EngineException
- If day is null.void excludeDay(java.lang.String name, java.util.Date day, java.lang.String repeatTimeExpression) throws EngineException
name
- The name of the day.day
- The calendar day to exclude. The time component
of the day, hour/minute/second/millisecond, is
ignored. If null, the starting date is derived
by applying the repeatTimeExpression to the
current date. If null, repeatTimeExpression may
not be null.repeatTimeExpression
- Time expression indicating when this duration
will start again. The repeatTimeExpression is
relative to the start date. If null, day may
not be null.
EngineException
- If day is null or a Time Expression is illegal.java.util.List findPathToComponent(AllowableBusinessInterval component)
component
- The component whose path to find.
java.util.List<BusinessIntervalElement> getBusinessIntervalElements()
void include(java.lang.String name, java.util.Date start, java.util.Date stop, java.lang.String duration, java.lang.String repeatTimeExpression, int count) throws EngineException
include("my interval", null, null, "+2H", "0 0 0 6 * * mon-fri", 25);
name
- The name of the time span.start
- The start date of the time span. The start date
includes the time of day. For example, the time
of day may begin at 08:00. If null, the
starting date is derived by applying the
repeatTimeExpression to the current date. If
null, repeatTimeExpression may not be null.stop
- The stop date of the time span. The stop date
is exclusive, that is, the excluded time span
includes the millisecond before the stop date
but not the stop date itself. If null, there is
no stop date.duration
- Time expression indicating how long this
duration should last.repeatTimeExpression
- Time expression indicating when this duration
will start again. The repeatTimeExpression is
relative to the start date. If null, start may
not be null.count
- The maximum number of times that the repeat
expression will be applied. If count is
negative, it is ignored, and the repeat
expression will be applied forever.
EngineException
- If a Time Expression fails.void include(java.lang.String name, java.util.Date start, java.lang.String duration, java.lang.String repeatTimeExpression) throws EngineException
include("my interval", null, "+2H", "0 0 0 6 * * mon-fri");
name
- The name of the time span.start
- The start date of the time span. The start date
includes the time of day. For example, the time
of day may begin at 08:00. If null, the
starting date is derived by applying the
repeatTimeExpression to the current date. If
null, repeatTimeExpression may not be null.duration
- Time expression indicating how long this
duration should last.repeatTimeExpression
- Time expression indicating when this duration
will start again. The repeatTimeExpression is
relative to the start date. If null, start may
not be null.
EngineException
- If a Time Expression fails.void include(java.lang.String name, java.lang.String startTimeExpression, java.lang.String stopTimeExpression, java.lang.String duration, java.lang.String repeatTimeExpression, int count) throws EngineException
include("my interval", "+10d", "+25d", "+2H", "0 0 0 6 * * mon-fri", -1);
name
- The name of the time span.startTimeExpression
- The start date of the time span, which is
calculated by applying the startTimeExpression
to the current date. The start date includes
the time of day. For example, the time of day
may begin at 08:00. If null, the starting date
is derived by applying the repeatTimeExpression
to the current date. If null, repeatTimeExpression
may not be null.stopTimeExpression
- The stop date of the time span, which is
calculated by applying the stopTimeExpression
to the start date. The stop date is exclusive,
that is, the excluded time span includes the
millisecond before the stop date but not the
stop date itself. If null, there is no stop
date.duration
- Time expression indicating how long this
duration should last.repeatTimeExpression
- Time expression indicating when this duration
will start again. The repeatTimeExpression is
relative to the start date. If null,
startTimeExpression may not be null.count
- The maximum number of times that the repeat
expression will be applied. If count is
negative, it is ignored, and the repeat
expression will be applied forever.
EngineException
- If a Time Expression fails.void includeAll()
void includeDay(java.lang.String name, java.util.Date day) throws EngineException
name
- The name of the day.day
- The calendar day to include. The time component of the day,
hour/minute/second/millisecond, is ignored.
EngineException
- If day is null.void includeDay(java.lang.String name, java.util.Date day, java.lang.String repeatTimeExpression) throws EngineException
name
- The name of the day.day
- The calendar day to include. The time component
of the day, hour/minute/second/millisecond, is
ignored. If null, the starting date is derived
by applying the repeatTimeExpression to the
current date. If null, repeatTimeExpression may
not be null.repeatTimeExpression
- Time expression indicating when this duration
will start again. The repeatTimeExpression is
relative to the start date. If null, day may
not be null.
EngineException
- If day is null or a Time Expression is illegal.boolean isFirstComponent(AllowableBusinessInterval component)
component
- The component that is evaluated.
boolean isLastComponent(AllowableBusinessInterval component)
component
- The component that is evaluated.
void moveForward(AllowableBusinessInterval component)
component
- Moves the specified component one step earlier in the
evaluation process.void moveBackward(AllowableBusinessInterval component)
component
- Moves specified component one step later in the evaluation
process.void remove(AllowableBusinessInterval component)
component
- The component to remove.void remove(java.lang.String name)
name
- The name of the interval to remove.void replace(AllowableBusinessInterval original, AllowableBusinessInterval newInterval, BusinessIntervalOperation newOperation)
original
- The original interval that was added to this
BusinessInterval.newInterval
- The interval that will replace the original interval.newOperation
- The new operation to use with newInterval.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |