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

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

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

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

protected <T> T deserialize(Response response, Class<T> type) {
  try {
    if(type == null) {
      return null;
    }
    String content = response.readEntity(String.class);
    logger.debug("About to deserialize content: \n '{}' \n into type: '{}'", content, type);
    if (content == null || content.isEmpty()) {
      return null;
    }
    return deserialize(content, type);
  } catch ( MarshallingException e ) {
    throw new RuntimeException( "Error while deserializing data received from server!", e );
  }
}
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 <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();
  }
}
origin: org.kie.server/kie-server-controller-client

final String specContent = client.serialize(spec);
LOGGER.info("{} content\n{}", marshallingFormat.getType(), specContent);
final ContainerSpec specResult = client.deserialize(specContent,
                          ContainerSpec.class);
org.kie.server.controller.client.restRestKieServerControllerClientdeserialize

Popular methods of RestKieServerControllerClient

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

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • From CI to AI: The AI layer in your organization
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