Tabnine Logo
RestKieServerControllerClient.createExceptionForUnexpectedResponseCode
Code IndexAdd Tabnine to your IDE (free)

How to use
createExceptionForUnexpectedResponseCode
method
in
org.kie.server.controller.client.rest.RestKieServerControllerClient

Best Java code snippets using org.kie.server.controller.client.rest.RestKieServerControllerClient.createExceptionForUnexpectedResponseCode (Showing top 4 results out of 315)

origin: org.kie.server/kie-server-controller-client

private <T> T makeGetRequestAndCreateCustomResponse(String uri, Class<T> resultType) {
  WebTarget clientRequest = httpClient.target(uri);
  Response response;
  response = clientRequest.request(getMediaType(format)).get();
  try {
    if (response.getStatus() == Response.Status.OK.getStatusCode()) {
      return deserialize(response,
                resultType);
    } else {
      throw createExceptionForUnexpectedResponseCode(clientRequest,
                              response);
    }
  } finally {
    response.close();
  }
}
origin: org.kie.server/kie-server-controller-client

private void makeDeleteRequest(String uri) {
  WebTarget clientRequest = httpClient.target(uri);
  Response response;
  try {
    response = clientRequest.request(getMediaType(format)).delete();
  } catch (Exception e) {
    throw createExceptionForUnexpectedFailure(clientRequest,
                         e);
  }
  try {
    if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) {
      throw createExceptionForUnexpectedResponseCode(clientRequest,
                              response);
    }
  } finally {
    response.close();
  }
}
origin: org.kie.server/kie-server-controller-client

private <T> T makePostRequestAndCreateCustomResponse(String uri, Object bodyObject, Class<T> resultType) {
  WebTarget clientRequest = httpClient.target(uri);
  Response response;
  try {
    Entity<String> requestEntity = Entity.entity(serialize(bodyObject), getMediaType(format));
    response = clientRequest.request(getMediaType(format)).post(requestEntity);
  } catch (Exception e) {
    throw createExceptionForUnexpectedFailure(clientRequest, e);
  }
  try {
    if (response.getStatus() == Response.Status.CREATED.getStatusCode() ||
        response.getStatus() == Response.Status.OK.getStatusCode()) {
      return deserialize(response,
                resultType);
    } else {
      throw createExceptionForUnexpectedResponseCode(clientRequest,
                              response);
    }
  } finally {
    response.close();
  }
}
origin: org.kie.server/kie-server-controller-client

private <T> T makePutRequestAndCreateCustomResponse(String uri, Object bodyObject, Class<T> resultType) {
  WebTarget clientRequest = httpClient.target(uri);
  Response response;
  try {
    Entity<String> requestEntity = Entity.entity(serialize(bodyObject), getMediaType(format));
    response = clientRequest.request(getMediaType(format)).put(requestEntity);
  } catch (Exception e) {
    throw createExceptionForUnexpectedFailure(clientRequest, e);
  }
  try {
    if (response.getStatus() == Response.Status.CREATED.getStatusCode()) {
      return deserialize(response,
                resultType);
    } else {
      throw createExceptionForUnexpectedResponseCode(clientRequest,
                              response);
    }
  } finally {
    response.close();
  }
}
org.kie.server.controller.client.restRestKieServerControllerClientcreateExceptionForUnexpectedResponseCode

Popular methods of RestKieServerControllerClient

  • <init>
  • deserialize
  • serialize
  • createExceptionForUnexpectedFailure
  • getClientRequestUri
  • getMediaType
  • makeDeleteRequest
  • makeGetRequestAndCreateCustomResponse
  • makePostRequestAndCreateCustomResponse
  • makePutRequestAndCreateCustomResponse
  • setMarshallingFormat
  • throwUnsupportedException
  • setMarshallingFormat,
  • throwUnsupportedException,
  • updateContainerSpec

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now