ca.sqlpower.wabit.dao.json
Class JSONHttpMessageSender

java.lang.Object
  extended by ca.sqlpower.wabit.dao.HttpMessageSender<JSONObject>
      extended by ca.sqlpower.wabit.dao.json.JSONHttpMessageSender
All Implemented Interfaces:
MessageSender<JSONObject>

public class JSONHttpMessageSender
extends HttpMessageSender<JSONObject>

An HttpMessageSender implementation that specifically sends it's message content in the JSON format. (see www.json.org).


Constructor Summary
JSONHttpMessageSender(org.apache.http.client.HttpClient httpClient, WabitServerInfo serverInfo, java.lang.String wabitWorkspaceUUID)
           
 
Method Summary
 void clear()
          Empties the current queue of messages to be sent.
 void flush()
          Should the implementation support buffering, calling this will clear the buffered messages and send them.
 void send(JSONObject content)
          Adds a message for sending.
 
Methods inherited from class ca.sqlpower.wabit.dao.HttpMessageSender
getHttpClient, getServerInfo, getServerURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONHttpMessageSender

public JSONHttpMessageSender(org.apache.http.client.HttpClient httpClient,
                             WabitServerInfo serverInfo,
                             java.lang.String wabitWorkspaceUUID)
Method Detail

send

public void send(JSONObject content)
          throws WabitPersistenceException
Description copied from interface: MessageSender
Adds a message for sending. It may not necessarily send the message immediately, for example if the implementation supports buffering, in which case you may have to call MessageSender.flush() to actually send the messages.

Throws:
WabitPersistenceException

flush

public void flush()
           throws WabitPersistenceException
Description copied from interface: MessageSender
Should the implementation support buffering, calling this will clear the buffered messages and send them. If the implementation chooses not to support buffering, this can be a simply no-op.

Throws:
WabitPersistenceException

clear

public void clear()
Description copied from interface: MessageSender
Empties the current queue of messages to be sent.



Copyright © 2009. All Rights Reserved.