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

com.ibm.able.examples.conversation
Class AmabOfferMessageForm

java.lang.Object
  |
  +--com.ibm.able.examples.conversation.AmabOfferMessageForm
All Implemented Interfaces:
MessageForm

public class AmabOfferMessageForm
extends java.lang.Object
implements MessageForm

This class represents the message-form used during the AMAB Conversation by the seller to present an offer-set to the buyer

See Also:
MessageForm, MessageFormFactory

Field Summary
protected static java.lang.String NAME_KEY
           
protected static java.lang.String OBJECT_KEY
           
 
Constructor Summary
AmabOfferMessageForm()
          Default Constructor
AmabOfferMessageForm(java.lang.String newName)
          Single Argument Constructor - as required by the MessageFormFactory
 
Method Summary
 void clearData()
          Sets offerset to null.
 javax.agent.Payload formMessagePayload()
          Creates a message, using constituent data that was stored inside this MessageForm object.
 java.lang.Object[] getData()
          Returns the OfferSet, packed into a length-1 array.
 java.lang.String getName()
          Return the name
 com.ibm.bilateral.OfferSet getOfferSet()
          Return the offerset value
protected  javax.agent.Payload makePayload(java.lang.String localName, com.ibm.bilateral.OfferSet o)
          internal function to create a payload for contituent data
 boolean parseMessagePayload(javax.agent.Payload messagePayload)
          Parses the message into its constituent data, which is (supposed to be) stored inside this message-form object in a type-specific way.
 javax.agent.Payload sampleMessagePayload()
          Return a "sample message" showing the format, but with dummy data values.
 void setData(java.lang.Object[] data)
          Tries to set the selection
 void setName(java.lang.String newName)
          Set the name of the Selection Message
 void setOfferSet(com.ibm.bilateral.OfferSet o)
          Set the offerset value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_KEY

protected static final java.lang.String NAME_KEY

OBJECT_KEY

protected static final java.lang.String OBJECT_KEY
Constructor Detail

AmabOfferMessageForm

public AmabOfferMessageForm()
Default Constructor

AmabOfferMessageForm

public AmabOfferMessageForm(java.lang.String newName)
Single Argument Constructor - as required by the MessageFormFactory
Method Detail

getName

public java.lang.String getName()
Return the name

Returns:
the name

setName

public void setName(java.lang.String newName)
Set the name of the Selection Message

Parameters:
newName - the name

getOfferSet

public com.ibm.bilateral.OfferSet getOfferSet()
Return the offerset value

Returns:
the offerset value

setOfferSet

public void setOfferSet(com.ibm.bilateral.OfferSet o)
Set the offerset value

Parameters:
selection - the actual offerset value

setData

public void setData(java.lang.Object[] data)
             throws java.lang.IllegalArgumentException
Tries to set the selection

Specified by:
setData in interface MessageForm
Parameters:
data - Length-1 array containing an OfferSer as its first (and only) element.

getData

public java.lang.Object[] getData()
Returns the OfferSet, packed into a length-1 array. (To get the name, use getName()).
Specified by:
getData in interface MessageForm

clearData

public void clearData()
Sets offerset to null. Does NOT change name.
Specified by:
clearData in interface MessageForm

makePayload

protected javax.agent.Payload makePayload(java.lang.String localName,
                                          com.ibm.bilateral.OfferSet o)
internal function to create a payload for contituent data

formMessagePayload

public javax.agent.Payload formMessagePayload()
                                       throws java.lang.IllegalStateException
Description copied from interface: MessageForm
Creates a message, using constituent data that was stored inside this MessageForm object. If there's something wrong with the data--e.g., if it hasn't been set, or has been set to bad values, throws an IllegalStateException.
Specified by:
formMessagePayload in interface MessageForm
See Also:
MessageForm.formMessagePayload()

sampleMessagePayload

public javax.agent.Payload sampleMessagePayload()
Description copied from interface: MessageForm
Return a "sample message" showing the format, but with dummy data values. This is inherently limited, because we're not characterizing the range of possible messages. We're only giving one example.
Specified by:
sampleMessagePayload in interface MessageForm
See Also:
MessageForm.sampleMessagePayload()

parseMessagePayload

public boolean parseMessagePayload(javax.agent.Payload messagePayload)
Description copied from interface: MessageForm
Parses the message into its constituent data, which is (supposed to be) stored inside this message-form object in a type-specific way.
Specified by:
parseMessagePayload in interface MessageForm
See Also:
MessageForm.parseMessagePayload(Payload)

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

(C) Copyright IBM Corporation 1999, 2003