Class Pmessage
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ExternalPmessage
@ThreadSafe public class Pmessage extends PmessageBase implements java.io.Serializable
The body of the message can be empty or nonempty. An empty message is sent solely to convey the subject value. A nonempty message contains a body that will be present in one of three mutually exclusive forms. The purpose of this complexity is that it supports a lazy evaluation for some functions. E.g., if the body is present as a file name, then the message can be passed around on the same machine very easily without moving the file. Short messages can be implemented easily with the stringBody alternative.
The current version of this class contains a convenience function to determine the type of body content. Note that the addition of a type field might break older software but a field might be added in the future.
The current version contains lines of code that have been converted to comments in order to disable a feature for conveying a Stream body. The reason for this step is that no existing code implements the stream feature. Moreover, it is not compatible with a JMS implementation of a message system. Therefore, we do not expect that the stream feature will ever be enabled.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Pmessage.PmessageBody
The PmessageBody class contains a message body for the Pmessage class. -
Field Summary
Fields inherited from class pygar.communication.PmessageBase
brokerId, marketId, recipientId, senderId, sessionId, subject
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Pmessage.PmessageBody
getBody()
PmessageBodyType
getBodyType()
java.lang.String
getBrokerId()
java.lang.String
getFileBodyName()
java.lang.String
getMarketId()
java.lang.String
getRecipientId()
java.lang.String
getSenderId()
java.lang.String
getSessionId()
java.lang.String
getStringBody()
java.lang.String
getSubject()
PmessageBase
makePmessageBase()
Upcast a Pmessage to a PmessageBase possibly loosing the body fieldvoid
partialPrint()
void
setBody(Pmessage.PmessageBody body)
void
setBrokerId(java.lang.String brokerId)
void
setFileBodyName(java.lang.String fileBodyName)
void
setMarketId(java.lang.String marketId)
void
setRecipientId(java.lang.String recipientId)
void
setSenderId(java.lang.String senderId)
void
setSessionId(java.lang.String sessionId)
void
setStringBody(java.lang.String stringBody)
void
setSubject(java.lang.String subject)
-
Constructor Details
-
Method Details
-
getBodyType
-
makePmessageBase
Upcast a Pmessage to a PmessageBase possibly loosing the body field- Returns:
-
setStringBody
public void setStringBody(java.lang.String stringBody) -
getStringBody
public java.lang.String getStringBody() -
setFileBodyName
public void setFileBodyName(java.lang.String fileBodyName) -
getFileBodyName
public java.lang.String getFileBodyName() -
getSenderId
public java.lang.String getSenderId()- Overrides:
getSenderId
in classPmessageBase
-
setSenderId
public void setSenderId(java.lang.String senderId)- Overrides:
setSenderId
in classPmessageBase
-
getRecipientId
public java.lang.String getRecipientId()- Overrides:
getRecipientId
in classPmessageBase
-
setRecipientId
public void setRecipientId(java.lang.String recipientId)- Overrides:
setRecipientId
in classPmessageBase
-
getBrokerId
public java.lang.String getBrokerId()- Overrides:
getBrokerId
in classPmessageBase
-
setBrokerId
public void setBrokerId(java.lang.String brokerId)- Overrides:
setBrokerId
in classPmessageBase
-
getMarketId
public java.lang.String getMarketId()- Overrides:
getMarketId
in classPmessageBase
-
setMarketId
public void setMarketId(java.lang.String marketId)- Overrides:
setMarketId
in classPmessageBase
-
getSessionId
public java.lang.String getSessionId()- Overrides:
getSessionId
in classPmessageBase
-
setSessionId
public void setSessionId(java.lang.String sessionId)- Overrides:
setSessionId
in classPmessageBase
-
getBody
-
setBody
-
getSubject
public java.lang.String getSubject()- Overrides:
getSubject
in classPmessageBase
-
setSubject
public void setSubject(java.lang.String subject)- Overrides:
setSubject
in classPmessageBase
-
partialPrint
public void partialPrint()- Overrides:
partialPrint
in classPmessageBase
-