com.aelitis.azureus.core.messenger.browser
Class BrowserMessage

java.lang.Object
  extended by com.aelitis.azureus.core.messenger.browser.BrowserMessage

public class BrowserMessage
extends Object

Holds a message being dispatched to a BrowserMessageListener.

Author:
dharkness

Field Summary
static int ARRAY_PARAM
          Parameters were an encoded JSONArray.
static String MESSAGE_DELIM
          Separates prefix and listener ID from rest of message.
static String MESSAGE_DELIM_ENCODED
           
static String MESSAGE_PREFIX
          All messages must start with this prefix.
static int NO_PARAM
          There were no parameters passed with the message.
static int OBJECT_PARAM
          Parameters were an encoded JSONObject.
 
Constructor Summary
BrowserMessage(String listenerId, String operationId, Map<?,?> params)
           
 
Method Summary
 void addCompletionListener(MessageCompletionListener l)
           
 void complete(boolean bOnlyNonDelayed, boolean success, Object data)
          Sets the message complete and fires of the listeners who are waiting for a response.
 void debug(String message)
           
 void debug(String message, Throwable t)
           
 Map getDecodedMap()
           
 String getListenerId()
           
 String getOperationId()
           
 String getReferer()
           
 void removeCompletionListener(MessageCompletionListener l)
           
 void setCompleteDelayed(boolean bCompleteDelayed)
           
 void setReferer(String referer)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MESSAGE_PREFIX

public static final String MESSAGE_PREFIX
All messages must start with this prefix.

See Also:
Constant Field Values

MESSAGE_DELIM

public static final String MESSAGE_DELIM
Separates prefix and listener ID from rest of message.

See Also:
Constant Field Values

MESSAGE_DELIM_ENCODED

public static String MESSAGE_DELIM_ENCODED

NO_PARAM

public static final int NO_PARAM
There were no parameters passed with the message.

See Also:
Constant Field Values

OBJECT_PARAM

public static final int OBJECT_PARAM
Parameters were an encoded JSONObject.

See Also:
Constant Field Values

ARRAY_PARAM

public static final int ARRAY_PARAM
Parameters were an encoded JSONArray.

See Also:
Constant Field Values
Constructor Detail

BrowserMessage

public BrowserMessage(String listenerId,
                      String operationId,
                      Map<?,?> params)
Method Detail

addCompletionListener

public void addCompletionListener(MessageCompletionListener l)

complete

public void complete(boolean bOnlyNonDelayed,
                     boolean success,
                     Object data)
Sets the message complete and fires of the listeners who are waiting for a response.

Parameters:
bOnlyNonDelayed - Only mark complete if this message does not have a delayed reponse
success - Success level of the message
data - Any data the message results wants to send

debug

public void debug(String message)

debug

public void debug(String message,
                  Throwable t)

getDecodedMap

public Map getDecodedMap()

getListenerId

public String getListenerId()

getOperationId

public String getOperationId()

getReferer

public String getReferer()

removeCompletionListener

public void removeCompletionListener(MessageCompletionListener l)

setCompleteDelayed

public void setCompleteDelayed(boolean bCompleteDelayed)

setReferer

public void setReferer(String referer)

toString

public String toString()
Overrides:
toString in class Object