package org.xins.server;
import java.io.IOException;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.xins.common.MandatoryArgumentChecker;
public class ProtobufCallingConvention extends CallingConvention {
protected static final String RESPONSE_CONTENT_TYPE = "application/x-protobuf";
private final API _api;
public ProtobufCallingConvention(API api)
throws IllegalArgumentException {
MandatoryArgumentChecker.check("api", api);
_api = api;
}
protected String[] getSupportedMethods() {
return new String[]{"POST"};
}
protected boolean matches(HttpServletRequest httpRequest) throws Exception {
return RESPONSE_CONTENT_TYPE.equals(httpRequest.getHeader("Accept"));
}
protected FunctionRequest convertRequestImpl(HttpServletRequest httpRequest)
throws InvalidRequestException, FunctionNotSpecifiedException {
return null;
}
protected void convertResultImpl(FunctionResult xinsResult,
HttpServletResponse httpResponse,
Map<String, Object> backpack)
throws IOException {
}
}