Package org.jboss.resteasy.client

Examples of org.jboss.resteasy.client.ClientResponseFailure


            ClientRequest clientRequest = newRequest(baseURI + "/containers/" + id + "/scanner");
            response = clientRequest.get(new GenericType<ServiceResponse<KieScannerResource>>(){});
            if( response.getStatus() == Response.Status.OK.getStatusCode() ) {
                return response.getEntity();
            }
            throw new ClientResponseFailure("Unexpected response code: "+response.getStatus(), response );
        } catch (ClientResponseFailure e) {
            throw e;
        } catch (Exception e) {
            throw new ClientResponseFailure("Unexpected exception retrieving scanner info for container '"+id+"'.", e, response );
        }
    }
View Full Code Here


            ClientRequest clientRequest = newRequest(baseURI + "/containers/" + id + "/scanner");
            response = clientRequest.body(mediaType, resource).post(new GenericType<ServiceResponse<KieScannerResource>>(){});
            if( response.getStatus() == Response.Status.OK.getStatusCode() ) {
                return response.getEntity();
            }
            throw new ClientResponseFailure("Unexpected response code: "+response.getStatus(), response );
        } catch (ClientResponseFailure e) {
            throw e;
        } catch (Exception e) {
            throw new ClientResponseFailure("Unexpected exception scanner for container '"+id+"'.", e, response );
        }
    }
View Full Code Here

            ClientRequest clientRequest = newRequest(baseURI + "/containers/" + id + "/release-id");
            response = clientRequest.body(mediaType, releaseId).post(new GenericType<ServiceResponse<ReleaseId>>(){});
            if( response.getStatus() == Response.Status.OK.getStatusCode() ) {
                return response.getEntity();
            }
            throw new ClientResponseFailure("Unexpected response code: "+response.getStatus(), response );
        } catch (ClientResponseFailure e) {
            throw e;
        } catch (Exception e) {
            throw new ClientResponseFailure("Unexpected exception updating releaseId for container '"+id+"'.", e, response );
        }
    }
View Full Code Here

                    new GenericType<ServiceResponse<KieContainerResource>>() {
                    });
            Assert.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus());
            Assert.assertEquals(ServiceResponse.ResponseType.FAILURE, response.getEntity().getType());
        } catch (Exception e) {
            throw new ClientResponseFailure(
                    "Unexpected exception creating container: " + resource.getContainerId() + " with release-id " + resource.getReleaseId(),
                    e, response);
        }
    }
View Full Code Here

                    MediaType.APPLICATION_XML_TYPE, "").put(
                    new GenericType<ServiceResponse<KieContainerResource>>() {
                    });
            Assert.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus());
        } catch (Exception e) {
            throw new ClientResponseFailure("Unexpected exception on empty body", e, response);
        }
    }
View Full Code Here

      try
      {
         InputStream is = streamFactory.getInputStream();
         if (is == null)
         {
            throw new ClientResponseFailure("Input stream was empty, there is no entity", this);
         }
         if (isMarshalledEntity)
         {
            is = new InputStreamToByteArray(is);
View Full Code Here

   {
      setException(e);
      this.returnType = byte[].class;
      this.genericReturnType = null;
      this.annotations = null;
      return new ClientResponseFailure(message, e, (ClientResponse<byte[]>) this);
   }
View Full Code Here

   {
      setException(e);
      this.returnType = byte[].class;
      this.genericReturnType = null;
      this.annotations = null;
      return new ClientResponseFailure(message, e, (ClientResponse<byte[]>) this);
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.client.ClientResponseFailure

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.