Package com.uc4.communication.requests
Class ExecuteObject
java.lang.Object
com.uc4.communication.requests.XMLRequest
com.uc4.communication.requests.ExecuteObject
Executes an UC4 Object.
-
Constructor Summary
ConstructorsConstructorDescriptionExecuteObject(UC4ObjectName name) Constructs aExecuteObjectusing the specified object name. -
Method Summary
Modifier and TypeMethodDescriptionvoidallowImmediateStart(boolean flag) This method can be used to set the behaviour in case the start time lies in the past.protected voidcreateRequest(com.uc4.util.XMLDocument doc, Element request, ConnectionAttributes sessionInfo) Creates the XML Document for the request.voidThis method will set the startImmediate to Zero.voidexecuteOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options) Executes a task only once.voidexecuteOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options, UC4ObjectName queue) Executes a task only once.voidexecuteOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options, UC4ObjectName queue, UC4Alias aliasName) Executes a task only once.voidexecuteRecurring(ExecuteRecurring recurring) Executes a task in a defined period.This method returns a message insert for the message number returned bygetMessageNumber.intThis method returns a message number in case that the execution failed.Returns the error message translated in the language of the user.Returns the settings of the periodic task.intgetRunID()Returns the RunID of this request.protected StringgetSrc()Returns the request source.protected voidhandleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session) Sub classes extract the values from the XML document and provide public getter methods.booleanReturns the execution mode.booleanReturns the execution mode.booleanReturnstrueif this is a recurring execution.voidputPromptBuffer(String variable, String value) Puts the name and content of a script variable to the input buffer.voidputPromptBuffer(String variable, String[] array) Puts the name and content of a script array to the input buffer.protected voidsetDebug(boolean debug) Enables debugging, subclasses may override.voidsetInstanceParameter(String name, String value) This method can be used to set additional parameters which are shown in the details of the task.voidsetWaitForManualRelease(boolean flag) Waits for manual release, this method only works if executeOnce is selected.Methods inherited from class com.uc4.communication.requests.XMLRequest
assertClientZero, assertServerVersion, checkClient, checkID, checkLnr, checkNull, checkSelStatisticsPrivilege, checkSystemOverviewPrivilege, checkUC4ObjectEmptyName, checkUC4ObjectName, createNATFor, createNATRequest, emptyAttributes, getAllMessageBoxes, getMessageBox, getRequestID, handleResponse, ignoreMessageBox, isAllowedInClientZero, send, setMessageBox, showQuarantineNotification
-
Constructor Details
-
ExecuteObject
Constructs aExecuteObjectusing the specified object name. The methodConnection#sendRequesthas to be used if this object needs interactive input (Form). In this caseConnection#sendRequestAndWaitwould block infinitely.- Parameters:
name- name of the UC4 object.
-
-
Method Details
-
setInstanceParameter
This method can be used to set additional parameters which are shown in the details of the task. The value will be replaced if a parameter with the same name already exists.- Parameters:
name- Name of the detail value; max 200 charactersvalue- Value,nullis not allowed
-
putPromptBuffer
Puts the name and content of a script variable to the input buffer. See :PUT_READ_BUFFER, :PUT_PROMPT_BUFFER in the documentation.- Parameters:
variable- Variable name without &value- Value- Since:
- V10
-
putPromptBuffer
Puts the name and content of a script array to the input buffer. See :PUT_READ_BUFFER, :PUT_PROMPT_BUFFER in the documentation.- Parameters:
variable- Variable name without &, for example CHECKGROUP1#array- Content of the variable- Since:
- V10
-
getSrc
Description copied from class:XMLRequestReturns the request source. This method is used internally.- Specified by:
getSrcin classXMLRequest- Returns:
- Source
-
executeOnce
public void executeOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options) Executes a task only once. AnIllegalStateExceptionis thrown ifstartDateis set (notnull) andwaitForManualReleaseistrue. The task is executed using the CLIENT_QUEUE.- Parameters:
startDate- Start date and time or null if the task should start immediately.logicalDate- Start date and time of the logical start date or null if not used.tz- Timezone or null if not usedwaitForManualRelease- specifies if the task should wait for manual releaseoptions- Testoptions or null if not used
-
setWaitForManualRelease
public void setWaitForManualRelease(boolean flag) Waits for manual release, this method only works if executeOnce is selected.- Parameters:
flag- Option to wait for a manual release, true=wait, false=start immediately
-
getRecurringDefinition
Returns the settings of the periodic task.- Returns:
- Recurring settings
-
setDebug
protected void setDebug(boolean debug) Enables debugging, subclasses may override. Internal use only, therefore this method is not public A native message handler needs to be set if debugging is enabled- Parameters:
debug- true if debug should be enabled
-
executeOnce
public void executeOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options, UC4ObjectName queue) Executes a task only once. AnIllegalStateExceptionis thrown ifstartDateis set (notnull) andwaitForManualReleaseistrue.- Parameters:
startDate- Start date and time or null if the task should start immediately.logicalDate- Start date and time of the logical start date or null if not used.tz- Timezone or null if not usedwaitForManualRelease- specifies if the task should wait for manual releaseoptions- Testoptions or null if not usedqueue- Queue which should be used
-
executeOnce
public void executeOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options, UC4ObjectName queue, UC4Alias aliasName) Executes a task only once. AnIllegalStateExceptionis thrown ifstartDateis set (notnull) andwaitForManualReleaseistrue.- Parameters:
startDate- Start date and time or null if the task should start immediately.logicalDate- Start date and time of the logical start date or null if not used.tz- Timezone or null if not usedwaitForManualRelease- specifies if the task should wait for manual releaseoptions- Testoptions or null if not usedqueue- Queue which should be usedaliasName- Alias
-
executeRecurring
Executes a task in a defined period.- Parameters:
recurring- Settings
-
isDirectStart
public boolean isDirectStart()Returns the execution mode.- Returns:
- Returns
trueif the execution is not recurring or execute once otherwisefalse
-
isExecuteOnce
public boolean isExecuteOnce()Returns the execution mode.- Returns:
- Returns
trueif execution mode is execute once otherwisefalse
-
allowImmediateStart
public void allowImmediateStart(boolean flag) This method can be used to set the behaviour in case the start time lies in the past. The default value istruefor compatibility reasons.- Parameters:
flag- true if an UC4 Object should be allowed to start immediately, false if not.
-
createRequest
protected void createRequest(com.uc4.util.XMLDocument doc, Element request, ConnectionAttributes sessionInfo) Description copied from class:XMLRequestCreates the XML Document for the request. This method is used internally.- Specified by:
createRequestin classXMLRequest- Parameters:
doc- Document, used to create new Elementsrequest- Request Element - classes append information to this request elementsessionInfo- Information about the session
-
isExecuteReccuring
public boolean isExecuteReccuring()Returnstrueif this is a recurring execution.- Returns:
- Recurring
-
handleContent
Description copied from class:XMLRequestSub classes extract the values from the XML document and provide public getter methods.- Overrides:
handleContentin classXMLRequest- Parameters:
doc- XML Documentsession- Info about the user session
-
getRunID
public int getRunID()Returns the RunID of this request. If the UC4 Object could not be generated this method returns 0 and the methodgetMsgbox()returns the error message. The return value is also 0 if the request has never been sent.- Returns:
- RunID or 0 if there was an error. Use the method getMessageNumber() and getMessageInsert() to get more information
-
getMessageNumber
public int getMessageNumber()This method returns a message number in case that the execution failed. A return value of 0 means that there was no error.- Returns:
- Message Number
-
getMessageInsert
This method returns a message insert for the message number returned bygetMessageNumber.- Returns:
- Message Insert, the return value can be an empty String but it is never null
-
getMessageText
Returns the error message translated in the language of the user.- Returns:
- Error message if the execution failed, the return value can be an empty String but it is never null
-
executeFirstTimeTask
public void executeFirstTimeTask()This method will set the startImmediate to Zero.
-