Package org.apache.olingo.odata2.core

Examples of org.apache.olingo.odata2.core.ODataRequestHandler.handle()


    if (context.isInDebugMode()) {
      final String debugValue = getQueryDebugValue(request.getQueryParameters());
      if (debugValue == null) {
        ODataDebugResponseWrapperCallback callback =
            context.getServiceFactory().getCallback(ODataDebugResponseWrapperCallback.class);
        return callback == null ? odataResponse : callback.handle(context, request, odataResponse, uriInfo, exception);
      } else {
        return new ODataDebugResponseWrapper(context, odataResponse, uriInfo, exception, debugValue).wrapResponse();
      }
    } else {
      return odataResponse;
View Full Code Here


    if (context.isInDebugMode()) {
      final String debugValue = getQueryDebugValue(request.getQueryParameters());
      if (debugValue == null) {
        ODataDebugResponseWrapperCallback callback =
            context.getServiceFactory().getCallback(ODataDebugResponseWrapperCallback.class);
        return callback == null ? odataResponse : callback.handle(context, request, odataResponse, uriInfo, exception);
      } else {
        return new ODataDebugResponseWrapper(context, odataResponse, uriInfo, exception, debugValue).wrapResponse();
      }
    } else {
      return odataResponse;
View Full Code Here

    if (context.isInDebugMode()) {
      if (getQueryDebugValue(request.getQueryParameters()) == null) {
        ODataDebugResponseWrapperCallback callback =
            context.getServiceFactory().getCallback(ODataDebugResponseWrapperCallback.class);
        return callback == null ? odataResponse : callback.handle(context, request, odataResponse, uriInfo, exception);
      } else {
        return new ODataDebugResponseWrapper(context, odataResponse, uriInfo, exception).wrapResponse();
      }
    } else {
      return odataResponse;
View Full Code Here

    service.getProcessor().setContext(context);
    context.setService(service);

    ODataRequestHandler requestHandler = new ODataRequestHandler(serviceFactory, service, context);

    final ODataResponse odataResponse = requestHandler.handle(request);
    final Response response = RestUtil.convertResponse(odataResponse);

    return response;
  }
View Full Code Here

      ODataService service = serviceFactory.createService(context);
      context.setService(service);
      service.getProcessor().setContext(context);

      ODataRequestHandler requestHandler = new ODataRequestHandler(serviceFactory, service, context);
      final ODataResponse odataResponse = requestHandler.handle(odataRequest);
      createResponse(resp, odataResponse);
    } catch (ODataException e) {
      ODataExceptionWrapper wrapper = new ODataExceptionWrapper(req);
      createResponse(resp, wrapper.wrapInExceptionResponse(e));
    }
View Full Code Here

      ODataService service = serviceFactory.createService(context);
      context.setService(service);
      service.getProcessor().setContext(context);
     
      ODataRequestHandler requestHandler = new ODataRequestHandler(serviceFactory, service, context);
      final ODataResponse odataResponse = requestHandler.handle(odataRequest);
      createResponse(resp, odataResponse);
    } catch (ODataException e) {
      ODataExceptionWrapper wrapper = new ODataExceptionWrapper(req);
      createResponse(resp, wrapper.wrapInExceptionResponse(e));
    }
View Full Code Here

      ODataRequestHandler handler = createHandler(request);
      String mimeHeaderContentId =
          request.getRequestHeaderValue(BatchHelper.MIME_HEADER_CONTENT_ID.toLowerCase(Locale.ENGLISH));
      String requestHeaderContentId =
          request.getRequestHeaderValue(BatchHelper.REQUEST_HEADER_CONTENT_ID.toLowerCase(Locale.ENGLISH));
      ODataResponse response = setContentIdHeader(handler.handle(request), mimeHeaderContentId, requestHeaderContentId);
      List<ODataResponse> responses = new ArrayList<ODataResponse>(1);
      responses.add(response);
      return BatchResponsePart.responses(responses).changeSet(false).build();
    }
  }
View Full Code Here

      request = modifyRequest(suppliedRequest, odataSegments);
    } else {
      request = suppliedRequest;
    }
    ODataRequestHandler handler = createHandler(request);
    ODataResponse response = handler.handle(request);
    if (response.getStatus().getStatusCode() < BAD_REQUEST) {
      response = setContentIdHeader(response, mimeHeaderContentId, requestHeaderContentId);
    }
    if (request.getMethod().equals(ODataHttpMethod.POST)) {
      String baseUri = getBaseUri(request);
View Full Code Here

    service.getProcessor().setContext(context);
    context.setService(service);

    ODataRequestHandler requestHandler = new ODataRequestHandler(serviceFactory, service, context);

    final ODataResponse odataResponse = requestHandler.handle(request);
    final Response response = RestUtil.convertResponse(odataResponse);

    return response;
  }
View Full Code Here

    context.setService(service);
    service.getProcessor().setContext(context);

    ODataRequestHandler requestHandler = new ODataRequestHandler(serviceFactory, service, context);

    final ODataResponse odataResponse = requestHandler.handle(request);
    final Response response = RestUtil.convertResponse(odataResponse);

    return response;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.