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 -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(OData odata, ServiceMetadata serviceMetadata) Initializes the processor for each HTTP request - response cycle.voidprocessError(ODataRequest request, ODataResponse response, ODataServerError serverError, ContentType requestedContentType) Processes an error/exception.voidreadMetadata(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType) Reads data from persistence and puts serialized content and status into the response.voidreadServiceDocument(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType) Reads service-document information from persistence and puts serialized content and status into the response.
-
Constructor Details
-
DefaultProcessor
public DefaultProcessor()
-
-
Method Details
-
init
Description copied from interface:ProcessorInitializes the processor for each HTTP request - response cycle. -
readServiceDocument
public void readServiceDocument(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType) throws ODataApplicationException, ODataLibraryException Description copied from interface:ServiceDocumentProcessorReads service-document information from persistence and puts serialized content and status into the response.- Specified by:
readServiceDocumentin interfaceServiceDocumentProcessor- Parameters:
request- OData request object containing raw HTTP informationresponse- OData response object for collecting response datauriInfo- information of a parsed OData URIrequestedContentType- requested content type after content negotiation- Throws:
ODataApplicationException- if the service implementation encounters a failureODataLibraryException
-
readMetadata
public void readMetadata(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType) throws ODataApplicationException, ODataLibraryException Description copied from interface:MetadataProcessorReads data from persistence and puts serialized content and status into the response.- Specified by:
readMetadatain interfaceMetadataProcessor- Parameters:
request- OData request object containing raw HTTP informationresponse- OData response object for collecting response datauriInfo- information of a parsed OData URIrequestedContentType- requested content type after content negotiation- Throws:
ODataApplicationException- if the service implementation encounters a failureODataLibraryException
-
processError
public void processError(ODataRequest request, ODataResponse response, ODataServerError serverError, ContentType requestedContentType) Description copied from interface:ErrorProcessorProcesses an error/exception. MUST NOT throw an exception!- Specified by:
processErrorin interfaceErrorProcessor- Parameters:
request- OData request object containing raw HTTP informationresponse- OData response object for collecting response dataserverError- the server errorrequestedContentType- requested content type after content negotiation
-