Package com.uc4.communication.requests
Class ExecuteObject
- java.lang.Object
-
- com.uc4.communication.requests.XMLRequest
-
- com.uc4.communication.requests.ExecuteObject
-
public class ExecuteObject extends XMLRequest
Executes an UC4 Object.
-
-
Constructor Summary
Constructors Constructor Description ExecuteObject(UC4ObjectName name)
Constructs aExecuteObject
using the specified object name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allowImmediateStart(boolean flag)
This method can be used to set the behaviour in case the start time lies in the past.protected void
createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element request, ConnectionAttributes sessionInfo)
Creates the XML Document for the request.void
executeFirstTimeTask()
This method will set the startImmediate to Zero.void
executeOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options)
Executes a task only once.void
executeOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options, UC4ObjectName queue)
Executes a task only once.void
executeOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options, UC4ObjectName queue, UC4Alias aliasName)
Executes a task only once.void
executeRecurring(ExecuteRecurring recurring)
Executes a task in a defined period.java.lang.String
getMessageInsert()
This method returns a message insert for the message number returned bygetMessageNumber
.int
getMessageNumber()
This method returns a message number in case that the execution failed.java.lang.String
getMessageText()
Returns the error message translated in the language of the user.ExecuteRecurring
getRecurringDefinition()
Returns the settings of the periodic task.int
getRunID()
Returns the RunID of this request.protected java.lang.String
getSrc()
Returns the request source.protected void
handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
Sub classes extract the values from the XML document and provide public getter methods.boolean
isDirectStart()
Returns the execution mode.boolean
isExecuteOnce()
Returns the execution mode.boolean
isExecuteReccuring()
Returnstrue
if this is a recurring execution.void
putPromptBuffer(java.lang.String variable, java.lang.String value)
Puts the name and content of a script variable to the input buffer.void
putPromptBuffer(java.lang.String variable, java.lang.String[] array)
Puts the name and content of a script array to the input buffer.protected void
setDebug(boolean debug)
Enables debugging, subclasses may override.void
setInstanceParameter(java.lang.String name, java.lang.String value)
This method can be used to set additional parameters which are shown in the details of the task.void
setWaitForManualRelease(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 Detail
-
ExecuteObject
public ExecuteObject(UC4ObjectName name)
Constructs aExecuteObject
using the specified object name. The methodConnection#sendRequest
has to be used if this object needs interactive input (Form). In this caseConnection#sendRequestAndWait
would block infinitely.- Parameters:
name
- name of the UC4 object.
-
-
Method Detail
-
setInstanceParameter
public void setInstanceParameter(java.lang.String name, java.lang.String value)
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,null
is not allowed
-
putPromptBuffer
public void putPromptBuffer(java.lang.String variable, java.lang.String value)
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
public void putPromptBuffer(java.lang.String variable, java.lang.String[] array)
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
protected java.lang.String getSrc()
Description copied from class:XMLRequest
Returns the request source. This method is used internally.- Specified by:
getSrc
in classXMLRequest
- Returns:
- Source
-
executeOnce
public void executeOnce(DateTime startDate, DateTime logicalDate, UC4TimezoneName tz, boolean waitForManualRelease, ExecuteTestOptions options)
Executes a task only once. AnIllegalStateException
is thrown ifstartDate
is set (notnull
) andwaitForManualRelease
istrue
. 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
public ExecuteRecurring 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. AnIllegalStateException
is thrown ifstartDate
is set (notnull
) andwaitForManualRelease
istrue
.- 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. AnIllegalStateException
is thrown ifstartDate
is set (notnull
) andwaitForManualRelease
istrue
.- 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
public void executeRecurring(ExecuteRecurring recurring)
Executes a task in a defined period.- Parameters:
recurring
- Settings
-
isDirectStart
public boolean isDirectStart()
Returns the execution mode.- Returns:
- Returns
true
if the execution is not recurring or execute once otherwisefalse
-
isExecuteOnce
public boolean isExecuteOnce()
Returns the execution mode.- Returns:
- Returns
true
if 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 istrue
for 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, org.w3c.dom.Element request, ConnectionAttributes sessionInfo)
Description copied from class:XMLRequest
Creates the XML Document for the request. This method is used internally.- Specified by:
createRequest
in 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()
Returnstrue
if this is a recurring execution.- Returns:
- Recurring
-
handleContent
protected void handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
Description copied from class:XMLRequest
Sub classes extract the values from the XML document and provide public getter methods.- Overrides:
handleContent
in 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
public java.lang.String 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
public java.lang.String 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.
-
-