org.apache.olingo.server.api.processor

## 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 Summary

    Constructors
    Constructor and Description
    `DefaultProcessor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `init(OData odata, ServiceMetadata serviceMetadata)` Initializes the processor for each HTTP request - response cycle.
    `void` | `processError(ODataRequest request, ODataResponse response, ODataServerError serverError, ContentType requestedContentType)` Processes an error/exception.
    `void` | `readMetadata(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType)` Reads data from persistence and puts serialized content and status into the response.
    `void` | `readServiceDocument(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType)` Reads service-document information from persistence and puts serialized content and status into the response.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultProcessor

          public DefaultProcessor()

  - ### Method Detail

    - #### 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

Copyright © 2013–2022 The Apache Software Foundation. All rights reserved.