public abstract class ODataSingleProcessor extends Object implements MetadataProcessor, ServiceDocumentProcessor, EntityProcessor, EntitySetProcessor, EntityComplexPropertyProcessor, EntityLinkProcessor, EntityLinksProcessor, EntityMediaProcessor, EntitySimplePropertyProcessor, EntitySimplePropertyValueProcessor, FunctionImportProcessor, FunctionImportValueProcessor, BatchProcessor, CustomContentType
A default ODataProcessor that implements all processor features in a single class.
It is recommended to derive from this class and it is required by the
ODataServiceFactory to build an
ODataService.
This abstract class provides a default behavior, returning the correct response
for requests for the service or the metadata document, respectively, and throwing an
ODataNotImplementedException for all other requests.
Sub classes have to override only methods they want to support.
| Constructor and Description |
|---|
ODataSingleProcessor() |
| Modifier and Type | Method and Description |
|---|---|
ODataResponse |
countEntityLinks(GetEntitySetLinksCountUriInfo uriInfo,
String contentType)
Counts the number of target entities of a navigation property.
|
ODataResponse |
countEntitySet(GetEntitySetCountUriInfo uriInfo,
String contentType)
Counts the number of requested entities.
|
ODataResponse |
createEntity(PostUriInfo uriInfo,
InputStream content,
String requestContentType,
String contentType)
Creates an entity.
|
ODataResponse |
createEntityLink(PostUriInfo uriInfo,
InputStream content,
String requestContentType,
String contentType)
Creates a new link to a target entity of a navigation property.
|
ODataResponse |
deleteEntity(DeleteUriInfo uriInfo,
String contentType)
Deletes an entity.
|
ODataResponse |
deleteEntityLink(DeleteUriInfo uriInfo,
String contentType)
Deletes the link to the target entity of a navigation property.
|
ODataResponse |
deleteEntityMedia(DeleteUriInfo uriInfo,
String contentType)
Deletes the media resource of an entity.
|
ODataResponse |
deleteEntitySimplePropertyValue(DeleteUriInfo uriInfo,
String contentType)
Deletes the value of a simple property of an entity.
|
ODataResponse |
executeBatch(BatchHandler handler,
String contentType,
InputStream content)
Executes a OData batch request and provide Batch Response as
ODataResponse |
BatchResponsePart |
executeChangeSet(BatchHandler handler,
List<ODataRequest> requests)
Executes a Change Set and provide BatchResponsePart as
BatchResponsePart that contains the responses to
change requests. |
ODataResponse |
executeFunctionImport(GetFunctionImportUriInfo uriInfo,
String contentType)
Executes a function import and returns the result.
|
ODataResponse |
executeFunctionImportValue(GetFunctionImportUriInfo uriInfo,
String contentType)
Returns the unformatted value of a function import.
|
ODataResponse |
existsEntity(GetEntityCountUriInfo uriInfo,
String contentType)
Checks whether an entity exists.
|
ODataResponse |
existsEntityLink(GetEntityLinkCountUriInfo uriInfo,
String contentType)
Returns whether the target entity of a navigation property exists.
|
ODataContext |
getContext() |
List<String> |
getCustomContentTypes(Class<? extends ODataProcessor> processorFeature)
The OData library will consider these additional content types during negotiation of http content type header.
|
ODataResponse |
readEntity(GetEntityUriInfo uriInfo,
String contentType)
Reads an entity.
|
ODataResponse |
readEntityComplexProperty(GetComplexPropertyUriInfo uriInfo,
String contentType)
Reads a complex property of an entity.
|
ODataResponse |
readEntityLink(GetEntityLinkUriInfo uriInfo,
String contentType)
Reads the URI of the target entity of a navigation property.
|
ODataResponse |
readEntityLinks(GetEntitySetLinksUriInfo uriInfo,
String contentType)
Reads the URIs of the target entities of a navigation property.
|
ODataResponse |
readEntityMedia(GetMediaResourceUriInfo uriInfo,
String contentType)
Reads the media resource of an entity.
|
ODataResponse |
readEntitySet(GetEntitySetUriInfo uriInfo,
String contentType)
Reads entities.
|
ODataResponse |
readEntitySimpleProperty(GetSimplePropertyUriInfo uriInfo,
String contentType)
Reads a simple property of an entity.
|
ODataResponse |
readEntitySimplePropertyValue(GetSimplePropertyUriInfo uriInfo,
String contentType)
Reads the unformatted value of a simple property of an entity.
|
ODataResponse |
readMetadata(GetMetadataUriInfo uriInfo,
String contentType) |
ODataResponse |
readServiceDocument(GetServiceDocumentUriInfo uriInfo,
String contentType) |
void |
setContext(ODataContext context) |
ODataResponse |
updateEntity(PutMergePatchUriInfo uriInfo,
InputStream content,
String requestContentType,
boolean merge,
String contentType)
Updates an entity.
|
ODataResponse |
updateEntityComplexProperty(PutMergePatchUriInfo uriInfo,
InputStream content,
String requestContentType,
boolean merge,
String contentType)
Updates a complex property of an entity.
|
ODataResponse |
updateEntityLink(PutMergePatchUriInfo uriInfo,
InputStream content,
String requestContentType,
String contentType)
Updates the link to the target entity of a navigation property.
|
ODataResponse |
updateEntityMedia(PutMergePatchUriInfo uriInfo,
InputStream content,
String requestContentType,
String contentType)
Updates the media resource of an entity.
|
ODataResponse |
updateEntitySimpleProperty(PutMergePatchUriInfo uriInfo,
InputStream content,
String requestContentType,
String contentType)
Updates a simple property of an entity.
|
ODataResponse |
updateEntitySimplePropertyValue(PutMergePatchUriInfo uriInfo,
InputStream content,
String requestContentType,
String contentType)
Updates a simple property of an entity with an unformatted value.
|
public void setContext(ODataContext context)
setContext in interface ODataProcessorcontext - A request context object which is usually injected by the OData library itself.ODataProcessorpublic ODataContext getContext()
getContext in interface ODataProcessorODataProcessorpublic ODataResponse executeBatch(BatchHandler handler, String contentType, InputStream content) throws ODataException
BatchProcessorODataResponseexecuteBatch in interface BatchProcessorhandler - batch handlercontentType - the content type of the requestcontent - Batch Request bodyODataResponse objectODataExceptionBatchProcessorpublic BatchResponsePart executeChangeSet(BatchHandler handler, List<ODataRequest> requests) throws ODataException
BatchProcessorBatchResponsePart that contains the responses to
change requests.
The method has to define a rollback semantic that may be applied when a request within a Change Set fails
(all-or-nothing requirement).
If a request within a Change Set fails, instead of Change Set Response should be returned the error responseexecuteChangeSet in interface BatchProcessorhandler - batch handlerrequests - list of single change requestsBatchResponsePart objectODataNotImplementedExceptionODataExceptionBatchProcessorpublic ODataResponse executeFunctionImport(GetFunctionImportUriInfo uriInfo, String contentType) throws ODataException
FunctionImportProcessorexecuteFunctionImport in interface FunctionImportProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionFunctionImportProcessorpublic ODataResponse executeFunctionImportValue(GetFunctionImportUriInfo uriInfo, String contentType) throws ODataException
FunctionImportValueProcessorexecuteFunctionImportValue in interface FunctionImportValueProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionFunctionImportValueProcessorpublic ODataResponse readEntitySimplePropertyValue(GetSimplePropertyUriInfo uriInfo, String contentType) throws ODataException
EntitySimplePropertyValueProcessorreadEntitySimplePropertyValue in interface EntitySimplePropertyValueProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntitySimplePropertyValueProcessorpublic ODataResponse updateEntitySimplePropertyValue(PutMergePatchUriInfo uriInfo, InputStream content, String requestContentType, String contentType) throws ODataException
EntitySimplePropertyValueProcessorupdateEntitySimplePropertyValue in interface EntitySimplePropertyValueProcessoruriInfo - information about the request URIcontent - the content of the request, containing the new valuerequestContentType - the content type of the request body
(important for a binary property)contentType - the content type of the responseODataResponse objectODataExceptionEntitySimplePropertyValueProcessorpublic ODataResponse deleteEntitySimplePropertyValue(DeleteUriInfo uriInfo, String contentType) throws ODataException
EntitySimplePropertyValueProcessordeleteEntitySimplePropertyValue in interface EntitySimplePropertyValueProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntitySimplePropertyValueProcessorpublic ODataResponse readEntitySimpleProperty(GetSimplePropertyUriInfo uriInfo, String contentType) throws ODataException
EntitySimplePropertyProcessorreadEntitySimpleProperty in interface EntitySimplePropertyProcessorcontentType - the content type of the responseODataResponse objectODataExceptionEntitySimplePropertyProcessorpublic ODataResponse updateEntitySimpleProperty(PutMergePatchUriInfo uriInfo, InputStream content, String requestContentType, String contentType) throws ODataException
EntitySimplePropertyProcessorupdateEntitySimpleProperty in interface EntitySimplePropertyProcessoruriInfo - information about the request URIcontent - the content of the request, containing the updated property datarequestContentType - the content type of the request bodycontentType - the content type of the responseODataResponse objectODataExceptionEntitySimplePropertyProcessorpublic ODataResponse readEntityMedia(GetMediaResourceUriInfo uriInfo, String contentType) throws ODataException
EntityMediaProcessorreadEntityMedia in interface EntityMediaProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntityMediaProcessorpublic ODataResponse updateEntityMedia(PutMergePatchUriInfo uriInfo, InputStream content, String requestContentType, String contentType) throws ODataException
EntityMediaProcessorupdateEntityMedia in interface EntityMediaProcessoruriInfo - information about the request URIcontent - the content of the requestrequestContentType - the content type of the request bodycontentType - the content type of the responseODataResponse objectODataExceptionEntityMediaProcessorpublic ODataResponse deleteEntityMedia(DeleteUriInfo uriInfo, String contentType) throws ODataException
EntityMediaProcessordeleteEntityMedia in interface EntityMediaProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntityMediaProcessorpublic ODataResponse readEntityLinks(GetEntitySetLinksUriInfo uriInfo, String contentType) throws ODataException
EntityLinksProcessorreadEntityLinks in interface EntityLinksProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataExceptionEntityLinksProcessorpublic ODataResponse countEntityLinks(GetEntitySetLinksCountUriInfo uriInfo, String contentType) throws ODataException
EntityLinksProcessorcountEntityLinks in interface EntityLinksProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataExceptionEntityLinksProcessorpublic ODataResponse createEntityLink(PostUriInfo uriInfo, InputStream content, String requestContentType, String contentType) throws ODataException
EntityLinksProcessorcreateEntityLink in interface EntityLinksProcessoruriInfo - information about the request URIcontent - the content of the request, containing the link datarequestContentType - the content type of the request bodycontentType - the content type of the responseODataExceptionEntityLinkProcessorpublic ODataResponse readEntityLink(GetEntityLinkUriInfo uriInfo, String contentType) throws ODataException
EntityLinkProcessorreadEntityLink in interface EntityLinkProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntityLinkProcessorpublic ODataResponse existsEntityLink(GetEntityLinkCountUriInfo uriInfo, String contentType) throws ODataException
EntityLinkProcessorexistsEntityLink in interface EntityLinkProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntityLinkProcessorpublic ODataResponse updateEntityLink(PutMergePatchUriInfo uriInfo, InputStream content, String requestContentType, String contentType) throws ODataException
EntityLinkProcessorupdateEntityLink in interface EntityLinkProcessoruriInfo - information about the request URIcontent - the content of the request, containing the new URIrequestContentType - the content type of the request bodycontentType - the content type of the responseODataResponse objectODataExceptionEntityLinkProcessorpublic ODataResponse deleteEntityLink(DeleteUriInfo uriInfo, String contentType) throws ODataException
EntityLinkProcessordeleteEntityLink in interface EntityLinkProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntityLinkProcessorpublic ODataResponse readEntityComplexProperty(GetComplexPropertyUriInfo uriInfo, String contentType) throws ODataException
EntityComplexPropertyProcessorreadEntityComplexProperty in interface EntityComplexPropertyProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntityComplexPropertyProcessorpublic ODataResponse updateEntityComplexProperty(PutMergePatchUriInfo uriInfo, InputStream content, String requestContentType, boolean merge, String contentType) throws ODataException
EntityComplexPropertyProcessorupdateEntityComplexProperty in interface EntityComplexPropertyProcessoruriInfo - information about the request URIcontent - the content of the request, containing the updated property datarequestContentType - the content type of the request bodymerge - if true, properties not present in the data are left unchanged;
if false, they are resetcontentType - the content type of the responseODataResponse objectODataExceptionEntityComplexPropertyProcessorpublic ODataResponse readEntitySet(GetEntitySetUriInfo uriInfo, String contentType) throws ODataException
EntitySetProcessorreadEntitySet in interface EntitySetProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntitySetProcessorpublic ODataResponse countEntitySet(GetEntitySetCountUriInfo uriInfo, String contentType) throws ODataException
EntitySetProcessorcountEntitySet in interface EntitySetProcessoruriInfo - information about the request URIcontentType - the content type of the responseODataResponse objectODataExceptionEntitySetProcessorpublic ODataResponse createEntity(PostUriInfo uriInfo, InputStream content, String requestContentType, String contentType) throws ODataException
EntitySetProcessorcreateEntity in interface EntitySetProcessoruriInfo - information about the request URIcontent - the content of the request, containing the data of the new entityrequestContentType - the content type of the request bodycontentType - the content type of the responseODataResponse objectODataExceptionEntitySetProcessorpublic ODataResponse readEntity(GetEntityUriInfo uriInfo, String contentType) throws ODataException
EntityProcessorreadEntity in interface EntityProcessorcontentType - the content type of the responseODataResponse objectODataExceptionEntityProcessorpublic ODataResponse existsEntity(GetEntityCountUriInfo uriInfo, String contentType) throws ODataException
EntityProcessorexistsEntity in interface EntityProcessorcontentType - the content type of the responseODataResponse objectODataExceptionEntityProcessorpublic ODataResponse updateEntity(PutMergePatchUriInfo uriInfo, InputStream content, String requestContentType, boolean merge, String contentType) throws ODataException
EntityProcessorupdateEntity in interface EntityProcessoruriInfo - information about the request URIcontent - the content of the request, containing the updated entity datarequestContentType - the content type of the request bodymerge - if true, properties not present in the data are left unchanged;
if false, they are resetcontentType - the content type of the responseODataResponse objectODataExceptionEntityProcessorpublic ODataResponse deleteEntity(DeleteUriInfo uriInfo, String contentType) throws ODataException
EntityProcessordeleteEntity in interface EntityProcessoruriInfo - a DeleteUriInfo object with information from the URI parsercontentType - the content type of the responseODataResponse objectODataExceptionEntityProcessorpublic ODataResponse readServiceDocument(GetServiceDocumentUriInfo uriInfo, String contentType) throws ODataException
readServiceDocument in interface ServiceDocumentProcessorODataResponse objectODataExceptionServiceDocumentProcessorpublic ODataResponse readMetadata(GetMetadataUriInfo uriInfo, String contentType) throws ODataException
readMetadata in interface MetadataProcessorODataResponse objectODataExceptionMetadataProcessorpublic List<String> getCustomContentTypes(Class<? extends ODataProcessor> processorFeature) throws ODataException
CustomContentTypegetCustomContentTypes in interface CustomContentTypeODataExceptionCustomContentTypeCopyright © 2013-2022 The Apache Software Foundation. All Rights Reserved.