public class RequestScheduleResourceProvider extends AbstractControllerResourceProvider
AbstractResourceProvider.Command<T>
PROPERTIES_ATTRIBUTES_REGEX
Modifier | Constructor and Description |
---|---|
protected |
RequestScheduleResourceProvider(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(Request request,
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.
|
getClusterId, getClusterResourceId, getClusterResourceId, getManagementController, getResourceProvider, getResourceProvider, init
createResourcesAuthorized, deleteResourcesAuthorized, getRequiredCreateAuthorizations, getRequiredDeleteAuthorizations, getRequiredGetAuthorizations, getRequiredUpdateAuthorizations, getResourceId, getResourcesAuthorized, getResourceType, isAuthorizedToCreateResources, isAuthorizedToDeleteResources, isAuthorizedToGetResources, isAuthorizedToUpdateResources, setRequiredCreateAuthorizations, setRequiredDeleteAuthorizations, setRequiredGetAuthorizations, setRequiredUpdateAuthorizations, updateResourcesAuthorized
addObserver, createResources, getConfigurationRequests, getKeyPropertyIds, getPropertyMaps, getPropertyMaps, getQueryParameterValue, getRequestStatus, getRequestStatus, getRequestStatus, getResources, modifyResources, notifyCreate, notifyDelete, notifyUpdate, parseProperties, updateObservers
checkCategory, checkConfigPropertyIds, checkPropertyIds, containsArguments, getCategoryIds, getPropertyIds, getRegexEntry, getRegexGroups, getRequestPropertyIds, isPatternKey, isPropertyCategoryRequested, isPropertyEntryRequested, isPropertyRequested, setResourceProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPropertyIds
public static final String REQUEST_SCHEDULE
public static final String BATCH_SETTINGS
public static final String BATCH_REQUESTS
public static final String ID_PROPERTY_ID
public static final String CLUSTER_NAME_PROPERTY_ID
public static final String DESCRIPTION_PROPERTY_ID
public static final String STATUS_PROPERTY_ID
public static final String LAST_EXECUTION_STATUS_PROPERTY_ID
public static final String BATCH_PROPERTY_ID
public static final String SCHEDULE_PROPERTY_ID
public static final String CREATE_USER_PROPERTY_ID
public static final String AUTHENTICATED_USER_PROPERTY_ID
public static final String UPDATE_USER_PROPERTY_ID
public static final String CREATE_TIME_PROPERTY_ID
public static final String UPDATE_TIME_PROPERTY_ID
public static final String BATCH_SEPARATION_IN_SECONDS_PROPERTY_ID
public static final String TASK_FAILURE_TOLERANCE_PROPERTY_ID
public static final String TASK_FAILURE_TOLERANCE_PER_BATCH_PROPERTY_ID
public static final String TASK_FAILURE_TOLERANCE_LIMIT_PROPERTY_ID
public static final String REQUESTS_PROPERTY_ID
public static final String PAUSE_AFTER_FIRST_BATCH_PROPERTY_ID
public static final String TYPE_PROPERTY_ID
public static final String URI_PROPERTY_ID
public static final String ORDER_ID_PROPERTY_ID
public static final String REQUEST_TYPE_PROPERTY_ID
public static final String REQUEST_URI_PROPERTY_ID
public static final String REQUEST_BODY_PROPERTY_ID
public static final String REQUEST_STATUS_PROPERTY_ID
public static final String RETURN_CODE_PROPERTY_ID
public static final String RESPONSE_MESSAGE_PROPERTY_ID
public static final String DAYS_OF_MONTH_PROPERTY_ID
public static final String MINUTES_PROPERTY_ID
public static final String HOURS_PROPERTY_ID
public static final String YEAR_PROPERTY_ID
public static final String DAY_OF_WEEK_PROPERTY_ID
public static final String MONTH_PROPERTY_ID
public static final String START_TIME_PROPERTY_ID
public static final String START_TIME_SNAKE_CASE_PROPERTY_ID
public static final String END_TIME_PROPERTY_ID
public static final String END_TIME_SNAKE_CASE_PROPERTY_ID
public static final String ID
public static final String CLUSTER_NAME
public static final String DESCRIPTION
public static final String STATUS
public static final String LAST_EXECUTION_STATUS
public static final String BATCH
public static final String SCHEDULE
public static final String CREATE_USER
public static final String AUTHENTICATED_USER
public static final String UPDATE_USER
public static final String CREATE_TIME
public static final String UPDATE_TIME
public static final String BATCH_SEPARATION_IN_SECONDS
public static final String TASK_FAILURE_TOLERANCE
public static final String TASK_FAILURE_TOLERANCE_PER_BATCH
public static final String REQUESTS
public static final String PAUSE_AFTER_FIRST_BATCH
public static final String TYPE
public static final String URI
public static final String ORDER_ID
public static final String BODY
public static final String DAYS_OF_MONTH
public static final String MINUTES
public static final String HOURS
public static final String YEAR
public static final String DAY_OF_WEEK
public static final String MONTH
public static final String START_TIME
public static final String END_TIME
protected RequestScheduleResourceProvider(AmbariManagementController managementController)
managementController
- the management controllerprotected Set<String> getPKPropertyIds()
AbstractResourceProvider
getPKPropertyIds
in class AbstractResourceProvider
public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException
AbstractAuthorizedResourceProvider
createResources
in interface ResourceProvider
createResources
in class AbstractAuthorizedResourceProvider
request
- the request object which defines the set of properties
for the resources to be createdSystemException
- an internal system exception occurredAuthorizationException
- if the authenticated user is not authorized to perform this operationUnsupportedPropertyException
- 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
AbstractAuthorizedResourceProvider
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.
This implementation attempts to authorize the authenticated user before performing the requested
operation. If authorization fails, an AuthorizationException will be thrown.
This method may be overwritten by implementing classes to avoid performing authorization checks
to get resources.getResources
in interface ResourceProvider
getResources
in class AbstractAuthorizedResourceProvider
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 occurredAuthorizationException
- if the authenticated user is not authorized to perform this operationUnsupportedPropertyException
- 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
updateResources
in interface ResourceProvider
updateResources
in class AbstractAuthorizedResourceProvider
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
AuthorizationException
- if the authenticated user is not authorized to perform this operationpublic RequestStatus deleteResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
AbstractAuthorizedResourceProvider
deleteResources
in interface ResourceProvider
deleteResources
in class AbstractAuthorizedResourceProvider
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 deletedSystemException
- an internal system exception occurredAuthorizationException
- if the authenticated user is not authorized to perform this operationUnsupportedPropertyException
- the request contains unsupported property idsNoSuchResourceException
- the resource instance to be deleted doesn't existNoSuchParentResourceException
- a parent resource of the resource doesn't existCopyright © 2022 Apache Software Foundation. All rights reserved.