org.jumpmind.symmetric.transport.http
Class HttpTransportManager

java.lang.Object
  extended by org.jumpmind.symmetric.transport.AbstractTransportManager
      extended by org.jumpmind.symmetric.transport.http.HttpTransportManager
All Implemented Interfaces:
ITransportManager

public class HttpTransportManager
extends AbstractTransportManager
implements ITransportManager

Allow remote communication to nodes, in order to push data, pull data, and send messages.


Field Summary
protected static org.apache.commons.logging.Log logger
           
 
Constructor Summary
HttpTransportManager(INodeService nodeService, IParameterService paramService)
           
 
Method Summary
protected  java.lang.String buildURL(java.lang.String action, Node remote, Node local)
          Build a url for an action.
 IIncomingTransport getPullTransport(Node remote, Node local)
           
 IOutgoingWithResponseTransport getPushTransport(Node remote, Node local)
           
static java.io.BufferedReader getReaderFrom(java.net.HttpURLConnection connection)
          If the content is gzip'd, then uncompress.
 IIncomingTransport getRegisterTransport(Node node)
           
 boolean sendAcknowledgement(Node remote, java.util.List<IncomingBatchHistory> list, Node local)
           
 boolean sendMessage(java.lang.String action, Node remote, Node local, java.lang.String data)
           
protected  java.net.HttpURLConnection sendMessage(java.net.URL url, java.lang.String data)
           
 void writeAcknowledgement(java.io.OutputStream out, java.util.List<IncomingBatchHistory> list)
           
 void writeMessage(java.io.OutputStream out, java.lang.String data)
           
 
Methods inherited from class org.jumpmind.symmetric.transport.AbstractTransportManager
append, getAcknowledgementData, getParametersFromQueryUrl, readAcknowledgement, readAcknowledgement, readAcknowledgement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jumpmind.symmetric.transport.ITransportManager
readAcknowledgement
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger
Constructor Detail

HttpTransportManager

public HttpTransportManager(INodeService nodeService,
                            IParameterService paramService)
Method Detail

sendAcknowledgement

public boolean sendAcknowledgement(Node remote,
                                   java.util.List<IncomingBatchHistory> list,
                                   Node local)
                            throws java.io.IOException
Specified by:
sendAcknowledgement in interface ITransportManager
Throws:
java.io.IOException

writeAcknowledgement

public void writeAcknowledgement(java.io.OutputStream out,
                                 java.util.List<IncomingBatchHistory> list)
                          throws java.io.IOException
Specified by:
writeAcknowledgement in interface ITransportManager
Throws:
java.io.IOException

sendMessage

public boolean sendMessage(java.lang.String action,
                           Node remote,
                           Node local,
                           java.lang.String data)
                    throws java.io.IOException
Throws:
java.io.IOException

sendMessage

protected java.net.HttpURLConnection sendMessage(java.net.URL url,
                                                 java.lang.String data)
                                          throws java.io.IOException
Throws:
java.io.IOException

writeMessage

public void writeMessage(java.io.OutputStream out,
                         java.lang.String data)
                  throws java.io.IOException
Throws:
java.io.IOException

getPullTransport

public IIncomingTransport getPullTransport(Node remote,
                                           Node local)
                                    throws java.io.IOException
Specified by:
getPullTransport in interface ITransportManager
Throws:
java.io.IOException

getPushTransport

public IOutgoingWithResponseTransport getPushTransport(Node remote,
                                                       Node local)
                                                throws java.io.IOException
Specified by:
getPushTransport in interface ITransportManager
Throws:
java.io.IOException

getRegisterTransport

public IIncomingTransport getRegisterTransport(Node node)
                                        throws java.io.IOException
Specified by:
getRegisterTransport in interface ITransportManager
Throws:
java.io.IOException

getReaderFrom

public static java.io.BufferedReader getReaderFrom(java.net.HttpURLConnection connection)
                                            throws java.io.IOException
If the content is gzip'd, then uncompress.

Throws:
java.io.IOException

buildURL

protected java.lang.String buildURL(java.lang.String action,
                                    Node remote,
                                    Node local)
                             throws java.io.IOException
Build a url for an action. Include the nodeid and the security token.

Throws:
java.io.IOException


Copyright © 2007-2008. All Rights Reserved.