public class ProviderFacadeImpl extends Object implements EntityProvider.EntityProviderInterface
| Constructor and Description |
|---|
ProviderFacadeImpl() |
| Modifier and Type | Method and Description |
|---|---|
List<BatchRequestPart> |
parseBatchRequest(String contentType,
InputStream content,
EntityProviderBatchProperties properties)
Parse Batch Request body
inputStream (as InputStream) and provide a list of Batch Parts as
BatchPart |
List<BatchSingleResponse> |
parseBatchResponse(String contentType,
InputStream content)
Parse Batch Response body (as
InputStream) and provide a list of single responses as
BatchSingleResponse |
byte[] |
readBinary(InputStream content)
|
ODataDeltaFeed |
readDeltaFeed(String contentType,
EdmEntitySet entitySet,
InputStream content,
EntityProviderReadProperties properties)
Read (de-serialize) a delta data feed from
content (as InputStream) in specified format
(given as contentType)
based on entity data model (given as EdmEntitySet) and provide this data as
ODataDeltaFeed. |
ODataEntry |
readEntry(String contentType,
EdmEntitySet entitySet,
InputStream content,
EntityProviderReadProperties properties)
Reads (de-serializes) data from
content (as InputStream)
in specified format (given as contentType) based on
entity data model (given as EdmEntitySet)
and provides this data as ODataEntry. |
ODataErrorContext |
readErrorDocument(InputStream errorDocument,
String contentType)
Read (de-serialize) data from error document as
InputStream and provide according
ODataErrorContext. |
ODataFeed |
readFeed(String contentType,
EdmEntitySet entitySet,
InputStream content,
EntityProviderReadProperties properties)
Read (de-serialize) a data feed from
content (as InputStream) in specified format (given as
contentType)
based on entity data model (given as EdmEntitySet) and provide this data as
ODataFeed. |
Object |
readFunctionImport(String contentType,
EdmFunctionImport functionImport,
InputStream content,
EntityProviderReadProperties properties)
Reads (de-serializes) function-import data from
content (as InputStream) in specified format
(given as contentType) based on entity data model (given as EdmFunctionImport)
and provide this data as Object. |
String |
readLink(String contentType,
EdmEntitySet entitySet,
InputStream content)
Read (de-serialize) a link from
content (as InputStream) in specified format (given as
contentType)
based on entity data model (given as EdmEntitySet) and provide the link as String. |
List<String> |
readLinks(String contentType,
EdmEntitySet entitySet,
InputStream content)
Read (de-serialize) all links from
content (as InputStream)
in specified format (given as contentType) based on entity data model
(given as EdmEntitySet) and provide the link as List of Strings. |
Edm |
readMetadata(InputStream inputStream,
boolean validate)
|
Map<String,Object> |
readProperty(String contentType,
EdmProperty edmProperty,
InputStream content,
EntityProviderReadProperties properties)
Read (de-serialize) properties from
content (as InputStream) in specified format (given as
contentType)
based on entity data model (given as EdmProperty) and provide this data as Map which
contains
the read data in form of property name to property value mapping. |
Object |
readPropertyValue(EdmProperty edmProperty,
InputStream content,
Class<?> typeMapping)
Read (de-serialize) a property value from
content (as InputStream) in format
text/plain
based on entity data model (given as EdmProperty) and provide this data as Object. |
ServiceDocument |
readServiceDocument(InputStream serviceDocument,
String contentType)
Read (de-serialize) data from service document
inputStream (as InputStream) and provide
ServiceDocument as ServiceDocument |
InputStream |
writeBatchRequest(List<BatchPart> batchParts,
String boundary)
Create Batch Request body as InputStream.
|
ODataResponse |
writeBatchResponse(List<BatchResponsePart> batchResponseParts)
Write responses of Batch Response Parts in Batch Response as
ODataResponse. |
ODataResponse |
writeBinary(String mimeType,
byte[] data)
Write binary content with content type header set to given
mime type parameter. |
ODataResponse |
writeEntry(String contentType,
EdmEntitySet entitySet,
Map<String,Object> data,
EntityProviderWriteProperties properties)
Write given
data (which is given in form of a Map for which contains all properties
as property name to property value mapping) for the entry in the specified
format (given as contentType) based on entity data model for an entity set (given as
EdmEntitySet)
and properties for this entity provider (given as EntityProviderWriteProperties). |
ODataResponse |
writeErrorDocument(ODataErrorContext context)
Serializes an error message according to the OData standard.
|
ODataResponse |
writeFeed(String contentType,
EdmEntitySet entitySet,
List<Map<String,Object>> data,
EntityProviderWriteProperties properties)
|
ODataResponse |
writeFunctionImport(String contentType,
EdmFunctionImport functionImport,
Object data,
EntityProviderWriteProperties properties)
Write
data result (given as Object) of function import based on return type
of EdmFunctionImport in specified format (given as contentType). |
ODataResponse |
writeLink(String contentType,
EdmEntitySet entitySet,
Map<String,Object> data,
EntityProviderWriteProperties properties)
Write link for key property based on
entity data model for an entity set (given as
EdmEntitySet)
in the specified format (given as contentType). |
ODataResponse |
writeLinks(String contentType,
EdmEntitySet entitySet,
List<Map<String,Object>> data,
EntityProviderWriteProperties properties)
Write all links for key property based on
entity data model for an entity set (given as
EdmEntitySet)
in the specified format (given as contentType) for a set of entries. |
ODataResponse |
writeMetadata(DataServices seriviceMetadata,
Map<String,String> predefinedNamespaces)
Write metadata document in XML format for the given schemas and the provided predefined
namespaces at the EDMX element.
|
ODataResponse |
writeMetadata(List<Schema> schemas,
Map<String,String> predefinedNamespaces)
Write metadata document in XML format for the given schemas and the provided predefined
namespaces at the EDMX element.
|
ODataResponse |
writeProperty(String contentType,
EdmProperty edmProperty,
Object value)
Write given
value (which is given in form of an Object) for the property in the specified
format (given as contentType) based on given entity data model for an entity property
(given as EdmProperty). |
ODataResponse |
writePropertyValue(EdmProperty edmProperty,
Object value)
Write property as content type
application/octet-stream or text/plain. |
ODataResponse |
writeServiceDocument(String contentType,
Edm edm,
String serviceRoot)
Write service document based on given
Edm and service root as
given content type. |
ODataResponse |
writeText(String value)
Write text value as content type
text/plain. |
public ODataResponse writeErrorDocument(ODataErrorContext context)
EntityProvider.EntityProviderInterfaceSerializes an error message according to the OData standard.
writeErrorDocument in interface EntityProvider.EntityProviderInterfacecontext - contains error details see ODataErrorContextODataResponse containing the serialized error messagepublic ODataResponse writeServiceDocument(String contentType, Edm edm, String serviceRoot) throws EntityProviderException
EntityProvider.EntityProviderInterfaceEdm and service root as
given content type.writeServiceDocument in interface EntityProvider.EntityProviderInterfacecontentType - format in which service document should be writtenedm - entity data model to be writtenserviceRoot - service root for the written service documentODataResponse with written service document content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writePropertyValue(EdmProperty edmProperty, Object value) throws EntityProviderException
EntityProvider.EntityProviderInterfaceapplication/octet-stream or text/plain.writePropertyValue in interface EntityProvider.EntityProviderInterfaceedmProperty - entity data model for to be written propertyvalue - property which will be writtenODataResponse with written property value content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writeText(String value) throws EntityProviderException
EntityProvider.EntityProviderInterfacetext/plain.writeText in interface EntityProvider.EntityProviderInterfacevalue - text value which will be writtenODataResponse with written text/plain content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writeBinary(String mimeType, byte[] data) throws EntityProviderException
EntityProvider.EntityProviderInterfacemime type parameter.writeBinary in interface EntityProvider.EntityProviderInterfacemimeType - mime type which is written and used as content type header information.data - which is written to ODataResponse.ODataResponse with written binary content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writeFeed(String contentType, EdmEntitySet entitySet, List<Map<String,Object>> data, EntityProviderWriteProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfacedata (which is given in form of a List with a Map for each entity. Such
a Map contains all properties [as property name to property value mapping] for
the entry) in the specified
format (given as contentType) based on given entity data model for an entity set (given
as EdmEntitySet)
and properties for this entity provider (given as EntityProviderWriteProperties).writeFeed in interface EntityProvider.EntityProviderInterfacecontentType - format in which the feed should be writtenentitySet - entity data model for given entity data setdata - set of entries in form of a List with a Map for each entity (such a Map
contains all properties [as property name to property value mapping).properties - additional properties necessary for writing of dataODataResponse with written feed content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writeEntry(String contentType, EdmEntitySet entitySet, Map<String,Object> data, EntityProviderWriteProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfacedata (which is given in form of a Map for which contains all properties
as property name to property value mapping) for the entry in the specified
format (given as contentType) based on entity data model for an entity set (given as
EdmEntitySet)
and properties for this entity provider (given as EntityProviderWriteProperties).writeEntry in interface EntityProvider.EntityProviderInterfacecontentType - format in which the entry should be writtenentitySet - entity data model for given entity data setdata - which contains all properties as property name to property value mapping
for the entryproperties - additional properties necessary for writing of dataODataResponse with written entry contentEntityProviderException - if writing of data (serialization) failspublic ODataResponse writeProperty(String contentType, EdmProperty edmProperty, Object value) throws EntityProviderException
EntityProvider.EntityProviderInterfacevalue (which is given in form of an Object) for the property in the specified
format (given as contentType) based on given entity data model for an entity property
(given as EdmProperty).writeProperty in interface EntityProvider.EntityProviderInterfacecontentType - format in which the property should be writtenedmProperty - entity data model for given propertyvalue - data which is writtenODataResponse with written property content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writeLink(String contentType, EdmEntitySet entitySet, Map<String,Object> data, EntityProviderWriteProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfaceentity data model for an entity set (given as
EdmEntitySet)
in the specified format (given as contentType).
The necessary key property values must be provided within the data (in the form of property
name
to property value mapping) and properties for this entity provider must be set
(given as EntityProviderWriteProperties).writeLink in interface EntityProvider.EntityProviderInterfacecontentType - format in which the entry should be writtenentitySet - entity data model for given entity data setdata - which contains all key properties as property name to property value
mapping for the entryproperties - additional properties necessary for writing of dataODataResponse with written link content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writeLinks(String contentType, EdmEntitySet entitySet, List<Map<String,Object>> data, EntityProviderWriteProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfaceentity data model for an entity set (given as
EdmEntitySet)
in the specified format (given as contentType) for a set of entries.
The necessary key property values must be provided within the data (in form of a List with a
Map for each entry. Such a Map contains all key properties [as property name to
property value mapping] for the entry) and properties for this entity provider must be
set
(given as EntityProviderWriteProperties).writeLinks in interface EntityProvider.EntityProviderInterfacecontentType - format in which the entry should be writtenentitySet - entity data model for given entity data setdata - set of entries in form of a List with a Map for each entry (such a Map
contains all key properties [as property name to property value mapping).properties - additional properties necessary for writing of dataODataResponse with written links content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writeFunctionImport(String contentType, EdmFunctionImport functionImport, Object data, EntityProviderWriteProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfacedata result (given as Object) of function import based on return type
of EdmFunctionImport in specified format (given as contentType). Additional
properties
for this entity provider must be set (given as EntityProviderWriteProperties).writeFunctionImport in interface EntityProvider.EntityProviderInterfacecontentType - format in which the entry should be writtenfunctionImport - entity data model for executed function importdata - result of function importproperties - additional properties necessary for writing of dataODataResponse with written function import result content.EntityProviderException - if writing of data (serialization) failspublic ODataErrorContext readErrorDocument(InputStream errorDocument, String contentType) throws EntityProviderException
EntityProvider.EntityProviderInterfaceInputStream and provide according
ODataErrorContext.readErrorDocument in interface EntityProvider.EntityProviderInterfaceerrorDocument - error document which is readcontentType - format of content in the given input streamEntityProviderException - if reading of data (de-serialization) failspublic ODataFeed readFeed(String contentType, EdmEntitySet entitySet, InputStream content, EntityProviderReadProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfacecontent (as InputStream) in specified format (given as
contentType)
based on entity data model (given as EdmEntitySet) and provide this data as
ODataFeed.readFeed in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input stream.entitySet - entity data model for entity set to be readcontent - feed data in form of an InputStream which contains the data in specified formatproperties - additional properties necessary for reading content from InputStream into Map.ODataFeed objectEntityProviderException - if reading of data (de-serialization) failspublic ODataDeltaFeed readDeltaFeed(String contentType, EdmEntitySet entitySet, InputStream content, EntityProviderReadProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfacecontent (as InputStream) in specified format
(given as contentType)
based on entity data model (given as EdmEntitySet) and provide this data as
ODataDeltaFeed.readDeltaFeed in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input stream.entitySet - entity data model for entity set to be readcontent - delta feed data in form of an InputStream which contains the data in specified formatproperties - additional properties necessary for reading content from InputStream into Map.ODataDeltaFeed objectEntityProviderException - if reading of data (de-serialization) failspublic ODataEntry readEntry(String contentType, EdmEntitySet entitySet, InputStream content, EntityProviderReadProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfacecontent (as InputStream)
in specified format (given as contentType) based on
entity data model (given as EdmEntitySet)
and provides this data as ODataEntry.
Does not return complete entry data but only data present in the
de-serialized content.readEntry in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input streamentitySet - entity data model for entity set to be readcontent - data in form of an InputStream which
contains the data in specified formatproperties - additional properties necessary for reading
content from InputStream into Map.ODataEntryEntityProviderException - if reading of data (de-serialization) failspublic Map<String,Object> readProperty(String contentType, EdmProperty edmProperty, InputStream content, EntityProviderReadProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfacecontent (as InputStream) in specified format (given as
contentType)
based on entity data model (given as EdmProperty) and provide this data as Map which
contains
the read data in form of property name to property value mapping.readProperty in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input stream.edmProperty - entity data model for entity property to be readcontent - data in form of an InputStream which contains the data in specified formatproperties - additional properties necessary for reading content from InputStream into Map.EntityProviderException - if reading of data (de-serialization) failspublic Object readPropertyValue(EdmProperty edmProperty, InputStream content, Class<?> typeMapping) throws EntityProviderException
EntityProvider.EntityProviderInterfacecontent (as InputStream) in format
text/plain
based on entity data model (given as EdmProperty) and provide this data as Object.readPropertyValue in interface EntityProvider.EntityProviderInterfaceedmProperty - entity data model for entity property to be readcontent - data in form of an InputStream which contains the data in format text/plaintypeMapping - defines the mapping for this edm property to a java class which
should be used
during read of the content. If according edm property can not be read
into given java class an EntityProviderException is thrown.
Supported mappings are documented in EdmSimpleType.EntityProviderException - if reading of data (de-serialization) failspublic Object readFunctionImport(String contentType, EdmFunctionImport functionImport, InputStream content, EntityProviderReadProperties properties) throws EntityProviderException
EntityProvider.EntityProviderInterfacecontent (as InputStream) in specified format
(given as contentType) based on entity data model (given as EdmFunctionImport)
and provide this data as Object.readFunctionImport in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input stream.functionImport - entity data model for Function Import to be readcontent - data in form of an InputStream which contains the data in specified formatproperties - additional properties necessary for reading content from InputStream into Map.
Must not be null.ObjectEntityProviderException - if reading of data (de-serialization) failspublic List<String> readLinks(String contentType, EdmEntitySet entitySet, InputStream content) throws EntityProviderException
EntityProvider.EntityProviderInterfacecontent (as InputStream)
in specified format (given as contentType) based on entity data model
(given as EdmEntitySet) and provide the link as List of Strings.readLinks in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input stream.entitySet - entity data model for entity property to be readcontent - data in form of an InputStream which contains the data in specified formatEntityProviderException - if reading of data (de-serialization) failspublic String readLink(String contentType, EdmEntitySet entitySet, InputStream content) throws EntityProviderException
EntityProvider.EntityProviderInterfacecontent (as InputStream) in specified format (given as
contentType)
based on entity data model (given as EdmEntitySet) and provide the link as String.readLink in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input stream.entitySet - entity data model for entity property to be readcontent - data in form of an InputStream which contains the data in specified formatEntityProviderException - if reading of data (de-serialization) failspublic byte[] readBinary(InputStream content) throws EntityProviderException
EntityProvider.EntityProviderInterfacereadBinary in interface EntityProvider.EntityProviderInterfacecontent - data in form of an InputStream which contains the binary dataEntityProviderException - if reading of data (de-serialization) failspublic ODataResponse writeMetadata(List<Schema> schemas, Map<String,String> predefinedNamespaces) throws EntityProviderException
EntityProvider.EntityProviderInterfacewriteMetadata in interface EntityProvider.EntityProviderInterfaceschemas - all XML schemas which will be writtenpredefinedNamespaces - type of Map<prefix,namespace> and may be null or an empty MapODataResponse with written metadata content.EntityProviderException - if writing of data (serialization) failspublic ODataResponse writeMetadata(DataServices seriviceMetadata, Map<String,String> predefinedNamespaces) throws EntityProviderException
EntityProvider.EntityProviderInterfacewriteMetadata in interface EntityProvider.EntityProviderInterfacepredefinedNamespaces - type of Map<prefix,namespace> and may be null or an empty MapODataResponse with written metadata content.EntityProviderException - if writing of data (serialization) failspublic Edm readMetadata(InputStream inputStream, boolean validate) throws EntityProviderException
EntityProvider.EntityProviderInterfacereadMetadata in interface EntityProvider.EntityProviderInterfaceinputStream - the given input streamvalidate - has to be true if metadata should be validatedEdmEntityProviderException - if reading of data (de-serialization) failspublic ServiceDocument readServiceDocument(InputStream serviceDocument, String contentType) throws EntityProviderException
EntityProvider.EntityProviderInterfaceinputStream (as InputStream) and provide
ServiceDocument as ServiceDocumentreadServiceDocument in interface EntityProvider.EntityProviderInterfaceserviceDocument - the given input streamcontentType - format of content in the given input streamServiceDocumentEntityProviderException - if reading of data (de-serialization) failspublic List<BatchRequestPart> parseBatchRequest(String contentType, InputStream content, EntityProviderBatchProperties properties) throws BatchException
EntityProvider.EntityProviderInterfaceinputStream (as InputStream) and provide a list of Batch Parts as
BatchPartparseBatchRequest in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input streamcontent - request bodyproperties - additional properties necessary for parsing. Must not be null.BatchPartBatchException - if parsing failspublic ODataResponse writeBatchResponse(List<BatchResponsePart> batchResponseParts) throws BatchException
EntityProvider.EntityProviderInterfaceODataResponse.
Batch Response body matches one-to-one with the corresponding Batch Request bodywriteBatchResponse in interface EntityProvider.EntityProviderInterfacebatchResponseParts - a list of BatchResponsePartODataResponseBatchExceptionpublic InputStream writeBatchRequest(List<BatchPart> batchParts, String boundary)
EntityProvider.EntityProviderInterfacewriteBatchRequest in interface EntityProvider.EntityProviderInterfacebatchParts - a list of BatchPartRequests BatchPartpublic List<BatchSingleResponse> parseBatchResponse(String contentType, InputStream content) throws BatchException
EntityProvider.EntityProviderInterfaceInputStream) and provide a list of single responses as
BatchSingleResponseparseBatchResponse in interface EntityProvider.EntityProviderInterfacecontentType - format of content in the given input stream (incl. boundary parameter)content - response bodyBatchSingleResponseBatchExceptionCopyright © 2020. All rights reserved.