Package com.dotcms.repackage.com.sun.jersey.api.client

Examples of com.dotcms.repackage.com.sun.jersey.api.client.ClientResponse


                    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();
View Full Code Here


                form.bodyPart(new FileDataBodyPart("DATA_TO_FIX", bundle, MediaType.MULTIPART_FORM_DATA_TYPE));

                String url = endpoint.toURL()+"/api/integrity/fixconflictsfromremote/";
                com.dotcms.repackage.com.sun.jersey.api.client.WebResource resource = client.resource(url);

                ClientResponse response = resource.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class, form);

                if(response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_OK) {
                    jsonResponse.put( "success", true );
                    jsonResponse.put( "message", "Fix Conflicts Process successfully started at Remote." );

                    integrityUtil.discardConflicts(endpointId, IntegrityType.valueOf(type.toUpperCase()));
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.com.sun.jersey.api.client.ClientResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.