public class RAPPCallObject extends RAPPAction
The action also supports checking for an expected return code from the object. If the value does not correspond, an error is stored in the object. In case of an error, there is a choice to abort or to continue processing further actions.
Example: call the TEST object with CMD action, and do not abort when the return code is not "123" (the expected return code:
RAPPTransaction trans=new RAPPTransaction(); RAPPCallObject co=new RAPPCallObject("TEST","test1",RAPPCallObject.CMD,"argStrin"); co.setExpectedReturn("123",false); trans.addAction(co); ... Send transaction to server and get reply ... if ( co.getErrorCode()==0 ) System.out.println("TEST returned: "+co.getReturnString()); else System.out.println("TEST error code "+co.getErrorCode()+" '" +co.getErrorDescription()+"': returned: " +co.getReturnString());
Modifier and Type | Field and Description |
---|---|
static String[] |
actionTable
Table of strings for object calling.
|
static int |
CHAR
Character accept/convert object message.
|
static int |
CHECK
Check field object message.
|
static int |
CLK
Single-click object message.
|
static int |
CLOSE
Close request of panels object message.
|
static int |
CMD
Command object message.
|
static int |
CRT
Create object message.
|
static int |
DBLCLK
Double-click object message.
|
static int |
DEFOC
Lose focus object message.
|
static int |
FOC
Get focus object message.
|
static int |
HCHG
Host-change object message.
|
static int |
HIDDEN
Hidden panel object message.
|
static int |
QMSG
Query message type object message.
|
static int |
RECRT
Recreate panel object message.
|
static int |
REM
Remove object message.
|
static int |
SEL
Selection in list object message.
|
static int |
SHOW
Show panel object message.
|
static int |
START
Start local application object message.
|
static int |
UCHG
User-change object message.
|
static int |
XLATE
Translate string object message.
|
ACTION_CALL_CLASS, ACTION_CALL_HOST, ACTION_CALL_OBJECT, ACTION_CALL_PANEL, ACTION_GLOB_VAR, ERROR_CALL_CLASS_RUN_ACTION, ERROR_CONTROL_ID_NOT_FOUND, ERROR_GLOB_VAR_NOT_FOUND, ERROR_HOST_FIELD_NOT_FOUND, ERROR_HOST_SESSION_NOT_CONNECTED, ERROR_INSTANCIATING_CALLED_CLASS, ERROR_INTERFACE_NOT_FOUND, ERROR_NOT_CURRENT_HOST_SCREEN, ERROR_OBJECT_NOT_FOUND, ERROR_UNEXPECTED_RETURN_STRING, errorCode, errorDescription
Modifier | Constructor and Description |
---|---|
protected |
RAPPCallObject()
Creates an uninitialized CallObject instance.
|
|
RAPPCallObject(String subject,
String callerID,
int action,
String value)
Creates a new object to call in the server.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAbort()
Gets the flag indicating if the actions should abort running subsequent
actions if the expected return string is not matching.
|
int |
getAction()
Gets the action value (zero if not defined).
|
String |
getActionClass()
Returns the action class "callObject".
|
int |
getActionType()
Gets the type of action for this class.
|
String |
getCallerID()
Gets the caller ID.
|
String |
getComment()
Comment for action class tag when serialized from a request
the first time.
|
String |
getExpectedReturn()
Gets the expected return string from the object, null for no
checking.
|
RAPPNameSpaceItem |
getNameSpaceItem()
Gets the namespace item for this action.
|
static int |
getObjectAction(String action)
Converts an object action string into a numeric value
(case insensitive).
|
String |
getReturnString()
Gets the return code after the object has returned a value.
|
String |
getSubject()
Gets The Phantom Object ID in upper case (null if not defined).
|
String |
getValue()
Gets the value to pass to the object (the third parameter) often
referred to as the "string parameter - argStr".
|
String |
paramString()
Gets the parameter string for this class for testing purposes.
|
void |
serializeFromReply(RAPPElement reply)
Initializes the action class instance from a reply element.
|
void |
serializeFromRequest(RAPPElement request)
Initializes the action class instance from a request element.
|
void |
serializeToReply(RAPPElement reply)
Initializes the reply Element with all attributes.
|
void |
serializeToRequest(RAPPElement request)
Initializes the request Element with all attributes.
|
void |
setExpectedReturn(String expectedReturn,
boolean abort)
Sets the expected return string and abort flag option.
|
void |
setReturnString(String returnString)
Sets the return code after the object has returned a value.
|
appendReplyElement, appendReplyElement, appendRequestElement, getClass, getErrorCode, getErrorDescription, initialize, removeAllElements, setError, toString, updateReplyFromDocument
public static final int CRT
public static final int REM
public static final int UCHG
public static final int HCHG
public static final int FOC
public static final int DEFOC
public static final int CLK
public static final int DBLCLK
public static final int CMD
public static final int SEL
public static final int CLOSE
public static final int CHAR
public static final int CHECK
public static final int HIDDEN
public static final int RECRT
public static final int XLATE
public static final int START
public static final int SHOW
public static final int QMSG
public static final String[] actionTable
The table contains the strings: CRT, REM, UCHG HCHG, FOC, DEFOC, CLK, DBLCLK, CMD, SEL, CLOSE, CHAR CHECK, HIDDEN, RECRT, XLATE, START, SHOW, QMSG.
protected RAPPCallObject()
public RAPPCallObject(String subject, String callerID, int action, String value)
Call the method setExpectedReturn
to
specify such an operation.
subject
- The Phantom Object ID.callerID
- The caller ID. This is the ID parameter
(the first parameter) being passed to the
object. The parameter is often referred to as
the "id - argId".action
- The action value. The parameter is often
referred to as the "command - argCmd".value
- The value to pass to the object (the third
parameter) often referred to as the "string
parameter - argStr".setExpectedReturn(java.lang.String, boolean)
public static int getObjectAction(String action)
Valid strings (no matter character case) are: CRT, REM, UCHG HCHG, FOC, DEFOC, CLK, DBLCLK, CMD, SEL, CLOSE, CHAR CHECK, HIDDEN, RECRT, XLATE, START, SHOW, QMSG.
public RAPPNameSpaceItem getNameSpaceItem()
getNameSpaceItem
in class RAPPAction
public String getActionClass()
getActionClass
in class RAPPAction
public String getSubject()
public String getCallerID()
public int getAction()
public String getValue()
public String getExpectedReturn()
public boolean getAbort()
public String getReturnString()
public int getActionType()
getActionType
in class RAPPAction
public void setExpectedReturn(String expectedReturn, boolean abort)
expectedReturn
- The expected return string from the
object, null for no checking.abort
- Flag indicating if the actions should
abort running subsequent actions if the
expected return string is not matching.
If the expected return code is null, the
value of this flag is ignored.public void setReturnString(String returnString)
public String getComment()
getComment
in class RAPPAction
public void serializeToRequest(RAPPElement request)
The XML for the node looks like (replace parenthesis with less-more-than signs):
(callObjectRequest subject ="MYOBJECT" callerID ="MYID" action ="CMD" value ="string" [ expectedReturn="whatWeExpect" abort ="boolean" ] /)
serializeToRequest
in class RAPPAction
public void serializeFromRequest(RAPPElement request) throws SAXException
serializeFromRequest
in class RAPPAction
SAXException
- for errors in the document.public void serializeToReply(RAPPElement reply)
The XML for the node looks like (replace parenthesis with less-more-than signs):
(callObjectReply [ returnString ="WhatTheObjectReturned" ] [ errorCode ="123" errorDescription="Object ID not found" ] /)
serializeToReply
in class RAPPAction
public void serializeFromReply(RAPPElement reply) throws SAXException
serializeFromReply
in class RAPPAction
SAXException
- for errors in the document.public String paramString()
paramString
in class RAPPAction
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.