All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.outbrain.ob1k.common.marshalling.RequestMarshaller Maven / Gradle / Ivy

The newest version!
package com.outbrain.ob1k.common.marshalling;

import com.outbrain.ob1k.Request;
import com.outbrain.ob1k.http.Response;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpContent;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.http.HttpResponseStatus;

import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;

/**
 * Created with IntelliJ IDEA.
 * User: aronen
 * Date: 8/18/13
 * Time: 3:18 PM
 */
public interface RequestMarshaller {
  void registerTypes(Type... types);
  Object[] unmarshallRequestParams(Request request, Method method, String[] paramNames) throws IOException;
  FullHttpResponse marshallResponse(Object res, HttpResponseStatus status) throws IOException;
  HttpResponse marshallResponseHeaders(final boolean rawStream);
  HttpContent marshallResponsePart(Object res, HttpResponseStatus status, boolean rawStream) throws IOException;
  byte[] marshallRequestParams(Object[] requestParams) throws IOException;
   T unmarshallResponse(Response response, Type type) throws IOException;
   T unmarshallStreamResponse(Response response, Type type) throws IOException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy