public class RequestScheduleResourceProvider extends AbstractControllerResourceProvider
AbstractResourceProvider.Command<T>
Modifier | Constructor and Description |
---|---|
protected |
RequestScheduleResourceProvider(Set<String> propertyIds,
Map<Resource.Type,String> keyPropertyIds,
AmbariManagementController managementController)
Create a new resource provider for the given management controller.
|
Modifier and Type | Method and Description |
---|---|
RequestStatus |
createResources(Request request)
Create the resources defined by the properties in the given request object.
|
RequestStatus |
deleteResources(Predicate predicate)
Delete the resources selected by the given predicate.
|
protected Set<String> |
getPKPropertyIds()
Get the set of property ids that uniquely identify the resources
of this provider.
|
Set<Resource> |
getResources(Request request,
Predicate predicate)
Get a set of
resources based on the given request and predicate
information. |
RequestStatus |
updateResources(Request request,
Predicate predicate)
Currently unsupported operation.
|
getManagementController, getQueryParameterValue, getResourceProvider, init
addObserver, createResources, getConfigurationRequest, getKeyPropertyIds, getPropertyMaps, getPropertyMaps, getRequestStatus, getRequestStatus, getResources, modifyResources, notifyCreate, notifyDelete, notifyUpdate, updateObservers
checkConfigPropertyIds, checkPropertyIds, containsArguments, getPropertyIds, getRegexGroups, getRegExpKey, getRequestPropertyIds, isPatternKey, setResourceProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPropertyIds
protected static final String REQUEST_SCHEDULE_ID_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_CLUSTER_NAME_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_DESC_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_STATUS_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_LAST_STATUS_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_BATCH_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_SCHEDULE_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_CREATE_USER_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_UPDATE_USER_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_CREATE_TIME_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_UPDATE_TIME_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_BATCH_SEPARATION_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_BATCH_TOLERATION_PROPERTY_ID
protected static final String REQUEST_SCHEDULE_BATCH_REQUESTS_PROPERTY_ID
protected static final String BATCH_REQUEST_TYPE_PROPERTY_ID
protected static final String BATCH_REQUEST_URI_PROPERTY_ID
protected static final String BATCH_REQUEST_ORDER_ID_PROPERTY_ID
protected static final String BATCH_REQUEST_BODY_PROPERTY_ID
protected static final String SCHEDULE_DAYS_OF_MONTH_PROPERTY_ID
protected static final String SCHEDULE_MINUTES_PROPERTY_ID
protected static final String SCHEDULE_HOURS_PROPERTY_ID
protected static final String SCHEDULE_YEAR_PROPERTY_ID
protected static final String SCHEDULE_DAY_OF_WEEK_PROPERTY_ID
protected static final String SCHEDULE_MONTH_PROPERTY_ID
protected static final String SCHEDULE_START_TIME_PROPERTY_ID
protected static final String SCHEDULE_END_TIME_PROPERTY_ID
protected RequestScheduleResourceProvider(Set<String> propertyIds, Map<Resource.Type,String> keyPropertyIds, AmbariManagementController managementController)
propertyIds
- the property idskeyPropertyIds
- the key property idsmanagementController
- the management controllerprotected Set<String> getPKPropertyIds()
AbstractResourceProvider
getPKPropertyIds
in class AbstractResourceProvider
public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException
ResourceProvider
request
- the request object which defines the set of properties
for the resources to be createdSystemException
- an internal system exception occurredUnsupportedPropertyException
- the request contains unsupported property idsResourceAlreadyExistsException
- attempted to create a resource which already existsNoSuchParentResourceException
- a parent resource of the resource to create doesn't existpublic Set<Resource> getResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
ResourceProvider
resources
based on the given request and predicate
information.
Note that it is not required for this resource provider to completely filter
the set of resources based on the given predicate. It may not be possible
since some of the properties involved may be provided by another
provider
. This partial filtering is allowed because
the predicate will always be applied by the calling cluster controller. The
predicate is made available at this level so that some pre-filtering can be done
as an optimization.
A simple implementation of a resource provider may choose to just return all of
the resources of a given type and allow the calling cluster controller to filter
based on the predicate.request
- the request object which defines the desired set of propertiespredicate
- the predicate object which can be used to filter which
resources are returnedSystemException
- an internal system exception occurredUnsupportedPropertyException
- the request contains unsupported property idsNoSuchResourceException
- the requested resource instance doesn't existNoSuchParentResourceException
- a parent resource of the requested resource doesn't existpublic RequestStatus updateResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
request
- 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 updatedSystemException
UnsupportedPropertyException
NoSuchResourceException
NoSuchParentResourceException
public RequestStatus deleteResources(Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
ResourceProvider
predicate
- the predicate object which can be used to filter which
resources are deletedSystemException
- an internal system exception occurredUnsupportedPropertyException
- the request contains unsupported property idsNoSuchResourceException
- the resource instance to be deleted doesn't existNoSuchParentResourceException
- a parent resource of the resource doesn't existCopyright © 2014. All rights reserved.