|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.odata4j.producer.edm.MetadataProducer
public class MetadataProducer
A producer for $metadata.
This is somewhat brute-forceish. There is maybe a world where an enhanced InMemoryProducer and the org.odata4j.edm pojos together are sufficient to implement much of this...I'm not sure.
Nested Class Summary | |
---|---|
protected class |
MetadataProducer.Context
|
static class |
MetadataProducer.CustomOptions
|
Field Summary | |
---|---|
static Object |
REMOVE_ANNOTATION_OVERRIDE
Return this from your decorators annotation override method and the annotation will be removed. |
Constructor Summary | |
---|---|
MetadataProducer(ODataProducer dataProducer,
EdmDecorator edmDecorator)
Creates a new MetadataProducer. |
Method Summary | ||
---|---|---|
protected void |
addStructuralTypeProperties(MetadataProducer.Context c,
EdmStructuralType st,
ExpressionEvaluator ev)
|
|
BaseResponse |
callFunction(EdmFunctionImport name,
Map<String,OFunctionParameter> params,
QueryInfo queryInfo)
Calls a function (aka Service Operation). |
|
void |
close()
Releases any resources managed by this producer. |
|
EntityResponse |
createEntity(String entitySetName,
OEntity entity)
Creates a new OData entity. |
|
EntityResponse |
createEntity(String entitySetName,
OEntityKey entityKey,
String navProp,
OEntity entity)
Creates a new OData entity as a reference of an existing entity, implicitly linked to the existing entity by a navigation property. |
|
void |
createLink(OEntityId sourceEntity,
String targetNavProp,
OEntityId targetEntity)
Creates a link between two entities. |
|
void |
deleteEntity(String entitySetName,
OEntityKey entityKey)
Deletes an existing entity. |
|
void |
deleteLink(OEntityId sourceEntity,
String targetNavProp,
OEntityKey targetEntityKey)
Deletes an existing link between two entities. |
|
void |
dump()
|
|
|
findExtension(Class<TExtension> clazz)
Finds an extension instance given an interface, if one exists. |
|
protected void |
findSchema(MetadataProducer.Context c)
|
|
protected void |
findStructuralType(MetadataProducer.Context c,
boolean isEntity,
boolean root)
|
|
protected void |
getComplexTypes(MetadataProducer.Context c,
boolean isRoot)
|
|
EntitiesResponse |
getEntities(String entitySetName,
QueryInfo queryInfo)
Gets all the entities for a given set matching the query information. |
|
CountResponse |
getEntitiesCount(String entitySetName,
QueryInfo queryInfo)
Gets the count of all the entities for a given set matching the query information. |
|
EntityResponse |
getEntity(String entitySetName,
OEntityKey entityKey,
EntityQueryInfo queryInfo)
Obtains a single entity based on its type and key. |
|
protected void |
getEntityTypes(MetadataProducer.Context c,
boolean isRoot)
|
|
EntityIdResponse |
getLinks(OEntityId sourceEntity,
String targetNavProp)
Returns the value of an entity's navigation property as a collection of entity links (or a single link if the association cardinality is 1). |
|
EdmDataServices |
getMetadata()
Get the EDM that defines the queryable metadata, the meta-EDM |
|
MetadataProducer |
getMetadataProducer()
Obtains the ODataProducer implementation that serves the metadata as OData EDM constructs. |
|
EdmDataServices |
getModel()
Get the EDM model that this producer exposes. |
|
BaseResponse |
getNavProperty(String entitySetName,
OEntityKey entityKey,
String navProp,
QueryInfo queryInfo)
Given a specific entity, follow one of its navigation properties, applying constraints as appropriate. |
|
CountResponse |
getNavPropertyCount(String entitySetName,
OEntityKey entityKey,
String navProp,
QueryInfo queryInfo)
Given a specific entity, follow one of its navigation properties, applying constraints as appropriate. |
|
protected void |
getProperties(MetadataProducer.Context c)
|
|
protected OEntity |
getSchema(MetadataProducer.Context c,
EdmSchema schema)
|
|
protected void |
getSchemas(MetadataProducer.Context c)
|
|
void |
mergeEntity(String entitySetName,
OEntity entity)
Modifies an existing entity using merge semantics. |
|
void |
updateEntity(String entitySetName,
OEntity entity)
Modifies an existing entity using update semantics. |
|
void |
updateLink(OEntityId sourceEntity,
String targetNavProp,
OEntityKey oldTargetEntityKey,
OEntityId newTargetEntity)
Replaces an existing link between two entities. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object REMOVE_ANNOTATION_OVERRIDE
Constructor Detail |
---|
public MetadataProducer(ODataProducer dataProducer, EdmDecorator edmDecorator)
dataProducer
- the data producer who defines the $metadata we will exposeedmDecorator
- an optional decorator. the decorator provides
context for evaluating $filter expressions, custom
runtime overrides for annotation values and overrides
for other metadata propertiesMethod Detail |
---|
protected void addStructuralTypeProperties(MetadataProducer.Context c, EdmStructuralType st, ExpressionEvaluator ev)
public BaseResponse callFunction(EdmFunctionImport name, Map<String,OFunctionParameter> params, QueryInfo queryInfo)
ODataProducer
callFunction
in interface ODataProducer
name
- the name of the functionparams
- the parameters to the functionqueryInfo
- additional query parameters to apply to collection-valued results
The return type of <Function> MUST be one of the following: An EDMSimpleType or collection of EDMSimpleTypes. An entity type or collection of entity types. A complex type or collection of complex types. A row type or collection of row types. <ReturnType> can contain a maximum of one <CollectionType> element. <ReturnType> can contain a maximum of one <ReferenceType> element. <ReturnType> can contain a maximum of one <RowType> element. A ref type or collection of ref types.
public void close()
ODataProducer
close
in interface ODataProducer
public EntityResponse createEntity(String entitySetName, OEntity entity)
ODataProducer
createEntity
in interface ODataProducer
entitySetName
- the entity-set nameentity
- the request entity sent from the client
public EntityResponse createEntity(String entitySetName, OEntityKey entityKey, String navProp, OEntity entity)
ODataProducer
createEntity
in interface ODataProducer
entitySetName
- the entity-set name of the existing entityentityKey
- the entity-key of the existing entitynavProp
- the navigation property off of the existing entityentity
- the request entity sent from the client
public void createLink(OEntityId sourceEntity, String targetNavProp, OEntityId targetEntity)
ODataProducer
createLink
in interface ODataProducer
sourceEntity
- an entity with at least one navigation propertytargetNavProp
- the navigation propertytargetEntity
- the link target entitypublic void deleteEntity(String entitySetName, OEntityKey entityKey)
ODataProducer
deleteEntity
in interface ODataProducer
entitySetName
- the entity-set name of the entityentityKey
- the entity-key of the entitypublic void deleteLink(OEntityId sourceEntity, String targetNavProp, OEntityKey targetEntityKey)
ODataProducer
deleteLink
in interface ODataProducer
sourceEntity
- an entity with at least one navigation propertytargetNavProp
- the navigation propertytargetEntityKey
- if the navigation property represents a set, the key identifying the target entity within the set, else n/apublic void dump()
public <TExtension extends OExtension<ODataProducer>> TExtension findExtension(Class<TExtension> clazz)
OExtensible
findExtension
in interface OExtensible<ODataProducer>
TExtension
- type of extensionclazz
- the extension interface
protected void findSchema(MetadataProducer.Context c)
protected void findStructuralType(MetadataProducer.Context c, boolean isEntity, boolean root)
protected void getComplexTypes(MetadataProducer.Context c, boolean isRoot)
public EntitiesResponse getEntities(String entitySetName, QueryInfo queryInfo)
ODataProducer
getEntities
in interface ODataProducer
entitySetName
- the entity-set name for entities to returnqueryInfo
- the additional constraints to apply to the entities
public CountResponse getEntitiesCount(String entitySetName, QueryInfo queryInfo)
ODataProducer
getEntitiesCount
in interface ODataProducer
entitySetName
- the entity-set name for entities whose count is returnedqueryInfo
- the additional constraints to apply to the entities
public EntityResponse getEntity(String entitySetName, OEntityKey entityKey, EntityQueryInfo queryInfo)
ODataProducer
getEntity
in interface ODataProducer
entitySetName
- the entity-set name for entities to returnentityKey
- the unique entity-key of the entity to start withqueryInfo
- the additional constraints applicable to single-entity queries
protected void getEntityTypes(MetadataProducer.Context c, boolean isRoot)
public EntityIdResponse getLinks(OEntityId sourceEntity, String targetNavProp)
ODataProducer
getLinks
in interface ODataProducer
sourceEntity
- an entity with at least one navigation propertytargetNavProp
- the navigation property
public EdmDataServices getMetadata()
getMetadata
in interface ODataProducer
public MetadataProducer getMetadataProducer()
ODataProducer
getMetadataProducer
in interface ODataProducer
public EdmDataServices getModel()
public BaseResponse getNavProperty(String entitySetName, OEntityKey entityKey, String navProp, QueryInfo queryInfo)
ODataProducer
getNavProperty
in interface ODataProducer
entitySetName
- the entity-set of the entity to start withentityKey
- the unique entity-key of the entity to start withnavProp
- the navigation property to followqueryInfo
- additional constraints to apply to the result
public CountResponse getNavPropertyCount(String entitySetName, OEntityKey entityKey, String navProp, QueryInfo queryInfo)
ODataProducer
getNavPropertyCount
in interface ODataProducer
entitySetName
- the entity-set of the entity to start withentityKey
- the unique entity-key of the entity to start withnavProp
- the navigation property to followqueryInfo
- additional constraints to apply to the result
protected void getProperties(MetadataProducer.Context c)
protected OEntity getSchema(MetadataProducer.Context c, EdmSchema schema)
protected void getSchemas(MetadataProducer.Context c)
public void mergeEntity(String entitySetName, OEntity entity)
ODataProducer
mergeEntity
in interface ODataProducer
entitySetName
- the entity-set nameentity
- the entity modifications sent from the clientpublic void updateEntity(String entitySetName, OEntity entity)
ODataProducer
updateEntity
in interface ODataProducer
entitySetName
- the entity-set nameentity
- the entity modifications sent from the clientpublic void updateLink(OEntityId sourceEntity, String targetNavProp, OEntityKey oldTargetEntityKey, OEntityId newTargetEntity)
ODataProducer
updateLink
in interface ODataProducer
sourceEntity
- an entity with at least one navigation propertytargetNavProp
- the navigation propertyoldTargetEntityKey
- if the navigation property represents a set, the key identifying the old target entity within the set, else n/anewTargetEntity
- the new link target entity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |