public class RepositoryVersionResourceProvider extends AbstractAuthorizedResourceProvider
AbstractResourceProvider.Command<T>
LOG, PROPERTIES_ATTRIBUTES_REGEX
Constructor and Description |
---|
RepositoryVersionResourceProvider()
Create a new resource provider.
|
Modifier and Type | Method and Description |
---|---|
protected RequestStatus |
createResourcesAuthorized(Request request)
Create the resources defined by the properties in the given request object if authorization was
granted to the authenticated user.
|
protected RequestStatus |
deleteResourcesAuthorized(Request request,
Predicate predicate)
Delete the resources selected by the given predicate if the authenticated user is authorized
to do so.
|
protected Set<String> |
getPKPropertyIds()
Get the set of property ids that uniquely identify the resources
of this provider.
|
protected Set<Resource> |
getResourcesAuthorized(Request request,
Predicate predicate)
Get a set of
resources based on the given request and predicate
information if the authenticated user is authorized to do so. |
protected ResourceType |
getResourceType(Request request,
Predicate predicate)
Gets the ResourceType that is effected by the relevant request and predicate.
|
protected StackId |
getStackInformationFromUrl(Map<String,Object> propertyMap) |
protected RepositoryVersionEntity |
toRepositoryVersionEntity(Map<String,Object> properties)
Transforms map of json properties to repository version entity.
|
protected RequestStatus |
updateResourcesAuthorized(Request request,
Predicate predicate)
Update the resources selected by the given predicate with the properties from the given request
object if the authenticated user is authorized to do so.
|
protected static void |
validateRepositoryVersion(RepositoryVersionDAO dao,
AmbariMetaInfo metaInfo,
RepositoryVersionEntity repositoryVersion)
Validates newly created repository versions to contain actual information.
|
protected static void |
validateRepositoryVersion(RepositoryVersionDAO dao,
AmbariMetaInfo metaInfo,
RepositoryVersionEntity repositoryVersion,
boolean skipUrlCheck)
Validates newly created repository versions to contain actual information.
|
createResources, deleteResources, getRequiredCreateAuthorizations, getRequiredDeleteAuthorizations, getRequiredGetAuthorizations, getRequiredUpdateAuthorizations, getResourceId, getResources, isAuthorizedToCreateResources, isAuthorizedToDeleteResources, isAuthorizedToGetResources, isAuthorizedToUpdateResources, setRequiredCreateAuthorizations, setRequiredDeleteAuthorizations, setRequiredGetAuthorizations, setRequiredUpdateAuthorizations, updateResources
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 REPOSITORY_VERSION
public static final String REPOSITORY_VERSION_ID_PROPERTY_ID
public static final String REPOSITORY_VERSION_STACK_NAME_PROPERTY_ID
public static final String REPOSITORY_VERSION_STACK_VERSION_PROPERTY_ID
public static final String REPOSITORY_VERSION_REPOSITORY_VERSION_PROPERTY_ID
public static final String REPOSITORY_VERSION_DISPLAY_NAME_PROPERTY_ID
public static final String REPOSITORY_VERSION_HIDDEN_PROPERTY_ID
public static final String REPOSITORY_VERSION_RESOLVED_PROPERTY_ID
public static final String SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID
public static final String SUBRESOURCE_REPOSITORIES_PROPERTY_ID
public static final String REPOSITORY_VERSION_TYPE_PROPERTY_ID
public static final String REPOSITORY_VERSION_RELEASE_VERSION
public static final String REPOSITORY_VERSION_RELEASE_BUILD
public static final String REPOSITORY_VERSION_RELEASE_NOTES
public static final String REPOSITORY_VERSION_RELEASE_COMPATIBLE_WITH
public static final String REPOSITORY_VERSION_AVAILABLE_SERVICES
public static final String REPOSITORY_VERSION_STACK_SERVICES
public static final String REPOSITORY_VERSION_PARENT_ID
public static final String REPOSITORY_VERSION_HAS_CHILDREN
public static final Map<Resource.Type,String> keyPropertyIds
public RepositoryVersionResourceProvider()
protected RequestStatus createResourcesAuthorized(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException
AbstractAuthorizedResourceProvider
AbstractAuthorizedResourceProvider.createResources(Request)
is not overwritten.createResourcesAuthorized
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 existAbstractAuthorizedResourceProvider.createResources(Request)
protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
AbstractAuthorizedResourceProvider
resources
based on the given request and predicate
information if the authenticated user is authorized to do so.
This method must be overwritten if AbstractAuthorizedResourceProvider.getResources(Request, Predicate)
is not overwritten.getResourcesAuthorized
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 existAbstractAuthorizedResourceProvider.getResources(Request, Predicate)
protected RequestStatus updateResourcesAuthorized(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
AbstractAuthorizedResourceProvider
AbstractAuthorizedResourceProvider.updateResources(Request, Predicate)
is not overwritten.updateResourcesAuthorized
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
- 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 updated doesn't existNoSuchParentResourceException
- a parent resource of the resource doesn't existAbstractAuthorizedResourceProvider.updateResources(Request, Predicate)
protected RequestStatus deleteResourcesAuthorized(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
AbstractAuthorizedResourceProvider
ResourceProvider.deleteResources(Request, Predicate)
is not overwritten.deleteResourcesAuthorized
in class AbstractAuthorizedResourceProvider
predicate
- 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 existResourceProvider.deleteResources(Request, Predicate)
protected Set<String> getPKPropertyIds()
AbstractResourceProvider
getPKPropertyIds
in class AbstractResourceProvider
protected static void validateRepositoryVersion(RepositoryVersionDAO dao, AmbariMetaInfo metaInfo, RepositoryVersionEntity repositoryVersion) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
- exception with error messageprotected static void validateRepositoryVersion(RepositoryVersionDAO dao, AmbariMetaInfo metaInfo, RepositoryVersionEntity repositoryVersion, boolean skipUrlCheck) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
- exception with error messageprotected RepositoryVersionEntity toRepositoryVersionEntity(Map<String,Object> properties) throws org.apache.ambari.server.AmbariException
properties
- json maporg.apache.ambari.server.AmbariException
- if some properties are missing or json has incorrect structureprotected StackId getStackInformationFromUrl(Map<String,Object> propertyMap)
protected ResourceType getResourceType(Request request, Predicate predicate)
AbstractAuthorizedResourceProvider
getResourceType
in class AbstractAuthorizedResourceProvider
request
- the request object which defines the desired set of propertiespredicate
- the predicate object which can be used to indicate the filterCopyright © 2022 Apache Software Foundation. All rights reserved.