com.tibco.bpm.web.client.model.pagebus.message
Class PageBusMessage

java.lang.Object
  extended by com.tibco.bpm.web.client.model.pagebus.message.PageBusMessage
Direct Known Subclasses:
PageBusMessageNative, PageBusMessageObject

public class PageBusMessage
extends java.lang.Object

Provides a well defined JSON serializable message object that is used for publishing messages to the TIBCO PageBus. For messages published to a ManagedHub or to a cached topic the PageBusMessage must be JSON serializable.

A PageBusMessage consists of a message, a schemaId, and a topic.

A base PageBusMessage class instance is always JSON serializable.

A PageBusMessageObject class instance is only JSON serializable if the message value is null or a String.

A PageBusMessageNative class instance might be JSON serializable depending on the content of the JavaScriptObject from which it is constructed.

©2011 Cloud Software Group, Inc.

Since:
1.2.0
See Also:
PageBusMessageObject, PageBusMessageNative

Field Summary
static java.lang.String DEFAULT_SCHEMA_ID
           
 
Constructor Summary
PageBusMessage()
          Constructs instance with: message set to: null schemaId set to: DEFAULT_SCHEMA_ID: "com.tibco.bpm.web.client.model.pagebus.message.PageBusMessage" topic set to: null
PageBusMessage(com.google.gwt.json.client.JSONValue message)
          Constructs instance with: schemaId set to: DEFAULT_SCHEMA_ID: "com.tibco.bpm.web.client.model.pagebus.message.PageBusMessage" topic set to: null
PageBusMessage(com.google.gwt.json.client.JSONValue message, java.lang.String schemaId)
          Constructs instance with: topic set to: null
PageBusMessage(com.google.gwt.json.client.JSONValue message, java.lang.String schemaId, java.lang.String topic)
          Constructor.
PageBusMessage(java.lang.String schemaId, com.google.gwt.json.client.JSONValue message)
          Deprecated. Use: PageBusMessage(JSONValue, String)
 
Method Summary
static PageBusMessage createMessage(java.lang.String topic, com.google.gwt.core.client.JavaScriptObject message)
          Creates a PageBusMessage from the given JavaScriptObject.
 com.google.gwt.json.client.JSONValue getMessage()
           
 PageBusMessageType getMessageType()
           
static java.lang.String getMessageType(com.google.gwt.core.client.JavaScriptObject message)
           
 com.google.gwt.core.client.JavaScriptObject getNativeMessage()
           
 com.google.gwt.json.client.JSONObject getPageBusMessage()
           
 java.lang.String getSchemaId()
           
 java.lang.String getStringValue()
           
 java.lang.String getTopic()
           
 void setSchemaId(java.lang.String schemaId)
          Sets the schemaId value.
 void setTopic(java.lang.String topic)
          Sets the topic value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SCHEMA_ID

public static final java.lang.String DEFAULT_SCHEMA_ID
See Also:
Constant Field Values
Constructor Detail

PageBusMessage

public PageBusMessage()
Constructs instance with:


PageBusMessage

public PageBusMessage(com.google.gwt.json.client.JSONValue message)
Constructs instance with:

Parameters:
message - The message value that will be published. This may be null.

PageBusMessage

public PageBusMessage(java.lang.String schemaId,
                      com.google.gwt.json.client.JSONValue message)
Deprecated. Use: PageBusMessage(JSONValue, String)

Constructs instance with:

Parameters:
schemaId - An id for the message schema.
message - The message value that will be published. This may be null.

PageBusMessage

public PageBusMessage(com.google.gwt.json.client.JSONValue message,
                      java.lang.String schemaId)
Constructs instance with:

Parameters:
message - The message value that will be published. This may be null.
schemaId - An id for the message schema.

PageBusMessage

public PageBusMessage(com.google.gwt.json.client.JSONValue message,
                      java.lang.String schemaId,
                      java.lang.String topic)
Constructor.

Parameters:
message - The message value that will be published. This may be null.
schemaId - An id for the message schema. This may be null. See: setSchemaId(String)
topic - The topic to publish the message on. This may be null. See: setTopic(String)
Method Detail

createMessage

public static final PageBusMessage createMessage(java.lang.String topic,
                                                 com.google.gwt.core.client.JavaScriptObject message)
Creates a PageBusMessage from the given JavaScriptObject. This method is generally used to reconstituted a Java PageBusMessage that was sent over the PageBus ManagedHub as a JavaScriptObject. The normal PageBusMessage constructors should be used to create all other instances. The returned type will be one of: - PageBusMessage - PageBusMessageObject - PageBusMessageNative based on the origin of the given JavaScriptObject message param. The given topic value is set on the PageBusMessage only if the topic was not previously set on the PageBusMessage.

Parameters:
topic - The topic the message
message -
Returns:
A PageBusMessage whose type is determined by the message param.

getMessageType

public static final java.lang.String getMessageType(com.google.gwt.core.client.JavaScriptObject message)

getNativeMessage

public com.google.gwt.core.client.JavaScriptObject getNativeMessage()

getPageBusMessage

public com.google.gwt.json.client.JSONObject getPageBusMessage()

getTopic

public java.lang.String getTopic()

setTopic

public void setTopic(java.lang.String topic)
Sets the topic value. If the value is null the "topic" property is removed from the pageBusMessage JSONObject.

Parameters:
topic - The value to set. This may be null.

setSchemaId

public void setSchemaId(java.lang.String schemaId)
Sets the schemaId value. If the value is null the "schemaId" property is removed from the pageBusMessage JSONObject.

Parameters:
schemaId - The value to set. This may be null.

getSchemaId

public java.lang.String getSchemaId()

getMessage

public com.google.gwt.json.client.JSONValue getMessage()

getStringValue

public java.lang.String getStringValue()
Returns:
the String value of message if a JSONString, null otherwise.

getMessageType

public PageBusMessageType getMessageType()


Copyright © 2015 Cloud Software Group, Inc. All Rights Reserved.