public class OlingoUtils extends Object
| Constructor and Description |
|---|
OlingoUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Optional<org.apache.olingo.commons.api.edm.EdmEntitySet> |
findEntitySetForEntity(org.apache.olingo.commons.api.edm.EdmEntityType entity,
org.apache.olingo.commons.api.edm.Edm edm) |
static String |
formatODataValue(org.apache.olingo.commons.api.edm.EdmType type,
Object o,
boolean isCollection)
Format the property value as a primitiveLiteral or an arrayOrObject literal.
|
static APIKitODataResponse |
getAPIKitResponse(org.apache.olingo.server.api.ODataResponse response)
Casts Olingo's
ODataResponse to routing APIKitODataResponse. |
static org.mule.runtime.api.util.MultiMap<String,String> |
getCustomQueryOptions(List<org.apache.olingo.server.api.uri.queryoption.CustomQueryOption> customQueryOptions)
Gets a map of custom query options name and values from Olingo's
CustomQueryOption. |
static Optional<org.apache.olingo.commons.api.edm.EdmEntitySet> |
getEntitySet(org.apache.olingo.server.api.uri.UriInfo uriInfo)
Given the URI details, it looks for the requested entity set.
|
static Optional<String> |
getEntitySetName(org.apache.olingo.server.api.uri.UriInfo uriInfo)
Given the URI details, it looks for the requested entity set name.
|
static List<String> |
getEntityTypeFields(org.apache.olingo.commons.api.edm.EdmEntityType entityType)
Given an entity type, gets the list of all its properties names.
|
static Map<String,String> |
getEntityTypeKeysFromUriParameters(List<org.apache.olingo.server.api.uri.UriResource> uriResources)
Given the URI resource segments, it returns a map of all the entity type keys and values provided.
|
static Optional<String> |
getEntityTypeName(org.apache.olingo.commons.api.edm.EdmEntityType entityType)
Gets the entity type's name if defined or an empty string otherwise.
|
static Optional<org.apache.olingo.commons.api.edm.EdmEntitySet> |
getReturnEntitySet(org.apache.olingo.server.api.uri.UriInfo uriInfo,
org.apache.olingo.commons.api.edm.Edm edm)
Given the URI Info for a request tries to map the result to an
EdmEntitySet. |
static Optional<org.apache.olingo.commons.api.edm.EdmEntityType> |
getReturnEntityType(ConfigurationRoutingKey routingKey,
org.apache.olingo.commons.api.edm.Edm edm) |
static Optional<org.apache.olingo.commons.api.edm.EdmEntityType> |
getReturnEntityType(org.apache.olingo.server.api.uri.UriInfo uriInfo)
Given the URI details, it looks for the requested entity type.
|
static RoutingKey<InputStream,ListenerRequestAttributes,SourceConfiguration> |
getRoutingKey(org.apache.olingo.server.api.ODataRequest request,
org.apache.olingo.server.api.uri.UriInfo uriInfo,
SourceKind kind)
Builds a
ConfigurationRoutingKey based on the request method and the URI segment details. |
static Map<String,String> |
getSystemQueryOptions(List<org.apache.olingo.server.api.uri.queryoption.SystemQueryOption> systemQueryOptionOptions)
Gets a map of system query options name and values from Olingo's
SystemQueryOption. |
static org.apache.olingo.server.api.uri.UriResource |
getUriLastResourcePart(org.apache.olingo.server.api.uri.UriInfo uriInfo)
Given the URI details, it returns the last URI resource.
|
static String |
getUriPath(List<org.apache.olingo.server.api.uri.UriResource> parts)
Builds a URI path out of the URI segments that are entity set or navigation types.
|
static org.mule.runtime.extension.api.runtime.operation.Result<InputStream,RouteOutputAttributes> |
toResult(org.apache.olingo.server.api.ODataResponse response)
Converts routing response to a runtime operation result.
|
public static APIKitODataResponse getAPIKitResponse(org.apache.olingo.server.api.ODataResponse response)
ODataResponse to routing APIKitODataResponse.response - public static org.mule.runtime.extension.api.runtime.operation.Result<InputStream,RouteOutputAttributes> toResult(org.apache.olingo.server.api.ODataResponse response)
response - public static Optional<org.apache.olingo.commons.api.edm.EdmEntityType> getReturnEntityType(org.apache.olingo.server.api.uri.UriInfo uriInfo)
uriInfo - public static Optional<org.apache.olingo.commons.api.edm.EdmEntitySet> getReturnEntitySet(org.apache.olingo.server.api.uri.UriInfo uriInfo, org.apache.olingo.commons.api.edm.Edm edm)
EdmEntitySet.uriInfo - The URI information for the request.edm - The EDM of the service.EdmEntitySet of the requested entity wrapped on an Optional (if found). An empty Optional otherwise.public static Optional<org.apache.olingo.commons.api.edm.EdmEntitySet> findEntitySetForEntity(org.apache.olingo.commons.api.edm.EdmEntityType entity, org.apache.olingo.commons.api.edm.Edm edm)
public static org.apache.olingo.server.api.uri.UriResource getUriLastResourcePart(org.apache.olingo.server.api.uri.UriInfo uriInfo)
uriInfo - public static Optional<String> getEntitySetName(org.apache.olingo.server.api.uri.UriInfo uriInfo)
uriInfo - public static Optional<org.apache.olingo.commons.api.edm.EdmEntitySet> getEntitySet(org.apache.olingo.server.api.uri.UriInfo uriInfo)
uriInfo - public static Map<String,String> getEntityTypeKeysFromUriParameters(List<org.apache.olingo.server.api.uri.UriResource> uriResources)
uriResources - public static List<String> getEntityTypeFields(org.apache.olingo.commons.api.edm.EdmEntityType entityType)
entityType - public static String getUriPath(List<org.apache.olingo.server.api.uri.UriResource> parts)
parts - public static RoutingKey<InputStream,ListenerRequestAttributes,SourceConfiguration> getRoutingKey(org.apache.olingo.server.api.ODataRequest request, org.apache.olingo.server.api.uri.UriInfo uriInfo, SourceKind kind)
ConfigurationRoutingKey based on the request method and the URI segment details.request - Request to be routeduriInfo - UriInfo for that requestkind - Kind of request endpoint (single entity, entity collection, etc)public static Map<String,String> getSystemQueryOptions(List<org.apache.olingo.server.api.uri.queryoption.SystemQueryOption> systemQueryOptionOptions)
SystemQueryOption.
The initial dollar sign in option names is removed.
systemQueryOptionOptions - list of Olingo's SystemQueryOptionpublic static org.mule.runtime.api.util.MultiMap<String,String> getCustomQueryOptions(List<org.apache.olingo.server.api.uri.queryoption.CustomQueryOption> customQueryOptions)
CustomQueryOption.customQueryOptions - list of CustomQueryOptionpublic static Optional<String> getEntityTypeName(org.apache.olingo.commons.api.edm.EdmEntityType entityType)
entityType - EDM entity typepublic static Optional<org.apache.olingo.commons.api.edm.EdmEntityType> getReturnEntityType(ConfigurationRoutingKey routingKey, org.apache.olingo.commons.api.edm.Edm edm)
public static String formatODataValue(org.apache.olingo.commons.api.edm.EdmType type, Object o, boolean isCollection)
type - The desired type to format the value too - The value to format.IllegalArgumentException - if the (type, value) combination passed as argument is unsupported.Copyright © 2024 MuleSoft, Inc.. All rights reserved.