Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.server.io
Class MessageFactory

java.lang.Object
  extended by org.jboss.errai.bus.server.io.MessageFactory

public class MessageFactory
extends Object

The MessageFactory facilitates the building of a command message using a JSON string


Constructor Summary
MessageFactory()
           
 
Method Summary
static List<Message> createCommandMessage(QueueSession session, EJValue value)
           
static List<Message> createCommandMessage(QueueSession session, javax.servlet.http.HttpServletRequest request)
           
static Message createCommandMessage(QueueSession session, javax.servlet.http.HttpServletRequest request, String json)
          Creates the command message from the given JSON string and session.
static List<Message> createCommandMessage(QueueSession session, InputStream inputStream)
           
static Message createCommandMessage(QueueSession session, String json)
           
static Map<String,Object> decodeToMap(String in)
          Decodes a JSON string to a map (string name -> object)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFactory

public MessageFactory()
Method Detail

decodeToMap

public static Map<String,Object> decodeToMap(String in)
Decodes a JSON string to a map (string name -> object)

Parameters:
in - - JSON string
Returns:
map representing the string

createCommandMessage

public static Message createCommandMessage(QueueSession session,
                                           javax.servlet.http.HttpServletRequest request,
                                           String json)
Creates the command message from the given JSON string and session. The message is constructed in parts depending on the string

Parameters:
session - - the queue session in which the message exists
request - -
json - - the string representing the parts of the message
Returns:
the message array constructed using the JSON string

createCommandMessage

public static Message createCommandMessage(QueueSession session,
                                           String json)

createCommandMessage

public static List<Message> createCommandMessage(QueueSession session,
                                                 javax.servlet.http.HttpServletRequest request)
                                          throws IOException
Throws:
IOException

createCommandMessage

public static List<Message> createCommandMessage(QueueSession session,
                                                 InputStream inputStream)
                                          throws IOException
Throws:
IOException

createCommandMessage

public static List<Message> createCommandMessage(QueueSession session,
                                                 EJValue value)

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.