com.sun.identity.policy
Class ResourceManager

java.lang.Object
  |
  +--com.sun.identity.policy.ResourceManager

public class ResourceManager
extends java.lang.Object

The class ResourceManager manages resources for a specific organization.


Method Summary
 boolean canCreateNewResource(java.lang.String ServiceType)
          Determines that with the given organization (or, sub-organization, or container) name, if a new resource can be created or not.
 java.util.Set getManagedResourceNames()
          Returns a set of all managed resource names for all the service types
 java.util.Set getManagedResourceNames(java.lang.String serviceType)
          Returns a set of all managed resource names for the given service type.
 java.util.Set getPolicyNames(java.lang.String serviceType, java.lang.String resource, boolean includePoliciesForSuperResources)
          Returns a set of names of all the policies for the given resource of the given service.
 java.util.Set getValidServiceNames()
          Returns a set of valid service names that are applicable for the organization.
 java.lang.String[] splitResourceName(java.lang.String serviceTypeName, java.lang.String resourceName)
          Returns the resource prefix (super-resource) and the rest of the resource name (sub-resource)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManagedResourceNames

public java.util.Set getManagedResourceNames()
                                      throws PolicyException
Returns a set of all managed resource names for all the service types
Returns:
set of names of the resources.
Throws:
PolicyException - if unable to get the policy services, and will contain the exception thrown by SMS.

getManagedResourceNames

public java.util.Set getManagedResourceNames(java.lang.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:
set of 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(java.lang.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 at root level, would you have the privilege to create resources.
Parameters:
ServiceType - the service type
Returns:
whether new resources can be created or not
Throws:
PolicyException - problem with directory server service, will contain the exception thrown by SMS

getValidServiceNames

public java.util.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 expired
PolicyException - if not able to get list of services defined for the organization

getPolicyNames

public java.util.Set getPolicyNames(java.lang.String serviceType,
                                    java.lang.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 with
resource - the resource for which policies should be returned
includePoliciesForSuperResources - 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 java.lang.String[] splitResourceName(java.lang.String serviceTypeName,
                                            java.lang.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 with
resourceName - 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 given serviceTypeName does not exist
SSOException - single-sign-on token invalid or expired


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.