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

  • Start an intent from android
  • setScale (BigDecimal)
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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