Tabnine Logo
BaseClientResponse.getMetadata
Code IndexAdd Tabnine to your IDE (free)

How to use
getMetadata
method
in
org.jboss.resteasy.client.core.BaseClientResponse

Best Java code snippets using org.jboss.resteasy.client.core.BaseClientResponse.getMetadata (Showing top 4 results out of 315)

origin: org.jboss.resteasy/resteasy-legacy

  public Object extractEntity(ClientRequestContext context, Object... args)
  {
   EntityTypeFactory factory = null;
   try
   {
     factory = entityTypeFactory.newInstance();
   }
   catch (InstantiationException e)
   {
     throw context.getClientResponse().createResponseFailure(Messages.MESSAGES.couldNotCreateEntityFactory(entityTypeFactory.getClass().getName()));
   }
   catch (IllegalAccessException e)
   {
     throw ((BaseClientResponse<?>)context.getClientResponse())
        .createResponseFailure(Messages.MESSAGES.couldNotCreateEntityFactoryMessage(entityTypeFactory.getClass().getName(), e.getMessage()));
   }
   context.getClientResponse().setReturnType(
       factory.getEntityType(((BaseClientResponse<?>) context.getClientResponse()).getStatus(),
           ((BaseClientResponse<?>) context.getClientResponse()).getMetadata()));
   return context.getClientResponse();
  }
};
origin: org.jboss.resteasy/resteasy-jaxrs-20

  public Object extractEntity(ClientRequestContext context, Object... args)
  {
   EntityTypeFactory factory = null;
   try
   {
     factory = entityTypeFactory.newInstance();
   }
   catch (InstantiationException e)
   {
     throw context.getClientResponse().createResponseFailure(Messages.MESSAGES.couldNotCreateEntityFactory(entityTypeFactory.getClass().getName()));
   }
   catch (IllegalAccessException e)
   {
     throw ((BaseClientResponse<?>)context.getClientResponse())
        .createResponseFailure(Messages.MESSAGES.couldNotCreateEntityFactoryMessage(entityTypeFactory.getClass().getName(), e.getMessage()));
   }
   context.getClientResponse().setReturnType(
       factory.getEntityType(((BaseClientResponse<?>) context.getClientResponse()).getStatus(),
           ((BaseClientResponse<?>) context.getClientResponse()).getMetadata()));
   return context.getClientResponse();
  }
};
origin: org.apache.brooklyn/brooklyn-rest-client

@SuppressWarnings("deprecation")
public static <T> Response copyResponseAndClose(Response source, Class<T> type) {
  int status = -1;
  Headers<Object> headers = new Headers<Object>();
  Object entity = null;
  try {
    status = source.getStatus();
    if (source instanceof org.jboss.resteasy.client.core.BaseClientResponse)
      headers.putAll(((org.jboss.resteasy.client.core.BaseClientResponse<?>)source).getMetadata());
    if (source instanceof org.jboss.resteasy.client.ClientResponse) {
      entity = ((org.jboss.resteasy.client.ClientResponse<?>)source).getEntity(type);
    } else {
      entity = source.getEntity();
    }
    return new BuiltResponsePreservingError(status, headers, entity, new Annotation[0], null);
  } catch (Exception e) {
    Exceptions.propagateIfFatal(e);
    return new BuiltResponsePreservingError(status, headers, entity, new Annotation[0], e);
  } finally {
    if (source instanceof org.jboss.resteasy.client.core.BaseClientResponse)
      ((org.jboss.resteasy.client.core.BaseClientResponse<?>)source).close();
  }
}

origin: org.apache.isis.viewer/json-applib

@Ignore("TODO")
@Test
public void follow_get() throws Exception {
  final LinkRepresentation link = jsonRepresentation.getLink("aLink");
  final String href = link.getHref();
  // when
  context.checking(new Expectations() {
    {
      one(mockExecutor).createRequest(with(any(UriBuilderImpl.class)));
      will(returnValue(mockClientRequest));
      one(mockExecutor).execute(mockClientRequest);
      will(returnValue(mockClientResponse));
      one(mockClientRequest).accept(MediaType.APPLICATION_JSON_TYPE);
      atLeast(1).of(mockClientRequest).setHttpMethod("GET");
      allowing(mockClientRequest).getHttpMethod();
      will(returnValue("GET"));
      one(mockClientRequest).execute();
      will(returnValue(mockClientResponse));
      one(mockClientResponse).setReturnType(String.class);
      allowing(mockClientResponse);
      final MultiValueMap result = new MultiValueMap();
      result.put("Content-Type", "application/json");
      allowing(mockClientResponse).getMetadata();
      will(returnValue(result));
    }
  });
  final RestfulResponse<JsonRepresentation> response = client.follow(link);
  // then
}
org.jboss.resteasy.client.coreBaseClientResponsegetMetadata

Popular methods of BaseClientResponse

  • getStreamFactory
  • setReturnType
  • getEntity
  • getStatus
  • <init>
  • setAnnotations
  • setAttributeExceptionsTo
  • setHeaders
  • setProviderFactory
  • setStatus
  • checkFailureStatus
  • copyFromError
    Store entity within a byte array input stream because we want to release the connection if a ClientR
  • checkFailureStatus,
  • copyFromError,
  • createResponseFailure,
  • getAnnotations,
  • getLinkHeader,
  • getLocationLink,
  • getMediaType,
  • getResponseHeader,
  • getResponseHeaders

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Top PhpStorm plugins
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