public class ClusterControllerImpl extends Object implements ClusterController
Modifier and Type | Class and Description |
---|---|
protected class |
ClusterControllerImpl.ResourceComparator |
Constructor and Description |
---|
ClusterControllerImpl(ProviderModule providerModule) |
Modifier and Type | Method and Description |
---|---|
RequestStatus |
createResources(Resource.Type type,
Request request)
Create the resources defined by the properties in the given request object.
|
RequestStatus |
deleteResources(Resource.Type type,
Request request,
Predicate predicate)
Delete the resources selected by the given predicate.
|
ResourceProvider |
ensureResourceProvider(Resource.Type type)
Provides a non-wrapped resource provider..
|
Predicate |
getAmendedPredicate(Resource.Type type,
Predicate predicate)
Gets the amended predicate for a resource.
|
protected Comparator<Resource> |
getComparator()
Get the associated resource comparator.
|
Iterable<Resource> |
getIterable(Resource.Type type,
QueryResponse queryResponse,
Request request,
Predicate predicate,
PageRequest pageRequest,
SortRequest sortRequest)
Get an iterable set of resources from the given set of resources filtered by the
given request and predicate objects.
|
PageResponse |
getPage(Resource.Type type,
QueryResponse queryResponse,
Request request,
Predicate predicate,
PageRequest pageRequest,
SortRequest sortRequest)
Get a page of resources from the given set filtered by the given request,
predicate objects and page request.
|
protected Iterable<Resource> |
getResourceIterable(Resource.Type type,
Request request,
Predicate predicate)
Get an iterable set of resources filtered by the given request and
predicate objects.
|
QueryResponse |
getResources(Resource.Type type,
Request request,
Predicate predicate)
Get the resources of the given type filtered by the given request and
predicate objects.
|
protected PageResponse |
getResources(Resource.Type type,
Request request,
Predicate predicate,
PageRequest pageRequest,
SortRequest sortRequest)
Get a page of resources filtered by the given request, predicate objects and
page request.
|
Schema |
getSchema(Resource.Type type)
Get the
schema for the given resource type. |
Set<Resource> |
populateResources(Resource.Type type,
Set<Resource> resources,
Request request,
Predicate predicate)
Populate the given resources from the associated property providers.
|
RequestStatus |
updateResources(Resource.Type type,
Request request,
Predicate predicate)
Update the resources selected by the given predicate with the properties
from the given request object.
|
public ClusterControllerImpl(ProviderModule providerModule)
public Predicate getAmendedPredicate(Resource.Type type, Predicate predicate)
ClusterController
getAmendedPredicate
in interface ClusterController
type
- the type of the resourcepredicate
- the predicate object to use for filteringpublic QueryResponse getResources(Resource.Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException, SystemException
ClusterController
getResources
in interface ClusterController
type
- the type of the requested resourcesrequest
- the request object which defines the desired set of propertiespredicate
- the predicate object which filters which resources are returnedUnsupportedPropertyException
- thrown if the request or predicate contain
unsupported property idsNoSuchResourceException
- no matching resource(s) foundNoSuchParentResourceException
- a specified parent resource doesn't existSystemException
- an internal exception occurredpublic Set<Resource> populateResources(Resource.Type type, Set<Resource> resources, Request request, Predicate predicate) throws SystemException
ClusterController
populateResources
in interface ClusterController
type
- the resource typeresources
- the resources to be populatedrequest
- the requestpredicate
- the predicateSystemException
- if unable to populate the resourcespublic Iterable<Resource> getIterable(Resource.Type type, QueryResponse queryResponse, Request request, Predicate predicate, PageRequest pageRequest, SortRequest sortRequest) throws NoSuchParentResourceException, UnsupportedPropertyException, NoSuchResourceException, SystemException
ClusterController
getIterable
in interface ClusterController
type
- type of resourcesqueryResponse
- the response from the resource queryrequest
- the requestpredicate
- the predicate object which filters which resources are returnedpageRequest
- the page request for a paginated responsesortRequest
- the sortRequest object which defines if the resources need to be sortedNoSuchParentResourceException
- a specified parent resource doesn't existUnsupportedPropertyException
- thrown if the request or predicate contain
unsupported property idsNoSuchResourceException
- no matching resource(s) foundSystemException
- an internal exception occurredpublic PageResponse getPage(Resource.Type type, QueryResponse queryResponse, Request request, Predicate predicate, PageRequest pageRequest, SortRequest sortRequest) throws UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException
ClusterController
getPage
in interface ClusterController
type
- type of resourcesqueryResponse
- the response from the resource queryrequest
- the requestpredicate
- the predicate object which filters which resources are returnedpageRequest
- the page request for a paginated responseUnsupportedPropertyException
- thrown if the request or predicate contain
unsupported property idsSystemException
- an internal exception occurredNoSuchResourceException
- no matching resource(s) foundNoSuchParentResourceException
- a specified parent resource doesn't existpublic Schema getSchema(Resource.Type type)
ClusterController
schema
for the given resource type. The schema
for a given resource type describes the properties and categories provided
by that type of resource.getSchema
in interface ClusterController
getSchema
in interface SchemaFactory
type
- the resource typepublic RequestStatus createResources(Resource.Type type, Request request) throws UnsupportedPropertyException, SystemException, ResourceAlreadyExistsException, NoSuchParentResourceException
ClusterController
createResources
in interface ClusterController
type
- the type of the resourcesrequest
- the request object which defines the set of properties
for the resources to be createdUnsupportedPropertyException
- thrown if the request contains
unsupported property idsSystemException
- an internal exception occurredResourceAlreadyExistsException
- attempted to create a resource that already existsNoSuchParentResourceException
- a specified parent resource doesn't existpublic RequestStatus updateResources(Resource.Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException
ClusterController
updateResources
in interface ClusterController
type
- the type of the resourcesrequest
- the request object which defines the set of properties
for the resources to be updatedpredicate
- the predicate object which can be used to filter which
resources are updatedUnsupportedPropertyException
- thrown if the request or predicate
contain unsupported property idsSystemException
- an internal exception occurredNoSuchResourceException
- no matching resource(s) foundNoSuchParentResourceException
- a specified parent resource doesn't existpublic RequestStatus deleteResources(Resource.Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException
ClusterController
deleteResources
in interface ClusterController
type
- the type of the resourcesrequest
- the request object which defines the set of properties
for the resources to be deletedpredicate
- the predicate object which can be used to filter which
resources are deletedUnsupportedPropertyException
- thrown if the predicate contains
unsupported property idsSystemException
- an internal exception occurredNoSuchResourceException
- no matching resource(s) foundNoSuchParentResourceException
- a specified parent resource doesn't existpublic ResourceProvider ensureResourceProvider(Resource.Type type)
ensureResourceProvider
in interface ClusterController
type
- type of resource provider to obtainprotected Iterable<Resource> getResourceIterable(Resource.Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchParentResourceException, NoSuchResourceException
type
- type of resourcesrequest
- the requestpredicate
- the predicate object which filters which resources are returnedUnsupportedPropertyException
- thrown if the request or predicate contain
unsupported property idsSystemException
- an internal exception occurredNoSuchResourceException
- no matching resource(s) foundNoSuchParentResourceException
- a specified parent resource doesn't existprotected PageResponse getResources(Resource.Type type, Request request, Predicate predicate, PageRequest pageRequest, SortRequest sortRequest) throws UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException
type
- type of resourcesrequest
- the requestpredicate
- the predicate object which filters which resources are returnedpageRequest
- the page request for a paginated responseUnsupportedPropertyException
- thrown if the request or predicate contain
unsupported property idsSystemException
- an internal exception occurredNoSuchResourceException
- no matching resource(s) foundNoSuchParentResourceException
- a specified parent resource doesn't existprotected Comparator<Resource> getComparator()
Copyright © 2022 Apache Software Foundation. All rights reserved.