use of org.jumpmind.symmetric.transport.http.HttpTransportManager in project symmetric-ds by JumpMind.
the class TransportManagerFactory method create.
public ITransportManager create(String transport) {
if (Constants.PROTOCOL_HTTP.equalsIgnoreCase(transport)) {
String httpSslVerifiedServerNames = symmetricEngine.getParameterService().getString(ServerConstants.HTTPS_VERIFIED_SERVERS);
// Allow self signed certs based on the parameter value.
boolean allowSelfSignedCerts = symmetricEngine.getParameterService().is(ServerConstants.HTTPS_ALLOW_SELF_SIGNED_CERTS, false);
initHttps(httpSslVerifiedServerNames, allowSelfSignedCerts);
return new HttpTransportManager(symmetricEngine);
} else if (Constants.PROTOCOL_FILE.equalsIgnoreCase(transport)) {
return new FileTransportManager(symmetricEngine);
} else if (Constants.PROTOCOL_INTERNAL.equalsIgnoreCase(transport)) {
return new InternalTransportManager(symmetricEngine);
} else {
throw new IllegalStateException("An invalid transport type of " + transport + " was specified.");
}
}
use of org.jumpmind.symmetric.transport.http.HttpTransportManager in project symmetric-ds by JumpMind.
the class SymmetricPushClient method close.
public BatchAck close() {
try {
writer.end(batch, false);
BufferedReader reader = transport.readResponse();
String ackString = reader.readLine();
String ackExtendedString = reader.readLine();
log.debug("Reading ack: {}", ackString);
log.debug("Reading extend ack: {}", ackExtendedString);
List<BatchAck> batchAcks = new HttpTransportManager().readAcknowledgement(ackString, ackExtendedString);
if (batchAcks.size() > 0) {
return batchAcks.get(0);
} else {
return null;
}
} catch (IOException ex) {
throw new IoException(ex);
} finally {
transport.close();
}
}
Aggregations