Class DefaultProcessor

java.lang.Object
org.apache.olingo.server.api.processor.DefaultProcessor
All Implemented Interfaces:
ErrorProcessor, MetadataProcessor, Processor, ServiceDocumentProcessor

public class DefaultProcessor extends Object implements MetadataProcessor, ServiceDocumentProcessor, ErrorProcessor

Processor implementation for handling default cases:

  • request for the metadata document
  • request for the service document
  • error handling

This implementation is registered in the ODataHandler by default. The default can be replaced by re-registering a custom implementation.

  • Constructor Details

    • DefaultProcessor

      public DefaultProcessor()
  • Method Details

    • init

      public void init(OData odata, ServiceMetadata serviceMetadata)
      Description copied from interface: Processor
      Initializes the processor for each HTTP request - response cycle.
      Specified by:
      init in interface Processor
      Parameters:
      odata - Olingo's root object, acting as a factory for various object types
      serviceMetadata - metadata of the OData service like the EDM that have to be created before the OData request handling takes place
    • readServiceDocument

      public void readServiceDocument(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType) throws ODataApplicationException, ODataLibraryException
      Description copied from interface: ServiceDocumentProcessor
      Reads service-document information from persistence and puts serialized content and status into the response.
      Specified by:
      readServiceDocument in interface ServiceDocumentProcessor
      Parameters:
      request - OData request object containing raw HTTP information
      response - OData response object for collecting response data
      uriInfo - information of a parsed OData URI
      requestedContentType - requested content type after content negotiation
      Throws:
      ODataApplicationException - if the service implementation encounters a failure
      ODataLibraryException
    • readMetadata

      public void readMetadata(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType) throws ODataApplicationException, ODataLibraryException
      Description copied from interface: MetadataProcessor
      Reads data from persistence and puts serialized content and status into the response.
      Specified by:
      readMetadata in interface MetadataProcessor
      Parameters:
      request - OData request object containing raw HTTP information
      response - OData response object for collecting response data
      uriInfo - information of a parsed OData URI
      requestedContentType - requested content type after content negotiation
      Throws:
      ODataApplicationException - if the service implementation encounters a failure
      ODataLibraryException
    • processError

      public void processError(ODataRequest request, ODataResponse response, ODataServerError serverError, ContentType requestedContentType)
      Description copied from interface: ErrorProcessor
      Processes an error/exception. MUST NOT throw an exception!
      Specified by:
      processError in interface ErrorProcessor
      Parameters:
      request - OData request object containing raw HTTP information
      response - OData response object for collecting response data
      serverError - the server error
      requestedContentType - requested content type after content negotiation