Package org.apache.olingo.server.api.uri
Interface UriHelper
public interface UriHelper
Used for URI-related tasks.
-
Method Summary
Modifier and TypeMethodDescriptionbuildCanonicalURL(EdmEntitySet edmEntitySet, Entity entity) Builds the relative canonical URL for the given entity in the given entity set.Builds the key-predicate part of aContextURL.buildContextURLSelectList(EdmStructuredType type, ExpandOption expand, SelectOption select) Builds the select-list part of aContextURL.buildKeyPredicate(EdmEntityType edmEntityType, Entity entity) Builds the key predicate for the given entity.parseEntityId(Edm edm, String entityId, String rawServiceRoot) Parses a given entity-id.
-
Method Details
-
buildContextURLSelectList
String buildContextURLSelectList(EdmStructuredType type, ExpandOption expand, SelectOption select) throws SerializerException Builds the select-list part of aContextURL.- Parameters:
type- theEdmStructuredTypeexpand- the $expand optionselect- the $select option- Returns:
- a String with the select list
- Throws:
SerializerException
-
buildContextURLKeyPredicate
Builds the key-predicate part of aContextURL.- Parameters:
keys- the keys as a list ofUriParameterinstances- Returns:
- a String with the key predicate
- Throws:
SerializerException
-
buildCanonicalURL
Builds the relative canonical URL for the given entity in the given entity set.- Parameters:
edmEntitySet- the entity setentity- the entity data- Returns:
- the relative canonical URL
- Throws:
SerializerException
-
buildKeyPredicate
Builds the key predicate for the given entity.- Parameters:
edmEntityType- the entity type of the entityentity- the entity data- Returns:
- the key predicate
- Throws:
SerializerException
-
parseEntityId
UriResourceEntitySet parseEntityId(Edm edm, String entityId, String rawServiceRoot) throws DeserializerException Parses a given entity-id. Provides the entity set and key predicates. A canonical entiy-id to an entity must follow the pattern[<service root>][<entityContainer>.]<entitySet>(<key>), i.e., it must be a relative or absolute URI consisting of an entity set (qualified with an entity-container name if not in the default entity container) and a syntactically valid key that identifies a single entity; example:http://example.server.com/service.svc/Employees('42').- Parameters:
edm- the edm the entity belongs toentityId- URI of the entity-idrawServiceRoot- the root URI of the service- Returns:
UriResourceEntitySet- contains the entity set and the key predicates- Throws:
DeserializerException- in case the entity-id is malformed
-