public class ResourceOperations extends DescribableImpl
CatalogFrameworkImpl
.
This class contains six delegated resource methods and methods to support them. No operations/support methods should be added to this class except in support of CFI resource operations.
Modifier and Type | Class and Description |
---|---|
protected static class |
ResourceOperations.ResourceInfo |
Constructor and Description |
---|
ResourceOperations(FrameworkProperties frameworkProperties,
QueryOperations queryOperations,
OperationsSecuritySupport opsSecuritySupport) |
Modifier and Type | Method and Description |
---|---|
protected Query |
createMetacardIdQuery(String metacardId) |
protected Query |
createPropertyIsEqualToQuery(String propertyName,
String literal) |
protected Query |
createPropertyStartsWithQuery(String propertyName,
String literal) |
ResourceResponse |
getEnterpriseResource(ResourceRequest request,
boolean fanoutEnabled) |
Map<String,Set<String>> |
getEnterpriseResourceOptions(String metacardId,
boolean fanoutEnabled) |
ResourceResponse |
getLocalResource(ResourceRequest request,
boolean fanoutEnabled) |
Map<String,Set<String>> |
getLocalResourceOptions(String metacardId,
boolean fanoutEnabled) |
ResourceResponse |
getResource(ResourceRequest request,
String resourceSiteName,
boolean fanoutEnabled) |
protected ResourceOperations.ResourceInfo |
getResourceInfo(ResourceRequest resourceRequest,
String site,
boolean isEnterprise,
StringBuilder federatedSite,
Map<String,Serializable> requestProperties,
boolean fanoutEnabled)
Retrieves a resource by URI.
|
Map<String,Set<String>> |
getResourceOptions(String metacardId,
String sourceId,
boolean fanoutEnabled) |
protected ResourceResponse |
validateFixGetResourceResponse(ResourceResponse getResourceResponse,
ResourceRequest getResourceRequest)
Validates that the
ResourceResponse has a Resource in it
that was retrieved, and that the original ResourceRequest is included in the response. |
protected void |
validateGetResourceRequest(ResourceRequest getResourceRequest)
Validates that the
ResourceRequest is non-null, a non-null attribute name (which
specifies if the retrieval is being done by product URI or ID), and a non-null attribute value. |
getDescription, getId, getOrganization, getTitle, getVersion, setDescription, setId, setOrganization, setShortname, setTitle, setVersion
public ResourceOperations(FrameworkProperties frameworkProperties, QueryOperations queryOperations, OperationsSecuritySupport opsSecuritySupport)
public ResourceResponse getEnterpriseResource(ResourceRequest request, boolean fanoutEnabled) throws IOException, ResourceNotFoundException, ResourceNotSupportedException
public Map<String,Set<String>> getEnterpriseResourceOptions(String metacardId, boolean fanoutEnabled) throws ResourceNotFoundException
ResourceNotFoundException
public ResourceResponse getLocalResource(ResourceRequest request, boolean fanoutEnabled) throws IOException, ResourceNotFoundException, ResourceNotSupportedException
public Map<String,Set<String>> getLocalResourceOptions(String metacardId, boolean fanoutEnabled) throws ResourceNotFoundException
ResourceNotFoundException
public ResourceResponse getResource(ResourceRequest request, String resourceSiteName, boolean fanoutEnabled) throws IOException, ResourceNotFoundException, ResourceNotSupportedException
public Map<String,Set<String>> getResourceOptions(String metacardId, String sourceId, boolean fanoutEnabled) throws ResourceNotFoundException
ResourceNotFoundException
protected ResourceOperations.ResourceInfo getResourceInfo(ResourceRequest resourceRequest, String site, boolean isEnterprise, StringBuilder federatedSite, Map<String,Serializable> requestProperties, boolean fanoutEnabled) throws ResourceNotSupportedException, ResourceNotFoundException
The ResourceRequest
can specify either the product's URI or ID. If the product ID is
specified, then the matching Metacard
must first be retrieved and the product URI
extracted from this Metacard
.
resourceRequest
- site
- isEnterprise
- federatedSite
- requestProperties
- fanoutEnabled
- ResourceNotSupportedException
ResourceNotFoundException
protected Query createPropertyIsEqualToQuery(String propertyName, String literal)
protected Query createPropertyStartsWithQuery(String propertyName, String literal)
protected ResourceResponse validateFixGetResourceResponse(ResourceResponse getResourceResponse, ResourceRequest getResourceRequest) throws ResourceNotFoundException
ResourceResponse
has a Resource
in it
that was retrieved, and that the original ResourceRequest
is included in the response.getResourceResponse
- the original ResourceResponse
returned from the sourcegetResourceRequest
- the original ResourceRequest
sent to the sourceResourceResponse
ResourceNotFoundException
- if the original ResourceResponse
is null or the
resource could not be foundprotected void validateGetResourceRequest(ResourceRequest getResourceRequest) throws ResourceNotSupportedException
ResourceRequest
is non-null, a non-null attribute name (which
specifies if the retrieval is being done by product URI or ID), and a non-null attribute value.getResourceRequest
- the ResourceRequest
ResourceNotSupportedException
- if the ResourceRequest
is null, or has a null
attribute value or nameThis work is licensed under a Creative Commons Attribution 4.0 International License.