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,
Predicate predicate)
Delete the resources selected by the given predicate.
|
ResourceProvider |
ensureResourceProvider(Resource.Type type)
Get the resource provider for the given type, creating it if required.
|
protected Comparator<Resource> |
getComparator()
Get the associated resource comparator.
|
Iterable<Resource> |
getIterable(Resource.Type type,
Set<Resource> providerResources,
Request request,
Predicate predicate)
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,
Set<Resource> providerResources,
Request request,
Predicate predicate,
PageRequest pageRequest)
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.
|
Set<Resource> |
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)
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 Set<Resource> getResources(Resource.Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException, SystemException
ClusterControllergetResources in interface ClusterControllertype - 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
ClusterControllerpopulateResources in interface ClusterControllertype - the resource typeresources - the resources to be populatedrequest - the requestpredicate - the predicateSystemException - if unable to populate the resourcespublic Iterable<Resource> getIterable(Resource.Type type, Set<Resource> providerResources, Request request, Predicate predicate) throws NoSuchParentResourceException, UnsupportedPropertyException, NoSuchResourceException, SystemException
ClusterControllergetIterable in interface ClusterControllertype - type of resourcesproviderResources - set of populated Resourcesrequest - the requestpredicate - the predicate object which filters which resources are returnedNoSuchParentResourceException - 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, Set<Resource> providerResources, Request request, Predicate predicate, PageRequest pageRequest) throws UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException
ClusterControllergetPage in interface ClusterControllertype - type of resourcesproviderResources - set of populated 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 existpublic Schema getSchema(Resource.Type type)
ClusterControllerschema 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 ClusterControllergetSchema in interface SchemaFactorytype - the resource typepublic RequestStatus createResources(Resource.Type type, Request request) throws UnsupportedPropertyException, SystemException, ResourceAlreadyExistsException, NoSuchParentResourceException
ClusterControllercreateResources in interface ClusterControllertype - 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
ClusterControllerupdateResources in interface ClusterControllertype - 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, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException
ClusterControllerdeleteResources in interface ClusterControllertype - the type of the resourcespredicate - 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)
type - the resource typeprotected 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) 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 © 2016. All rights reserved.