Class HttpTransportManager
java.lang.Object
org.jumpmind.symmetric.transport.AbstractTransportManager
org.jumpmind.symmetric.transport.http.HttpTransportManager
- All Implemented Interfaces:
ITransportManager
- Direct Known Subclasses:
FileTransportManager
Allow remote communication to nodes, in order to push data, pull data, and send messages.
-
Field Summary
FieldsFields inherited from class org.jumpmind.symmetric.transport.AbstractTransportManager
extensionService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected String
protected String
addNodeInfo
(String base, String nodeId, String securityToken, boolean forceParamSecurityToken) static String
buildRegistrationUrl
(String baseUrl, Node node) protected String
Build a url for an action.protected void
void
clearSession
(HttpConnection conn) protected HttpConnection
protected HttpConnection
createGetConnectionFor
(URL url, String nodeId, String securityToken) getBandwidthPushTransport
(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) getComparePullTransport
(Node remote, Node local, String securityToken, String registrationUrl, Map<String, String> requestParameters) getComparePushTransport
(Node remote, Node local, String securityToken, String registrationUrl, Map<String, String> requestParameters) int
int
getConfigTransport
(Node remote, Node local, String securityToken, String symmetricVersion, String configVersion, String registrationUrl) protected ISymmetricEngine
getFilePullTransport
(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) getFilePushTransport
(Node remote, Node local, String securityToken, String registrationUrl) int
int
protected static InputStream
getInputStreamFrom
(HttpConnection connection) int
getPingTransport
(Node remote, Node local, String registrationUrl) getPullTransport
(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) getPushTransport
(Node remote, Node local, String securityToken, String registrationUrl) getPushTransport
(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) protected static BufferedReader
getReaderFrom
(HttpConnection connection) If the content is gzip'd, then uncompress.getRegisterPushTransport
(Node remote, Node local) getRegisterTransport
(Node node, String registrationUrl) protected String
getUri
(HttpConnection conn) boolean
boolean
isUseCompression
(Node targetNode) openConnection
(URL url, String nodeId, String securityToken) int
sendAcknowledgement
(Node remote, List<IncomingBatch> list, Node local, String securityToken, String registrationUrl) int
sendAcknowledgement
(Node remote, List<IncomingBatch> list, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) int
sendCopyRequest
(Node local) protected int
sendMessage
(String action, Node remote, Node local, String data, String securityToken, Map<String, String> requestProperties, String registrationUrl) protected int
sendMessage
(URL url, String nodeId, String securityToken, Map<String, String> requestProperties, String data) int
sendStatusRequest
(Node local, Map<String, String> statuses) void
updateSession
(HttpConnection conn) void
writeAcknowledgement
(OutputStream out, Node remote, List<IncomingBatch> list, Node local, String securityToken) void
writeMessage
(OutputStream out, String data) Methods inherited from class org.jumpmind.symmetric.transport.AbstractTransportManager
append, getAcknowledgementData, getParametersFromQueryUrl, readAcknowledgement, readAcknowledgement, readAcknowledgement, readRequestProperties, resolveURL, writeRequestProperties
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, readRequestProperties, resolveURL, writeRequestProperties
-
Field Details
-
engine
-
sessionIdByUri
-
useHeaderSecurityToken
protected boolean useHeaderSecurityToken -
useSessionAuth
protected boolean useSessionAuth
-
-
Constructor Details
-
HttpTransportManager
public HttpTransportManager() -
HttpTransportManager
-
-
Method Details
-
sendCopyRequest
- Specified by:
sendCopyRequest
in interfaceITransportManager
- Throws:
IOException
-
sendStatusRequest
- Specified by:
sendStatusRequest
in interfaceITransportManager
- Throws:
IOException
-
sendAcknowledgement
public int sendAcknowledgement(Node remote, List<IncomingBatch> list, Node local, String securityToken, String registrationUrl) throws IOException - Specified by:
sendAcknowledgement
in interfaceITransportManager
- Throws:
IOException
-
sendAcknowledgement
public int sendAcknowledgement(Node remote, List<IncomingBatch> list, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Specified by:
sendAcknowledgement
in interfaceITransportManager
- Throws:
IOException
-
writeAcknowledgement
public void writeAcknowledgement(OutputStream out, Node remote, List<IncomingBatch> list, Node local, String securityToken) throws IOException - Specified by:
writeAcknowledgement
in interfaceITransportManager
- Throws:
IOException
-
sendMessage
protected int sendMessage(String action, Node remote, Node local, String data, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Throws:
IOException
-
sendMessage
protected int sendMessage(URL url, String nodeId, String securityToken, Map<String, String> requestProperties, String data) throws IOException- Throws:
IOException
-
checkForConnectionUpgrade
-
openConnection
public HttpConnection openConnection(URL url, String nodeId, String securityToken) throws IOException - Throws:
IOException
-
updateSession
-
clearSession
-
getUri
-
getOutputStreamSize
public int getOutputStreamSize() -
isOutputStreamEnabled
public boolean isOutputStreamEnabled() -
getHttpTimeOutInMs
public int getHttpTimeOutInMs() -
getHttpConnectTimeOutInMs
public int getHttpConnectTimeOutInMs() -
isUseCompression
-
getCompressionLevel
public int getCompressionLevel() -
getCompressionStrategy
public int getCompressionStrategy() -
writeMessage
- Throws:
IOException
-
getFilePullTransport
public IIncomingTransport getFilePullTransport(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Specified by:
getFilePullTransport
in interfaceITransportManager
- Throws:
IOException
-
getPullTransport
public IIncomingTransport getPullTransport(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Specified by:
getPullTransport
in interfaceITransportManager
- Throws:
IOException
-
getPingTransport
public IIncomingTransport getPingTransport(Node remote, Node local, String registrationUrl) throws IOException - Specified by:
getPingTransport
in interfaceITransportManager
- Throws:
IOException
-
getPushTransport
public IOutgoingWithResponseTransport getPushTransport(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Specified by:
getPushTransport
in interfaceITransportManager
- Throws:
IOException
-
getPushTransport
public IOutgoingWithResponseTransport getPushTransport(Node remote, Node local, String securityToken, String registrationUrl) throws IOException - Specified by:
getPushTransport
in interfaceITransportManager
- Throws:
IOException
-
getFilePushTransport
public IOutgoingWithResponseTransport getFilePushTransport(Node remote, Node local, String securityToken, String registrationUrl) throws IOException - Specified by:
getFilePushTransport
in interfaceITransportManager
- Throws:
IOException
-
getConfigTransport
public IIncomingTransport getConfigTransport(Node remote, Node local, String securityToken, String symmetricVersion, String configVersion, String registrationUrl) throws IOException - Specified by:
getConfigTransport
in interfaceITransportManager
- Throws:
IOException
-
getRegisterTransport
public IIncomingTransport getRegisterTransport(Node node, String registrationUrl) throws IOException - Specified by:
getRegisterTransport
in interfaceITransportManager
- Throws:
IOException
-
getRegisterTransport
public IIncomingTransport getRegisterTransport(Node node, String registrationUrl, Map<String, String> requestProperties) throws IOException- Specified by:
getRegisterTransport
in interfaceITransportManager
- Throws:
IOException
-
getRegisterPushTransport
public IOutgoingWithResponseTransport getRegisterPushTransport(Node remote, Node local) throws IOException - Specified by:
getRegisterPushTransport
in interfaceITransportManager
- Throws:
IOException
-
getBandwidthPushTransport
public IOutgoingWithResponseTransport getBandwidthPushTransport(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Specified by:
getBandwidthPushTransport
in interfaceITransportManager
- Throws:
IOException
-
getComparePullTransport
public IIncomingTransport getComparePullTransport(Node remote, Node local, String securityToken, String registrationUrl, Map<String, String> requestParameters) throws IOException- Specified by:
getComparePullTransport
in interfaceITransportManager
- Throws:
IOException
-
getComparePushTransport
public IOutgoingWithResponseTransport getComparePushTransport(Node remote, Node local, String securityToken, String registrationUrl, Map<String, String> requestParameters) throws IOException- Specified by:
getComparePushTransport
in interfaceITransportManager
- Throws:
IOException
-
buildRegistrationUrl
-
createGetConnectionFor
protected HttpConnection createGetConnectionFor(URL url, String nodeId, String securityToken) throws IOException - Throws:
IOException
-
createGetConnectionFor
- Throws:
IOException
-
getInputStreamFrom
- Throws:
IOException
-
getReaderFrom
If the content is gzip'd, then uncompress.- Throws:
IOException
-
buildURL
protected String buildURL(String action, Node remote, Node local, String securityToken, String registrationUrl) throws IOException Build a url for an action.- Throws:
IOException
-
addNodeInfo
-
addNodeId
-
add
-
getEngine
-