Package com.sun.identity.policy
Class ResourceManager
- java.lang.Object
-
- com.sun.identity.policy.ResourceManager
-
public class ResourceManager extends Object
The classResourceManagermanages an index to the resources managed by policies in a specific organization/realm.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCreateNewResource(String ServiceType)Determines that with the given organization (or, sub-organization, or container) name, if a new resource can be created or not.SetgetManagedResourceNames()Returns a set of all managed resource names for all the service typesSetgetManagedResourceNames(String serviceType)Returns a set of all managed resource names for the given service type.SetgetPolicyNames(String serviceType, String resource, boolean includePoliciesForSuperResources)Returns a set of names of all the policies for the given resource of the given service.SetgetValidServiceNames()Returns a set of valid service names that are applicable for the organization.String[]splitResourceName(String serviceTypeName, String resourceName)Returns the resource prefix (super-resource) and the rest of the resource name (sub-resource)
-
-
-
Method Detail
-
getManagedResourceNames
public Set getManagedResourceNames() throws PolicyException
Returns a set of all managed resource names for all the service types- Returns:
- names of the resources managed
- Throws:
PolicyException- if unable to get the policy services, and will contain the exception thrown by SMS.
-
getManagedResourceNames
public Set getManagedResourceNames(String serviceType) throws PolicyException
Returns a set of all managed resource names for the given service type.- Parameters:
serviceType- the service type for which the resource names should be returned.- Returns:
- names of the resources.
- Throws:
PolicyException- if unable to get the policy services, and will contain the exception thrown by SMS.
-
canCreateNewResource
public boolean canCreateNewResource(String ServiceType) throws PolicyException
Determines that with the given organization (or, sub-organization, or container) name, if a new resource can be created or not. Only root level organization/realm has the privilege to create any resource.- Parameters:
ServiceType- the service type- Returns:
trueif new resources can be created, elsefalse- Throws:
PolicyException- problem with configuration store
-
getValidServiceNames
public Set getValidServiceNames() throws SSOException, PolicyException
Returns a set of valid service names that are applicable for the organization. The result will depended if new resources can be created for the organization and also if the organization has managed resources.- Returns:
- set of service names that are valid for the organization
- Throws:
SSOException- if the caller's single sign on token has expiredPolicyException- if not able to get list of services defined for the organization
-
getPolicyNames
public Set getPolicyNames(String serviceType, String resource, boolean includePoliciesForSuperResources) throws InvalidFormatException, NoPermissionException, PolicyException, SSOException
Returns a set of names of all the policies for the given resource of the given service.- Parameters:
serviceType- the service type which the resource is associated withresource- the resource for which policies should be returnedincludePoliciesForSuperResources- indicating whether the policies for all the super-resources in addition to the ultimate (sub)resource should be returned- Returns:
- set of names of the policies.
- Throws:
InvalidFormatException- the retrieved resources from the data store have been corrupted or do not have a valid format.NoPermissionException- the user does not have sufficient privileges.PolicyException- if unable to get the policy services, and will contain the exception thrown by SMS.SSOException- single-sign-on token invalid or expired
-
splitResourceName
public String[] splitResourceName(String serviceTypeName, String resourceName) throws NameNotFoundException, SSOException, PolicyException
Returns the resource prefix (super-resource) and the rest of the resource name (sub-resource)- Parameters:
serviceTypeName- the service type which the resource is associated withresourceName- the resource name to be split- Returns:
- array of two strings, the first being the super-resource the second being the sub-resource
- Throws:
PolicyException- if unable to get the policy services, and will contain the exception thrown by SMS.NameNotFoundException- service for the givenserviceTypeNamedoes not existSSOException- single-sign-on token invalid or expired
-
-