Client client = getRESTClient();
String url = endpoint.toURL() + "/api/integrity/cancelIntegrityProcessOnEndpoint/";
com.dotcms.repackage.com.sun.jersey.api.client.WebResource resource = client.resource( url );
//Execute the call
ClientResponse response = resource.type( MediaType.MULTIPART_FORM_DATA ).post( ClientResponse.class, form );
if ( response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_OK ) {
//Nothing to do here, we found no process to cancel
} else if ( response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_RESET_CONTENT ) {
//Expected return status if a cancel was made on the end point server
} else {
Logger.error( this.getClass(), "Response indicating a " + response.getClientResponseStatus().getReasonPhrase() + " (" + response.getClientResponseStatus().getStatusCode() + ") Error trying to interrupt the running process on the Endpoint [ " + endpointId + "]." );
}
//Interrupt the Thread process
runningThread.interrupt();