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 Stringprotected Stringprotected StringaddNodeInfo(String base, String nodeId, String securityToken, boolean forceParamSecurityToken) static StringbuildRegistrationUrl(String baseUrl, Node node) protected StringBuild a url for an action.protected voidvoidclearSession(HttpConnection conn) protected HttpConnectionprotected HttpConnectioncreateGetConnectionFor(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) intintgetConfigTransport(Node remote, Node local, String securityToken, String symmetricVersion, String configVersion, String registrationUrl) protected ISymmetricEnginegetFilePullTransport(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) getFilePushTransport(Node remote, Node local, String securityToken, String registrationUrl) intintprotected static InputStreamgetInputStreamFrom(HttpConnection connection) intgetPingTransport(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 BufferedReadergetReaderFrom(HttpConnection connection) If the content is gzip'd, then uncompress.getRegisterPushTransport(Node remote, Node local) getRegisterTransport(Node node, String registrationUrl) protected StringgetUri(HttpConnection conn) booleanbooleanisUseCompression(Node targetNode) openConnection(URL url, String nodeId, String securityToken) intsendAcknowledgement(Node remote, List<IncomingBatch> list, Node local, String securityToken, String registrationUrl) intsendAcknowledgement(Node remote, List<IncomingBatch> list, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) intsendCopyRequest(Node local) protected intsendMessage(String action, Node remote, Node local, String data, String securityToken, Map<String, String> requestProperties, String registrationUrl) protected intsendMessage(URL url, String nodeId, String securityToken, Map<String, String> requestProperties, String data) intsendStatusRequest(Node local, Map<String, String> statuses) voidupdateSession(HttpConnection conn) voidwriteAcknowledgement(OutputStream out, Node remote, List<IncomingBatch> list, Node local, String securityToken) voidwriteMessage(OutputStream out, String data) Methods inherited from class org.jumpmind.symmetric.transport.AbstractTransportManager
append, getAcknowledgementData, getParametersFromQueryUrl, readAcknowledgement, readAcknowledgement, readAcknowledgement, readRequestProperties, resolveURL, writeRequestPropertiesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
sendCopyRequestin interfaceITransportManager- Throws:
IOException
-
sendStatusRequest
- Specified by:
sendStatusRequestin interfaceITransportManager- Throws:
IOException
-
sendAcknowledgement
public int sendAcknowledgement(Node remote, List<IncomingBatch> list, Node local, String securityToken, String registrationUrl) throws IOException - Specified by:
sendAcknowledgementin 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:
sendAcknowledgementin interfaceITransportManager- Throws:
IOException
-
writeAcknowledgement
public void writeAcknowledgement(OutputStream out, Node remote, List<IncomingBatch> list, Node local, String securityToken) throws IOException - Specified by:
writeAcknowledgementin 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:
getFilePullTransportin interfaceITransportManager- Throws:
IOException
-
getPullTransport
public IIncomingTransport getPullTransport(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Specified by:
getPullTransportin interfaceITransportManager- Throws:
IOException
-
getPingTransport
public IIncomingTransport getPingTransport(Node remote, Node local, String registrationUrl) throws IOException - Specified by:
getPingTransportin interfaceITransportManager- Throws:
IOException
-
getPushTransport
public IOutgoingWithResponseTransport getPushTransport(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Specified by:
getPushTransportin interfaceITransportManager- Throws:
IOException
-
getPushTransport
public IOutgoingWithResponseTransport getPushTransport(Node remote, Node local, String securityToken, String registrationUrl) throws IOException - Specified by:
getPushTransportin interfaceITransportManager- Throws:
IOException
-
getFilePushTransport
public IOutgoingWithResponseTransport getFilePushTransport(Node remote, Node local, String securityToken, String registrationUrl) throws IOException - Specified by:
getFilePushTransportin interfaceITransportManager- Throws:
IOException
-
getConfigTransport
public IIncomingTransport getConfigTransport(Node remote, Node local, String securityToken, String symmetricVersion, String configVersion, String registrationUrl) throws IOException - Specified by:
getConfigTransportin interfaceITransportManager- Throws:
IOException
-
getRegisterTransport
public IIncomingTransport getRegisterTransport(Node node, String registrationUrl) throws IOException - Specified by:
getRegisterTransportin interfaceITransportManager- Throws:
IOException
-
getRegisterTransport
public IIncomingTransport getRegisterTransport(Node node, String registrationUrl, Map<String, String> requestProperties) throws IOException- Specified by:
getRegisterTransportin interfaceITransportManager- Throws:
IOException
-
getRegisterPushTransport
public IOutgoingWithResponseTransport getRegisterPushTransport(Node remote, Node local) throws IOException - Specified by:
getRegisterPushTransportin interfaceITransportManager- Throws:
IOException
-
getBandwidthPushTransport
public IOutgoingWithResponseTransport getBandwidthPushTransport(Node remote, Node local, String securityToken, Map<String, String> requestProperties, String registrationUrl) throws IOException- Specified by:
getBandwidthPushTransportin interfaceITransportManager- Throws:
IOException
-
getComparePullTransport
public IIncomingTransport getComparePullTransport(Node remote, Node local, String securityToken, String registrationUrl, Map<String, String> requestParameters) throws IOException- Specified by:
getComparePullTransportin interfaceITransportManager- Throws:
IOException
-
getComparePushTransport
public IOutgoingWithResponseTransport getComparePushTransport(Node remote, Node local, String securityToken, String registrationUrl, Map<String, String> requestParameters) throws IOException- Specified by:
getComparePushTransportin 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
-