Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      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 message: A JSONValue that contains data to be passed. (See also PageBusMessageNative and PageBusMessageObject).
- A schemaId: This is used to identify the schema of the data contained in the message. This can be any String but the recommended form is a set of tokens separated by dots like this: com.company.application.anyQualifiers.schemaType
  For example, the default value is: com.tibco.bpm.web.client.model.pagebus.message.PageBusMessage
- A topic: This is used to identify the source of a message. This can be any String but the recommended form is a set of tokens separated by dots like this: com.company.application.anyQualifiers.messageType
  For example: a message resulting from selecting an item from a list might look like this:
  com.tibco.openspace.sample.list.itemselected

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 TIBCO Software 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:
  - message set to: null
  - schemaId set to: DEFAULT_SCHEMA_ID: "com.tibco.bpm.web.client.model.pagebus.message.PageBusMessage"
  - topic set to: null

### PageBusMessage

    public 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

  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:
  - topic set to: null

  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:
  - topic set to: null

  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()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2015 TIBCO Software Inc. All Rights Reserved.