Class OData2Processor

  • All Implemented Interfaces:
    org.apache.olingo.odata2.api.processor.feature.CustomContentType, org.apache.olingo.odata2.api.processor.feature.ODataProcessorFeature, org.apache.olingo.odata2.api.processor.ODataProcessor, org.apache.olingo.odata2.api.processor.part.BatchProcessor, org.apache.olingo.odata2.api.processor.part.EntityComplexPropertyProcessor, org.apache.olingo.odata2.api.processor.part.EntityLinkProcessor, org.apache.olingo.odata2.api.processor.part.EntityLinksProcessor, org.apache.olingo.odata2.api.processor.part.EntityMediaProcessor, org.apache.olingo.odata2.api.processor.part.EntityProcessor, org.apache.olingo.odata2.api.processor.part.EntitySetProcessor, org.apache.olingo.odata2.api.processor.part.EntitySimplePropertyProcessor, org.apache.olingo.odata2.api.processor.part.EntitySimplePropertyValueProcessor, org.apache.olingo.odata2.api.processor.part.FunctionImportProcessor, org.apache.olingo.odata2.api.processor.part.FunctionImportValueProcessor, org.apache.olingo.odata2.api.processor.part.MetadataProcessor, org.apache.olingo.odata2.api.processor.part.ServiceDocumentProcessor

    public class OData2Processor
    extends org.apache.olingo.odata2.api.processor.ODataSingleProcessor
    The OData2Processor implements some of the operations defined in the ODataSingleProcessor. It uses ODataProcessorHandler to handle a particular operation.
    • Constructor Detail

      • OData2Processor

        public OData2Processor()
    • Method Detail

      • createEntity

        public org.apache.olingo.odata2.api.processor.ODataResponse createEntity​(org.apache.olingo.odata2.api.uri.info.PostUriInfo uriInfo,
                                                                                 java.io.InputStream content,
                                                                                 java.lang.String requestContentType,
                                                                                 java.lang.String responseContentType)
                                                                          throws org.apache.olingo.odata2.api.exception.ODataException
        Specified by:
        createEntity in interface org.apache.olingo.odata2.api.processor.part.EntitySetProcessor
        Overrides:
        createEntity in class org.apache.olingo.odata2.api.processor.ODataSingleProcessor
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException
      • updateEntity

        public org.apache.olingo.odata2.api.processor.ODataResponse updateEntity​(org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo uriInfo,
                                                                                 java.io.InputStream content,
                                                                                 java.lang.String requestContentType,
                                                                                 boolean merge,
                                                                                 java.lang.String contentType)
                                                                          throws org.apache.olingo.odata2.api.exception.ODataException
        Specified by:
        updateEntity in interface org.apache.olingo.odata2.api.processor.part.EntityProcessor
        Overrides:
        updateEntity in class org.apache.olingo.odata2.api.processor.ODataSingleProcessor
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException
      • executeBatch

        public org.apache.olingo.odata2.api.processor.ODataResponse executeBatch​(org.apache.olingo.odata2.api.batch.BatchHandler handler,
                                                                                 java.lang.String contentType,
                                                                                 java.io.InputStream content)
                                                                          throws org.apache.olingo.odata2.api.exception.ODataException
        Specified by:
        executeBatch in interface org.apache.olingo.odata2.api.processor.part.BatchProcessor
        Overrides:
        executeBatch in class org.apache.olingo.odata2.api.processor.ODataSingleProcessor
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException
      • executeChangeSet

        public org.apache.olingo.odata2.api.batch.BatchResponsePart executeChangeSet​(org.apache.olingo.odata2.api.batch.BatchHandler batchHandler,
                                                                                     java.util.List<org.apache.olingo.odata2.api.processor.ODataRequest> requests)
                                                                              throws org.apache.olingo.odata2.api.exception.ODataException
        Specified by:
        executeChangeSet in interface org.apache.olingo.odata2.api.processor.part.BatchProcessor
        Overrides:
        executeChangeSet in class org.apache.olingo.odata2.api.processor.ODataSingleProcessor
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException
      • deleteEntity

        public org.apache.olingo.odata2.api.processor.ODataResponse deleteEntity​(org.apache.olingo.odata2.api.uri.info.DeleteUriInfo uriInfo,
                                                                                 java.lang.String contentType)
                                                                          throws org.apache.olingo.odata2.api.exception.ODataException
        Specified by:
        deleteEntity in interface org.apache.olingo.odata2.api.processor.part.EntityProcessor
        Overrides:
        deleteEntity in class org.apache.olingo.odata2.api.processor.ODataSingleProcessor
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException
      • countEntitySet

        public org.apache.olingo.odata2.api.processor.ODataResponse countEntitySet​(org.apache.olingo.odata2.api.uri.info.GetEntitySetCountUriInfo uriInfo,
                                                                                   java.lang.String contentType)
                                                                            throws org.apache.olingo.odata2.api.exception.ODataException
        Specified by:
        countEntitySet in interface org.apache.olingo.odata2.api.processor.part.EntitySetProcessor
        Overrides:
        countEntitySet in class org.apache.olingo.odata2.api.processor.ODataSingleProcessor
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException
      • readEntity

        public org.apache.olingo.odata2.api.processor.ODataResponse readEntity​(org.apache.olingo.odata2.api.uri.info.GetEntityUriInfo uriInfo,
                                                                               java.lang.String contentType)
                                                                        throws org.apache.olingo.odata2.api.exception.ODataException
        Specified by:
        readEntity in interface org.apache.olingo.odata2.api.processor.part.EntityProcessor
        Overrides:
        readEntity in class org.apache.olingo.odata2.api.processor.ODataSingleProcessor
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException
      • readEntitySet

        public org.apache.olingo.odata2.api.processor.ODataResponse readEntitySet​(org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo uriInfo,
                                                                                  java.lang.String contentType)
                                                                           throws org.apache.olingo.odata2.api.exception.ODataException
        Specified by:
        readEntitySet in interface org.apache.olingo.odata2.api.processor.part.EntitySetProcessor
        Overrides:
        readEntitySet in class org.apache.olingo.odata2.api.processor.ODataSingleProcessor
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException
      • read

        protected org.apache.olingo.odata2.api.processor.ODataResponse read​(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
                                                                            java.lang.String contentType)
                                                                     throws org.apache.olingo.odata2.api.exception.ODataException
        Reads the data specified by the given parameters
        Parameters:
        uriInfo - The URI Info containing the specification of the read (e.g. filter, expand, URL)
        contentType - Response content type
        Returns:
        ODataResponse containing data that was read
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException - is thrown when there's a failure in the read
      • getPersistenceParam

        protected PersistenceParam getPersistenceParam​(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
                                                       java.io.InputStream content,
                                                       java.lang.String requestContentType,
                                                       java.lang.String responseContentType)
        Gets a PersistenceParam from the given parameters
        Parameters:
        uriInfo - URI info containing the information that's needed for the persistence
        content - The request payload
        requestContentType - Request payload content type
        responseContentType - Response payload content type
        Returns:
        An instance of the parameter object
      • getBatchParam

        protected BatchParam getBatchParam​(org.apache.olingo.odata2.api.batch.BatchHandler batchHandler,
                                           java.lang.String responseContentType,
                                           java.io.InputStream content)
        Gets a BatchParam from the given parameters
        Parameters:
        batchHandler - The BatchHandler that handles the batch data
        content - The request payload
        responseContentType - Response payload content type
        Returns:
        An instance of the parameter object
      • getChangeSetParam

        protected ChangeSetParam getChangeSetParam​(org.apache.olingo.odata2.api.batch.BatchHandler batchHandler,
                                                   java.util.List<org.apache.olingo.odata2.api.processor.ODataRequest> requests)
        Gets a ChangeSetParam from the given parameters
        Parameters:
        batchHandler - The BatchHandler that handles the batch changeset data
        requests - The list of changesets as ODataRequests
        Returns:
        An instance of the parameter object
      • getDeleteParam

        protected DeleteParam getDeleteParam​(org.apache.olingo.odata2.api.uri.info.DeleteUriInfo uriInfo)
        Gets a DeleteParam from the given parameters
        Parameters:
        uriInfo - URI info containing the information that delete uses, such as the item's integration key
        Returns:
        An instance of the parameter object
      • getReadParam

        protected ReadParam getReadParam​(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
                                         java.lang.String responseContentType)
        Gets a ReadParam from the given parameters
        Parameters:
        uriInfo - URI info containing the information that read uses
        responseContentType - Response content type
        Returns:
        An instance of the parameter object
      • getBatchPersistenceHandler

        protected ODataProcessorHandler<BatchParam,​org.apache.olingo.odata2.api.processor.ODataResponse> getBatchPersistenceHandler()
      • setBatchPersistenceHandler

        public void setBatchPersistenceHandler​(ODataProcessorHandler<BatchParam,​org.apache.olingo.odata2.api.processor.ODataResponse> batchPersistenceHandler)
      • setChangeSetPersistenceHandler

        public void setChangeSetPersistenceHandler​(ODataProcessorHandler<ChangeSetParam,​org.apache.olingo.odata2.api.batch.BatchResponsePart> changeSetPersistenceHandler)
      • setPatchPersistenceHandler

        public void setPatchPersistenceHandler​(ODataProcessorHandler<PersistenceParam,​org.apache.olingo.odata2.api.processor.ODataResponse> patchPersistenceHandler)
      • setReadHandler

        public void setReadHandler​(ODataProcessorHandler<ReadParam,​org.apache.olingo.odata2.api.processor.ODataResponse> readHandler)
      • setAccessRightsService

        public void setAccessRightsService​(AccessRightsService accessRightsService)
      • setServiceNameExtractor

        public void setServiceNameExtractor​(ServiceNameExtractor serviceNameExtractor)
      • setItemTypeDescriptorService

        public void setItemTypeDescriptorService​(ItemTypeDescriptorService itemTypeDescriptorService)