public interface ScheduleContext extends ScriptContext
BaseContext.Env
Modifier and Type | Method and Description |
---|---|
void |
addCloseable(Closeable closeable)
To register closeable instances which should be
closed when the
schedule terminates. |
int |
getErrorCount()
Returns the number of errors that occurred while execution.
|
int |
getFatalErrorCount()
Returns the number of fatal errors that occurred while execution.
|
String |
getPath()
For generation this will return a path to
$CMS_SERVER_ROOT$/www/project_$PROJECT_ID$/$SCHEDULE_ENTRY_ID$/ for all other schedule entries $CMS_SERVER_ROOT$/schedule/$SCHEDULE_ENTRY_ID$/ |
Project |
getProject()
Returns the project the currently running schedule entry belongs to.
|
Date |
getStartTime()
Get the start time - the start time is not necessarily the time the schedule entry has been startet - see
setStartTime(java.util.Date) . |
ScheduleTask |
getTask()
the acutal task or
null if no task is currently executed |
int |
getTaskIndex()
the index of the actual task in the
task list or -1 if no task is
currently executed |
List<? extends ScheduleTask> |
getTasks()
Returns the list of schedule tasks defined by the currently executed schedule entry.
|
UserService |
getUserService()
the user service for the project of executed schedule entry
|
Object |
getVariable(String name)
Returns the variable value of the script relying to this context.
|
Set<String> |
getVariableNames()
Gets a list of all variable names which were set by
setVariable(String,java.io.Serializable) |
int |
getWarningCount()
Returns the number of warnings that occurred while execution.
|
boolean |
isStateFailed()
Returns
true if the current run state of this execution is set to failed. |
boolean |
isStateSuccess()
Returns
true if the current run state of this execution is set to successful. |
void |
removeVariable(String name)
Removes the variable with the given name from the context.
|
void |
setProperty(String name,
Object value)
Creates a property entry for the given value identified by the given name.
|
void |
setStartTime(Date value)
Set the start time, e.g. to generate an old version of the project.
|
void |
setStateToFailed()
Sets the run state of this execution to failed.
|
void |
setStateToSuccess()
Sets the run state of this execution to successful.
|
void |
setVariable(String name,
Serializable value)
Sets a variable to this context.
|
getConnection, getProperties, getProperty, logDebug, logError, logError, logInfo, logWarning, removeProperty
is
requestSpecialist, requireSpecialist
@Nullable ScheduleTask getTask()
null
if no task is currently executedgetTaskIndex()
,
getTasks()
int getTaskIndex()
task list
or -1
if no task is
currently executedList<? extends ScheduleTask> getTasks()
ScheduleEntry
@Nullable Project getProject()
ScheduleEntry
@NotNull UserService getUserService()
IllegalStateException
- if the schedule entry is not project dependentString getPath()
Set<String> getVariableNames()
setVariable(String,java.io.Serializable)
Object getVariable(String name)
setVariable(String,java.io.Serializable)
,
removeVariable(String)
void setVariable(String name, Serializable value)
setProperty(String,Object)
to set a property only for the time of the schedule execution.name
- name of the variablevalue
- value of the variableIllegalArgumentException
- if the value is not serializablesetProperty(String,Object)
void removeVariable(String name)
name
- the name of variable to be removedvoid setProperty(String name, Object value)
ScriptContext.getProperty(String)
during the execution
of the belonging schedule entry.
To persist values beyond execution schedule execution use setVariable(String,java.io.Serializable)
instead.setProperty
in interface ScriptContext
name
- the name of the propertyvalue
- the value of the propertyScriptContext.getProperty(String)
,
setVariable(String,java.io.Serializable)
int getFatalErrorCount()
int getErrorCount()
int getWarningCount()
void setStateToFailed()
RunState.ERROR
void setStateToSuccess()
RunState.SUCCESS
boolean isStateFailed()
true
if the current run state of this execution is set to failed.setStateToFailed()
boolean isStateSuccess()
true
if the current run state of this execution is set to successful.setStateToSuccess()
Date getStartTime()
setStartTime(java.util.Date)
.void setStartTime(@NotNull Date value)
Copyright © 2015 e-Spirit AG. All Rights Reserved. Build 5.1.408