public interface RASResourceManager extends EntityManager
Modifier and Type | Method and Description |
---|---|
RASResourceEntry |
createRASResource(java.lang.String name, java.lang.String displayName, java.lang.String description, RASResourceTypeEntry rasResType, java.lang.String sqlPredicate, java.util.Set<RASResourceEntry.RASSqlParameterDefinition> parameterDefinitions)
Create a RAS resource
|
void |
deleteRASResource(java.lang.String rasResourceTypeName, java.lang.String name, boolean cascade)
Deletes the resource.
|
RASResourceEntry |
getRASResource(java.lang.String resourceTypeName, java.lang.String name)
Get the ras resource given the name and the type of the resource.
|
java.util.List<RASResourceEntry> |
getRASResources(RASResourceSearchQuery query)
Get RAS resource objects satisfying the query.
|
void |
modifyRASResource(RASResourceEntry rasResourceEntry)
Persists the revised RASResourceEntry object.
|
resolveReference
java.util.List<RASResourceEntry> getRASResources(RASResourceSearchQuery query) throws InvalidArgumentException, PolicyStoreException
Note: RASResource query across different RAS resource type is not allowed. 1.For the simple query(with no child queries),the query's search property must be set asRASResourceSerachQuery.SEARCH_PROPERTY.RESOURCE_TYPE
orRASResourceSearchQuery.SEARCH_PROPERTY.ALL
2.For the complex query with a list of child queries,if the logic relation among child queries is 'AND' and not a negation query, then you must specify one and only one of child queries as follows 1)search property must be set asRASResourceSerachQuery.SEARCH_PROPERTY.RESOURCE_TYPE
2)SearchComparatorType must be set asComparatorType.EQUALITY
3)MATCHER must be set asMATCHER.EXACT
4)negation must be set as false example Consider the following example to search RAS Resources by a specific RAS resource type and display name. List<RASResourceSearchQuery> childQueries = new ArrayList<RASResourceSearchQuery>(); childQueries.add(new RASResourceSearchQuery( RASResourceSearchQuery.SEARCH_PROPERTY.RESOURCE_TYPE, false, ComparatorType.EQUALITY, "The Resource Type Name", BaseSearchQuery.MATCHER.EXACT)); childQueries.add(new RASResourceSearchQuery( RASResourceSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME, false, ComparatorType.EQUALITY, "The Display Name", BaseSearchQuery.MATCHER.EXACT)); RASResourceSearchQuery complexQuery = new RASResourceSearchQuery(childQueries, false, false);
query
- search criteria, please refer to RASResourceSearchQuery
for details.InvalidArgumentException
- the exception is reserved for future use.PolicyStoreException
- if any internal status error, throws out PolicyStoreException.RASResourceEntry createRASResource(java.lang.String name, java.lang.String displayName, java.lang.String description, RASResourceTypeEntry rasResType, java.lang.String sqlPredicate, java.util.Set<RASResourceEntry.RASSqlParameterDefinition> parameterDefinitions) throws InvalidArgumentException, PolicyStoreException
name
- RAS resource name, the name should not be null or empty string. A qualified name should start with a letter or underscore and consist of letter, digit and underscore.displayName
- display name, it is optional and can be set to null.description
- description, it is optional and can be set to null.rasResType
- RAS resource typeparameterDefinitions
- a collection of RASSqlParameterDefinitions, it is optional and can be set to nullInvalidArgumentException
- if an invalid value is passed in, throws out InvalidArgumentException.PolicyObjectAlreadyExistsException
- if the RAS resource already exists, throws out PolicyObjectAlreadyExistsException.PolicyObjectNotFoundException
- if RASResourceTypeEntry doesn't exist, throws out PolicyObjectNotFoundException.PolicyStoreException
- if any internal status error, throws out PolicyStoreException.void deleteRASResource(java.lang.String rasResourceTypeName, java.lang.String name, boolean cascade) throws PolicyObjectNotFoundException, PolicyStoreOperationNotAllowedException, PolicyStoreException
rasResourceTypeName
- RAS resource type name, the type should not be null or empty string. A qualified name should start with a letter or underscore and consist of letter, digit and underscore.name
- RAS resource name, the name should not be null or empty string. A qualified name should start with a letter or underscore and consist of letter, digit and underscore.cascade
- cascade flag, If cascade flag is set to true, the related policies are removed in the same time, otherwise, if related policies exist, throw out PolicyStoreOperationNotAllowedException.InvalidArgumentException
- if an invalid value is passed in, throws out InvalidArgumentException.PolicyObjectNotFoundException
- if the resource specified by name doesn't exist, throws out PolicyObjectNotFoundException.PolicyStoreException
- if any internal status error, throws out PolicyStoreOperation.PolicyStoreOperationNotAllowedException
void modifyRASResource(RASResourceEntry rasResourceEntry) throws InvalidArgumentException, PolicyStoreException
rasResourceEntry
- the revised RASResourceEntry object, null is not accepted.InvalidArgumentException
- if null is passed in, throws out InvalidArgumentException.PolicyObjectNotFoundException
- if the RAS resource doesn't exist in policy repository, throws out PolicyObjectNotFoundException.PolicyStoreException
- if any internal status error, throws out PolicyStoreException.RASResourceEntry getRASResource(java.lang.String resourceTypeName, java.lang.String name) throws PolicyStoreException, PolicyObjectNotFoundException
resourceTypeName
- -- name of the ras resource type (to restrict the search to a resource type)name--
- name of the ras resource (to be found).PolicyStoreException
- if there was an error while searching for the ras resource.PolicyObjectNotFoundException
- if the ras resource with given name and type does not exit.