public class DefaultProcessor extends Object implements MetadataProcessor, ServiceDocumentProcessor, ErrorProcessor
Processor implementation for handling default cases:
This implementation is registered in the ODataHandler by default. The default can be replaced by re-registering a custom implementation.
Constructor and Description |
---|
DefaultProcessor() |
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.
|
public void init(OData odata, ServiceMetadata serviceMetadata)
Processor
public void readServiceDocument(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType) throws ODataApplicationException, ODataLibraryException
ServiceDocumentProcessor
readServiceDocument
in interface ServiceDocumentProcessor
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 negotiationODataApplicationException
- if the service implementation encounters a failureODataLibraryException
public void readMetadata(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType) throws ODataApplicationException, ODataLibraryException
MetadataProcessor
readMetadata
in interface MetadataProcessor
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 negotiationODataApplicationException
- if the service implementation encounters a failureODataLibraryException
public void processError(ODataRequest request, ODataResponse response, ODataServerError serverError, ContentType requestedContentType)
ErrorProcessor
processError
in interface ErrorProcessor
request
- OData request object containing raw HTTP informationresponse
- OData response object for collecting response dataserverError
- the server errorrequestedContentType
- requested content type after content negotiationCopyright © 2013–2018 The Apache Software Foundation. All rights reserved.