ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.conversation
Class JasStringLiteralTransform

java.lang.Object
  |
  +--com.ibm.able.conversation.JasMessageTransform
        |
        +--com.ibm.able.conversation.JasStringLiteralTransform
All Implemented Interfaces:
MessageTransform

public class JasStringLiteralTransform
extends JasMessageTransform

Forms & parses a JAS messaging containing a string-literal.

Validation consists of comparing the string found in the message with a given "validation" string.


Field Summary
static java.lang.String JAS_STRING_LITERAL
          ContentType; must match MessageDescription
static java.lang.String TEXT_KEY
          Keys for use in JAS message.
 
Fields inherited from class com.ibm.able.conversation.JasMessageTransform
messagePayload
 
Constructor Summary
JasStringLiteralTransform()
           
 
Method Summary
 boolean configureFor(MessageDescription desc)
          Attempts to configure this MessageTransform to fit the given message description.
 boolean formAndValidate()
          Converts message name & data into a deliverable message object that conforms to this transform's message description.
 java.lang.String[] getDecisionArgNames()
          Returns the names of the decision-data parameters stored in this MessageTransform.
 java.lang.Object[] getDecisionArgs()
          Returns the decision-data parameters stored in this MessageTransform.
 java.lang.Class[] getDecisionArgTypes()
          Returns the class types of the decision-data parameters this MessageTransform is able to transform.
 boolean parseAndValidate()
          Converts message object into name & data, assuming the message conforms to this transform's message description.
protected  boolean parseMessagePayload(javax.agent.Payload payload)
           
 void setDecisionArgs(java.lang.Object[] args)
          Sets the decision-data parameters stored in this MessageTransform.
 void setMessagePayload(javax.agent.Payload newPayload)
           
 
Methods inherited from class com.ibm.able.conversation.JasMessageTransform
getMessage, getMessagePayload, getMessageType, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAS_STRING_LITERAL

public static final java.lang.String JAS_STRING_LITERAL
ContentType; must match MessageDescription

TEXT_KEY

public static final java.lang.String TEXT_KEY
Keys for use in JAS message.
Constructor Detail

JasStringLiteralTransform

public JasStringLiteralTransform()
Method Detail

getDecisionArgNames

public java.lang.String[] getDecisionArgNames()
Description copied from interface: MessageTransform
Returns the names of the decision-data parameters stored in this MessageTransform.

These are meant to be hints about what sort of information is in each object, in the same way that variable names are hints about what the variables contain. This becomes especially useful when the decision data class types are uninformative on their own (e.g., because they're all the same, or because they're very general-purpose classes).

Following copied from interface: com.ibm.conversation.MessageTransform
Returns:
An array of names of the decision-data parameters.

getDecisionArgTypes

public java.lang.Class[] getDecisionArgTypes()
Description copied from interface: MessageTransform
Returns the class types of the decision-data parameters this MessageTransform is able to transform.

Note: this implies that, for any particular MessageTransform instance at any particular time, there is only one such array of class types. However, it is still possible that the class types may depend on the MessageDescription for which this MessageTransform is configured. I.e., in the following fragment, the elements of a1 and a2 are not necessarily equal:

     Class[] a1 = someTransform.getDecisionArgTypes();
     someTransform.configureFor(someDescription);
     Class[] a2 = someTransform.getDecisionArgTypes();
 
Following copied from interface: com.ibm.conversation.MessageTransform
Returns:
An array of Class types of decision-data parameters.

configureFor

public boolean configureFor(MessageDescription desc)
Description copied from interface: MessageTransform
Attempts to configure this MessageTransform to fit the given message description.

If the configuration is successful, this MessageTransform will be able to validate, form, and parse messages matching the given description.

MessageTransforms are not required to be configurable for arbitrary message descriptions, or even configurable at all. Therefore, the return value must always be checked to determine whether the transform object involved could in fact be configured to fit the given description.

Following copied from interface: com.ibm.conversation.MessageTransform
Parameters:
desc - The MessageDescription to configure this MessageTransform for.
Returns:
true if the attempt at configuration was sucessful; false if not.

setMessagePayload

public void setMessagePayload(javax.agent.Payload newPayload)
Overrides:
setMessagePayload in class JasMessageTransform

getDecisionArgs

public java.lang.Object[] getDecisionArgs()
Description copied from interface: MessageTransform
Returns the decision-data parameters stored in this MessageTransform.

These were either set directly--in anticipation of being transformed--via a call to setDecisionArgs(), or else generated from the stored message via a call to parseAndValidate().

Following copied from interface: com.ibm.conversation.MessageTransform
Returns:
An array of decision-data parameters.

setDecisionArgs

public void setDecisionArgs(java.lang.Object[] args)
Description copied from interface: MessageTransform
Sets the decision-data parameters stored in this MessageTransform.

This prepares this MessageTransform for a call to formAndValidate().

Following copied from interface: com.ibm.conversation.MessageTransform
Parameters:
args - The new decision-data parameters.

formAndValidate

public boolean formAndValidate()
Converts message name & data into a deliverable message object that conforms to this transform's message description.
Following copied from interface: com.ibm.conversation.MessageTransform
Returns:
true if the conversion was successful, false if not (e.g., because the decision data was not appropriate to this transform).

parseAndValidate

public boolean parseAndValidate()
Converts message object into name & data, assuming the message conforms to this transform's message description.
Following copied from interface: com.ibm.conversation.MessageTransform
Returns:
true if the conversion was successful, false if not (e.g., because the message object was not appropriate to this transform).

parseMessagePayload

protected boolean parseMessagePayload(javax.agent.Payload payload)

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003