@Test(expected = ODataBadRequestException.class) public void testDoFunctionUsingEntitySet() throws ODataException, UnsupportedEncodingException { ODataRequestContext requestContext = TestUtils.createODataRequestContext(GET, new ODataParserImpl().parseUri( "http: functionProcessor.doFunction(requestContext); }
@Override public ProcessorResult doFunction(ODataRequestContext requestContext) throws ODataException { LOG.debug("Building and executing a function or function import"); Operation operation = getFunctionOrFunctionImportOperation(requestContext); Object result; try { String te = requestContext.getRequest().getHeader(TE); String xte = requestContext.getRequest().getHeader(X_ODATA_TE); boolean isChunkedRequest = TRANSFER_ENCODING_CHUNKED.equals(te) || TRANSFER_ENCODING_CHUNKED.equals(xte); if (isChunkedRequest) { result = operation.doStreamOperation(requestContext, dataSourceFactory); } else { result = operation.doOperation(requestContext, dataSourceFactory); } } catch (Exception e) { LOG.error("Unexpected exception when executing a function " + operation.getClass().getCanonicalName(), e); throw e; } return result == null ? new ProcessorResult(ODataResponse.Status.NO_CONTENT) : new ProcessorResult(ODataResponse.Status.OK, QueryResult.from(result)); }
ODataFunctionProcessorImpl implements ODataFunctionProcessor { @Override public ProcessorResult doFunction(ODataRequestContext requestContext) throws ODataException { LOG.debug("Building and executing a function or function import"); Operation operation = getFunctionOrFunctionImportOperation(requestContext); Object result; try { String te = requestContext.getRequest().getHeader(TE); String xte = requestContext.getRequest().getHeader(X_ODATA_TE); boolean isChunkedRequest = TRANSFER_ENCODING_CHUNKED.equals(te) || TRANSFER_ENCODING_CHUNKED.equals(xte); if (isChunkedRequest) { result = operation.doStreamOperation(requestContext, dataSourceFactory); } else { result = operation.doOperation(requestContext, dataSourceFactory); } } catch (Exception e) { LOG.error("Unexpected exception when executing a function " + operation.getClass().getCanonicalName(), e); throw e; } return result == null ? new ProcessorResult(ODataResponse.Status.NO_CONTENT) : new ProcessorResult(ODataResponse.Status.OK, QueryResult.from(result)); } }
ODataFunctionProcessorImpl implements ODataFunctionProcessor { @Override public ProcessorResult doFunction(ODataRequestContext requestContext) throws ODataException { LOG.debug("Building and executing a function or function import"); Operation operation = getFunctionOrFunctionImportOperation(requestContext); Object result; try { String te = requestContext.getRequest().getHeader(TE); String xte = requestContext.getRequest().getHeader(X_ODATA_TE); boolean isChunkedRequest = TRANSFER_ENCODING_CHUNKED.equals(te) || TRANSFER_ENCODING_CHUNKED.equals(xte); if (isChunkedRequest) { result = operation.doStreamOperation(requestContext, dataSourceFactory); } else { result = operation.doOperation(requestContext, dataSourceFactory); } } catch (Exception e) { LOG.error("Unexpected exception when executing a function " + operation.getClass().getCanonicalName(), e); throw e; } return result == null ? new ProcessorResult(ODataResponse.Status.NO_CONTENT) : new ProcessorResult(ODataResponse.Status.OK, QueryResult.from(result)); }  }
ODataFunctionProcessorImpl implements ODataFunctionProcessor { @Override public ProcessorResult doFunction(ODataRequestContext requestContext) throws ODataException { LOG.debug("Building and executing a function or function import"); Operation operation = getFunctionOrFunctionImportOperation(requestContext); Object result; try { String te = requestContext.getRequest().getHeader(TE); String xte = requestContext.getRequest().getHeader(X_ODATA_TE); boolean isChunkedRequest = TRANSFER_ENCODING_CHUNKED.equals(te) || TRANSFER_ENCODING_CHUNKED.equals(xte); if (isChunkedRequest) { result = operation.doStreamOperation(requestContext, dataSourceFactory); } else { result = operation.doOperation(requestContext, dataSourceFactory); } } catch (Exception e) { LOG.error("Unexpected exception when executing a function " + operation.getClass().getCanonicalName(), e); throw e; } return result == null ? new ProcessorResult(ODataResponse.Status.NO_CONTENT) : new ProcessorResult(ODataResponse.Status.OK, QueryResult.from(result)); }  @Override ProcessorResult doFunction(ODataRequestContext requestContext); }
ODataFunctionProcessorImpl implements ODataFunctionProcessor { @Override public ProcessorResult doFunction(ODataRequestContext requestContext) throws ODataException { LOG.debug("Building and executing a function or function import"); Operation operation = getFunctionOrFunctionImportOperation(requestContext); Object result; try { String te = requestContext.getRequest().getHeader(TE); String xte = requestContext.getRequest().getHeader(X_ODATA_TE); boolean isChunkedRequest = TRANSFER_ENCODING_CHUNKED.equals(te) || TRANSFER_ENCODING_CHUNKED.equals(xte); if (isChunkedRequest) { result = operation.doStreamOperation(requestContext, dataSourceFactory); } else { result = operation.doOperation(requestContext, dataSourceFactory); } } catch (Exception e) { LOG.error("Unexpected exception when executing a function " + operation.getClass().getCanonicalName(), e); throw e; } return result == null ? new ProcessorResult(ODataResponse.Status.NO_CONTENT) : new ProcessorResult(ODataResponse.Status.OK, QueryResult.from(result)); }  @Override ProcessorResult doFunction(ODataRequestContext requestContext);  }