public class ResourceLookupDictionary extends Object implements ResourceLocator
COLLECTION_RESOURCE, ENTITY_ID, PROPERTY, RELATIONSHIP_ID, RELATIONSHIP_RESOURCE
Constructor and Description |
---|
ResourceLookupDictionary() |
Modifier and Type | Method and Description |
---|---|
ResourceDictionary |
getDictionary() |
Map<String,ResourceWithMetadata> |
locateEmbeddedResources(Api api,
Map<String,String> embeddedKeys)
For a given Map finds any resources that should be embedded inside a class.
|
ResourceWithMetadata |
locateEntityResource(Api api,
String entityResource,
org.springframework.http.HttpMethod httpMethod)
Finds an Entity Resource and returns it in ResourceWithMetadata wrapper.
|
ResourceWithMetadata |
locateRelationPropertyResource(Api api,
String entityResource,
String relationResource,
String property,
org.springframework.http.HttpMethod httpMethod)
Finds a property or action on a Relationship Resource and returns it in ResourceWithMetadata wrapper.
|
Map<String,ResourceWithMetadata> |
locateRelationResource(Api api,
String entityKey,
Collection<String> relationshipKeys,
org.springframework.http.HttpMethod httpMethod)
Finds multiple relationship Resources and returns them as a Map of ResourceWithMetadata.
|
ResourceWithMetadata |
locateRelationResource(Api api,
String entityResource,
String relationResource,
org.springframework.http.HttpMethod httpMethod)
Finds an Relationship Resource and returns it in ResourceWithMetadata wrapper.
|
ResourceWithMetadata |
locateResource(Api api,
Map<String,String> templateVars,
org.springframework.http.HttpMethod httpMethod)
Locates a resource by URI path and wraps it in an invoker
This will probably get refactored later when we work out what we
are doing with the discoverability model.
|
void |
setDictionary(ResourceDictionary dictionary) |
public ResourceWithMetadata locateEntityResource(Api api, String entityResource, org.springframework.http.HttpMethod httpMethod) throws NotFoundException, UnsupportedResourceOperationException
ResourceLocator
locateEntityResource
in interface ResourceLocator
api
- - The API being used.entityResource
- - The entity resource name - this is the "name" property on the @EntityResource annotation.httpMethod
- - A permitted HttpMethodUnsupportedResourceOperationException
- - throw if the resource does not support the specified HttpMethod.NotFoundException
public ResourceWithMetadata locateRelationPropertyResource(Api api, String entityResource, String relationResource, String property, org.springframework.http.HttpMethod httpMethod) throws NotFoundException, UnsupportedResourceOperationException
ResourceLocator
locateRelationPropertyResource
in interface ResourceLocator
api
- - The API being used.property
- - The property resource name - can be either an action or a @BinaryPropertyhttpMethod
- - A permitted HttpMethodUnsupportedResourceOperationException
- - throw if the resource does not support the specified HttpMethod.NotFoundException
public ResourceWithMetadata locateRelationResource(Api api, String entityResource, String relationResource, org.springframework.http.HttpMethod httpMethod) throws NotFoundException, UnsupportedResourceOperationException
ResourceLocator
locateRelationResource
in interface ResourceLocator
api
- - The API being used.entityResource
- - The entity resource name - this is the "entityResourceName" property on the @RelationshipResource annotation.relationResource
- - The relationship resource name - this is the "name" property on the @RelationshipResource annotation.httpMethod
- - A permitted HttpMethodUnsupportedResourceOperationException
- - throw if the resource does not support the specified HttpMethod.NotFoundException
public ResourceWithMetadata locateResource(Api api, Map<String,String> templateVars, org.springframework.http.HttpMethod httpMethod)
locateResource
in interface ResourceLocator
api
- - The API being used.templateVars
- A map of variables representing the requesthttpMethod
- - A permitted HttpMethodpublic Map<String,ResourceWithMetadata> locateEmbeddedResources(Api api, Map<String,String> embeddedKeys)
ResourceLocator
locateEmbeddedResources
in interface ResourceLocator
api
- - The API being used.embeddedKeys
- - Likely to be the result of a call to ResourceInspector.findEmbeddedResources()public Map<String,ResourceWithMetadata> locateRelationResource(Api api, String entityKey, Collection<String> relationshipKeys, org.springframework.http.HttpMethod httpMethod)
ResourceLocator
locateRelationResource
in interface ResourceLocator
api
- - The API being used.entityKey
- - this is the "entityResourceName" property on the @RelationshipResource annotation.relationshipKeys
- - The relationship resource names - this is the "name" property on the @RelationshipResource annotation.httpMethod
- - A permitted HttpMethodpublic void setDictionary(ResourceDictionary dictionary)
dictionary
- the dictionary to setpublic ResourceDictionary getDictionary()
Copyright © 2005–2017 Alfresco Software. All rights reserved.