Class OutputLimitClause
java.lang.Object
com.espertech.esper.common.client.soda.OutputLimitClause
- All Implemented Interfaces:
Serializable
An output limit clause defines how to limit output of statements and consists of
a selector specifiying which events to select to output, a frequency and a unit.
- See Also:
-
Constructor Summary
ConstructorDescriptionCtor.OutputLimitClause
(OutputLimitSelector selector, Expression[] crontabAtParameters) Ctor.OutputLimitClause
(OutputLimitSelector selector, Expression whenExpression, List<Assignment> thenAssignments) Ctor.OutputLimitClause
(OutputLimitSelector selector, OutputLimitUnit unit) Ctor.OutputLimitClause
(OutputLimitSelector selector, OutputLimitUnit unit, TimePeriodExpression afterTimePeriod, Integer afterNumberOfEvents) Ctor.OutputLimitClause
(OutputLimitSelector selector, TimePeriodExpression timePeriodExpression) Ctor.OutputLimitClause
(OutputLimitSelector selector, Double frequency) Ctor.OutputLimitClause
(OutputLimitSelector selector, Double frequency, String frequencyVariable, OutputLimitUnit unit) Ctor.OutputLimitClause
(OutputLimitSelector selector, String frequencyVariable) Ctor.OutputLimitClause
(TimePeriodExpression afterTimePeriodExpression) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionaddThenAssignment
(Expression assignmentExpression) Adds a then-keyword variable assigment for use with the when-keyword.afterNumberOfEvents
(Integer afterNumberOfEvents) Sets the after-keyword number of events, or null if undefined.afterTimePeriodExpression
(TimePeriodExpression afterTimePeriodExpression) Sets the after-keyword time period.static OutputLimitClause
create
(double frequency) Creates an output limit clause.static OutputLimitClause
create
(Expression whenExpression) Creates an output limit clause with a when-expression and optional then-assignment expressions to be added.static OutputLimitClause
create
(OutputLimitSelector selector, double frequency) Creates an output limit clause.static OutputLimitClause
create
(OutputLimitSelector selector, TimePeriodExpression timePeriodExpression) Creates an output limit clause.static OutputLimitClause
create
(OutputLimitSelector selector, String frequencyVariable) Creates an output limit clause.static OutputLimitClause
create
(TimePeriodExpression timePeriodExpression) Creates an output limit clause.static OutputLimitClause
Creates an output limit clause.static OutputLimitClause
createAfter
(int afterNumEvents) Create with after-only and number of events.static OutputLimitClause
createAfter
(TimePeriodExpression afterTimePeriodExpression) Create with after-only time period.static OutputLimitClause
createSchedule
(Expression[] scheduleParameters) Creates an output limit clause with a crontab 'at' schedule parameters, seeFrequencyParameter
and related.Returns the after-keyword number of events, or null if undefined.Returns the after-keyword time period.Returns the optional expression evaluated when a context partition terminates before triggering output.Returns the set-assignments to execute when a context partition terminates.Returns the crontab parameters, or null if not using crontab-like schedule.Returns output frequency.Returns the variable name of the variable providing output rate frequency values, or null if the frequency is a fixed value.Returns the selector indicating the events to output.Returns the list of optional then-keyword variable assignments, if anyReturns the time period, or null if none provided.getUnit()
Returns the unit the frequency is in.Returns the expression that controls output for use with the when-keyword.boolean
Returns true for output upon termination of a context partitionvoid
setAfterNumberOfEvents
(Integer afterNumberOfEvents) Sets the after-keyword number of events, or null if undefined.void
setAfterTimePeriodExpression
(Expression afterTimePeriodExpression) Sets the after-keyword time period.void
setAndAfterTerminate
(boolean andAfterTerminate) Set true for output upon termination of a context partitionvoid
setAndAfterTerminateAndExpr
(Expression andAfterTerminateAndExpr) Sets an optional expression evaluated when a context partition terminates before triggering output.void
setAndAfterTerminateThenAssignments
(List<Assignment> andAfterTerminateThenAssignments) Sets the set-assignments to execute when a context partition terminates.void
setCrontabAtParameters
(Expression[] crontabAtParameters) Crontab.void
setFrequency
(Double frequency) Set frequency.void
setFrequencyVariable
(String frequencyVariable) Sets the variable name of the variable providing output rate frequency values, or null if the frequency is a fixed value.void
setSelector
(OutputLimitSelector selector) Sets the selector indicating the events to output.void
setThenAssignments
(List<Assignment> thenAssignments) Set then.void
setTimePeriodExpression
(Expression timePeriodExpression) Crontabvoid
setUnit
(OutputLimitUnit unit) Sets the unit the frequency is in.void
setWhenExpression
(Expression whenExpression) Set when.void
toEPL
(StringWriter writer) Renders the clause in textual representation.
-
Constructor Details
-
OutputLimitClause
public OutputLimitClause()Ctor. -
OutputLimitClause
Ctor.- Parameters:
selector
- selectorunit
- unit
-
OutputLimitClause
Ctor.- Parameters:
selector
- is the events to selectfrequency
- a frequency to output at
-
OutputLimitClause
Ctor.- Parameters:
selector
- is the events to selecttimePeriodExpression
- the unit for the frequency
-
OutputLimitClause
Ctor.- Parameters:
afterTimePeriodExpression
- timer period for after.
-
OutputLimitClause
Ctor.- Parameters:
selector
- is the events to selectfrequencyVariable
- is the variable name providing output rate frequency values
-
OutputLimitClause
public OutputLimitClause(OutputLimitSelector selector, Double frequency, String frequencyVariable, OutputLimitUnit unit) Ctor.- Parameters:
selector
- is the events to selectfrequency
- a frequency to output atunit
- the unit for the frequencyfrequencyVariable
- is the variable name providing output rate frequency values
-
OutputLimitClause
public OutputLimitClause(OutputLimitSelector selector, OutputLimitUnit unit, TimePeriodExpression afterTimePeriod, Integer afterNumberOfEvents) Ctor.- Parameters:
selector
- is the events to selectunit
- the unit of selectionafterTimePeriod
- after-keyword time periodafterNumberOfEvents
- after-keyword number of events
-
OutputLimitClause
Ctor.- Parameters:
selector
- is the events to selectcrontabAtParameters
- the crontab schedule parameters
-
OutputLimitClause
public OutputLimitClause(OutputLimitSelector selector, Expression whenExpression, List<Assignment> thenAssignments) Ctor.- Parameters:
selector
- is the events to selectwhenExpression
- the boolean expression to evaluate to control outputthenAssignments
- the variable assignments, optional or an empty list
-
-
Method Details
-
create
Creates an output limit clause.- Parameters:
timePeriodExpression
- a frequency to output at- Returns:
- clause
-
createAfter
Create with after-only time period.- Parameters:
afterTimePeriodExpression
- time period- Returns:
- clause
-
createAfter
Create with after-only and number of events.- Parameters:
afterNumEvents
- num events- Returns:
- clause
-
create
public static OutputLimitClause create(OutputLimitSelector selector, TimePeriodExpression timePeriodExpression) Creates an output limit clause.- Parameters:
selector
- is the events to selecttimePeriodExpression
- a frequency to output at- Returns:
- clause
-
create
Creates an output limit clause.- Parameters:
selector
- is the events to selectfrequency
- a frequency to output at- Returns:
- clause
-
create
Creates an output limit clause.- Parameters:
selector
- is the events to selectfrequencyVariable
- is the variable providing the output limit frequency- Returns:
- clause
-
create
Creates an output limit clause.- Parameters:
frequency
- a frequency to output at- Returns:
- clause
-
create
Creates an output limit clause.- Parameters:
frequencyVariable
- is the variable name providing output rate frequency values- Returns:
- clause
-
create
Creates an output limit clause with a when-expression and optional then-assignment expressions to be added.- Parameters:
whenExpression
- the expression that returns true to trigger output- Returns:
- clause
-
createSchedule
Creates an output limit clause with a crontab 'at' schedule parameters, seeFrequencyParameter
and related.- Parameters:
scheduleParameters
- the crontab schedule parameters- Returns:
- clause
-
getSelector
Returns the selector indicating the events to output.- Returns:
- selector
-
setSelector
Sets the selector indicating the events to output.- Parameters:
selector
- to set
-
getFrequency
Returns output frequency.- Returns:
- frequency of output
-
getUnit
Returns the unit the frequency is in.- Returns:
- unit for the frequency.
-
setUnit
Sets the unit the frequency is in.- Parameters:
unit
- is the unit for the frequency
-
getFrequencyVariable
Returns the variable name of the variable providing output rate frequency values, or null if the frequency is a fixed value.- Returns:
- variable name or null if no variable is used
-
setFrequencyVariable
Sets the variable name of the variable providing output rate frequency values, or null if the frequency is a fixed value.- Parameters:
frequencyVariable
- variable name or null if no variable is used
-
getWhenExpression
Returns the expression that controls output for use with the when-keyword.- Returns:
- expression should be boolean result
-
getTimePeriodExpression
Returns the time period, or null if none provided.- Returns:
- time period
-
getThenAssignments
Returns the list of optional then-keyword variable assignments, if any- Returns:
- list of variable assignments or null if none
-
addThenAssignment
Adds a then-keyword variable assigment for use with the when-keyword.- Parameters:
assignmentExpression
- expression to calculate new value- Returns:
- clause
-
getCrontabAtParameters
Returns the crontab parameters, or null if not using crontab-like schedule.- Returns:
- parameters
-
isAndAfterTerminate
public boolean isAndAfterTerminate()Returns true for output upon termination of a context partition- Returns:
- indicator
-
setAndAfterTerminate
public void setAndAfterTerminate(boolean andAfterTerminate) Set true for output upon termination of a context partition- Parameters:
andAfterTerminate
- indicator
-
toEPL
Renders the clause in textual representation.- Parameters:
writer
- to output to
-
getAfterTimePeriodExpression
Returns the after-keyword time period.- Returns:
- after-keyword time period
-
setAfterTimePeriodExpression
Sets the after-keyword time period.- Parameters:
afterTimePeriodExpression
- after-keyword time period
-
afterTimePeriodExpression
Sets the after-keyword time period.- Parameters:
afterTimePeriodExpression
- after-keyword time period- Returns:
- clause
-
getAfterNumberOfEvents
Returns the after-keyword number of events, or null if undefined.- Returns:
- num events for after-keyword
-
setFrequency
Set frequency.- Parameters:
frequency
- to set
-
setWhenExpression
Set when.- Parameters:
whenExpression
- to set
-
setThenAssignments
Set then.- Parameters:
thenAssignments
- to set
-
setCrontabAtParameters
Crontab.- Parameters:
crontabAtParameters
- to set
-
setTimePeriodExpression
Crontab- Parameters:
timePeriodExpression
- to set
-
setAfterNumberOfEvents
Sets the after-keyword number of events, or null if undefined.- Parameters:
afterNumberOfEvents
- set num events for after-keyword
-
afterNumberOfEvents
Sets the after-keyword number of events, or null if undefined.- Parameters:
afterNumberOfEvents
- set num events for after-keyword- Returns:
- clause
-
getAndAfterTerminateAndExpr
Returns the optional expression evaluated when a context partition terminates before triggering output.- Returns:
- expression
-
setAndAfterTerminateAndExpr
Sets an optional expression evaluated when a context partition terminates before triggering output.- Parameters:
andAfterTerminateAndExpr
- expression
-
getAndAfterTerminateThenAssignments
Returns the set-assignments to execute when a context partition terminates.- Returns:
- set-assignments
-
setAndAfterTerminateThenAssignments
Sets the set-assignments to execute when a context partition terminates.- Parameters:
andAfterTerminateThenAssignments
- set-assignments
-