8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: ResourceManager.java,v 1.7 2009/06/30 17:46:02 veiming Exp $
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington * Portions Copyrighted 2011-2015 ForgeRock AS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.policy.interfaces.Referral;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.policy.plugins.OrgReferral;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.sun.identity.security.AdminTokenAction;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.sun.identity.sm.ServiceConfigManager;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The class <code>ResourceManager</code> manages an index to the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * resources managed by policies in a specific organization/realm.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // resources service config
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // key: service type name, value: ServiceType object
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private Hashtable serviceTypeHash = new Hashtable();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static final String RESOURCES_XML = "xmlresources";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static final String RESOURCE_PREFIXES = "resourceprefixes";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster static final String EMPTY_RESOURCE_NAME = "---EMPTY---";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster static Debug debug = Debug.getInstance("amPolicy");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //Constants to build XML representation
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster static final String RESOURCE_PREFIXES_XML = "resourcePrefixesXml";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster static final String ATTRIBUTE_VALUE_PAIR = "AttributValuePair";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Cache to store the policy names
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * this constructor is called by PolicyManager
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster this.token = (SSOToken) AccessController.doPrivileged(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster this.scm = new ServiceConfigManager(PolicyManager.POLICY_SERVICE_NAME,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster stm = ServiceTypeManager.getServiceTypeManager();
a14393818a78c503f7715c393044b33c86e90195Phill Cunnington canCreateNewRes = LDAPUtils.dnEquals(org, ServiceManager.getBaseDN());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns a set of all managed resource names for all the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * service types
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return names of the resources managed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Set getManagedResourceNames()throws PolicyException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig resources = getResourcesServiceConfig(false);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( (resourceTypes == null) || (resourceTypes.isEmpty()) ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns a set of all managed resource names for the given
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * service type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serviceType the service type for which the resource
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * names should be returned.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return names of the resources.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Set getManagedResourceNames(String serviceType)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig resources = getResourcesServiceConfig(false);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig = resources.getSubConfig(serviceType);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // no resource node for this service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, see if the attribute is there and non-empty
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (!existingAttrs.containsKey(RESOURCE_PREFIXES))) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, need to look into the attribute
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set existingRes = (Set) existingAttrs.get(RESOURCE_PREFIXES);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( (existingRes != null) && (!existingRes.isEmpty()) ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String xmlPrefix = (String) (existingRes.iterator().next());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Determines that with the given organization (or, sub-organization,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * or container) name, if a new resource can be created or not.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Only root level organization/realm has the privilege to create
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * any resource.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param ServiceType the service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if new resources can be created,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * else <code>false</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException problem with configuration store
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public boolean canCreateNewResource(String ServiceType)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns a set of valid service names that are applicable for
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the organization. The result will depended if new resources
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * can be created for the organization and also if the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * has managed resources.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return set of service names that are valid for the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception SSOException if the caller's single sign on token has expired
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if not able to get list of services
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * defined for the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Set getValidServiceNames() throws SSOException, PolicyException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Iterator serviceNames = stm.getServiceTypeNames().iterator();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String serviceName = (String) serviceNames.next();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster !getManagedResourceNames(serviceName).isEmpty()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return ((answer == null) ? Collections.EMPTY_SET : answer);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns a set of names of all the policies for the given resource
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the given service.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serviceType the service type which the resource is associated
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param resource the resource for which policies should be returned
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param includePoliciesForSuperResources indicating whether the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * policies for all the super-resources in addition to the ultimate
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (sub)resource should be returned
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return set of names of the policies.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception InvalidFormatException the retrieved resources
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * from the data store have been corrupted or do not have a
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * valid format.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception NoPermissionException the user does not have sufficient
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * privileges.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception SSOException single-sign-on token invalid or expired
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws InvalidFormatException, NoPermissionException,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // %%% Need to flush the cache when policy's are changed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster StringBuilder cacheNameBuffer = new StringBuilder();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String cacheName = cacheNameBuffer.append(serviceType)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster .append(includePoliciesForSuperResources).toString();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((answer = (Set) policyNames.get(cacheName)) != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // This line may impact performance, try to optimize it later
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster answer = getPolicyNames(rootNode, null, st, resource,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // add it to the cache
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private ServiceType getServiceType(String serviceType)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceType st = (ServiceType)serviceTypeHash.get(serviceType);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Adds the resource names of the policy to the resource tree.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param policy the policy to be added
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception SSOException single-sign-on token invalid or expired
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // iterating through each rule
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster while (i.hasNext()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //Process Referrals
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set referralNames = referrals.getReferralNames();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( (referralNames != null) && (!referralNames.isEmpty()) ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Iterator referralIter = referralNames.iterator();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String referralName= (String) referralIter.next();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Referral referral = referrals.getReferral(referralName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( (values != null) && (!values.isEmpty()) ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Removes the resource names of the policy from the resource tree.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param policy the policy to be removed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception SSOException single-sign-on token invalid or expired
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster void removePolicyFromResourceTree(Policy policy)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // iterating through each rule
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster while (i.hasNext()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //Process Referrals
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set referralNames = referrals.getReferralNames();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( (referralNames != null) && (!referralNames.isEmpty()) ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Iterator referralIter = referralNames.iterator();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String referralName = (String) referralIter.next();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Referral referral = referrals.getReferral(referralName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( (values != null) && (!values.isEmpty()) ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Replaces resource names of a policy in the resource tree.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param oldPolicy the policy to be replaced
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param newPolicy the policy to replace the existins policy with
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception SSOException single-sign-on token invalid or expired
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster void replacePolicyInResourceTree(Policy oldPolicy, Policy newPolicy)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private ServiceConfig getResourcesServiceConfig(boolean create)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster rConfig = PolicyManager.createOrGetPolicyConfig(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //rConfig = scm.getOrganizationConfig(org, null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig oConfig = scm.getOrganizationConfig(org,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster oConfig.getSubConfig(PolicyManager.RESOURCES_POLICY);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.message("ResourceManager.getResourcesServiceConfig():"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + "rConfig is not valid");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig oConfig = scm.getOrganizationConfig(org, null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster oConfig.getSubConfig(PolicyManager.RESOURCES_POLICY);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private void addRuleToResourceTree(String policyName, Rule rule)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // to do: investigate this
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String serviceTypeName = rule.getServiceTypeName();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (resourceName == null || resourceName.length() == 0) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig resources = getResourcesServiceConfig(true);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig = resources.getSubConfig(serviceTypeName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // no resource node for this service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String newResourcesXml = rule.toResourcesXml(policyName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, see if the attribute is there and non-empty
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String newResourcesXml = rule.toResourcesXml(policyName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig.addAttribute(RESOURCES_XML, newSet);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, need to look into the attribute
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set existingRes = (Set) existingAttrs.get(RESOURCES_XML);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String newResourcesXml = rule.toResourcesXml(policyName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, the attribute really contains something
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // finally reset the modified xml content
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (resourceName == null || resourceName.length() == 0) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig resources = getResourcesServiceConfig(false);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // no resource node for this service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, see if the attribute is there and non-empty
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, need to look into the attribute
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set existingRes = (Set) existingAttrs.get(RESOURCES_XML);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, the attribute really contains something
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (n == 1) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // finally reset the modified xml content
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean modified = true;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster node, PolicyManager.POLICY_INDEX_REFERENCE_NODE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean hasMatch = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // iterating through each reference node
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_REFERENCE_NODE_NAME_ATTR);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster matchResult = st.compare(resource, referenceName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (matchResult.equals(ResourceMatch.EXACT_MATCH)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster addPolicyNameNode(doc, referenceNode, policyName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (matchResult.equals(ResourceMatch.SUPER_RESOURCE_MATCH)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String subResource = st.getSubResource(resource, referenceName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster modified = matchAndAddReferenceNode(doc, referenceNode,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // didn't find any match, need to add (a) reference node(s)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster addReferenceNodes(doc, node, resource, policyName, st);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String policyName, ServiceType st, Stack stack)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster node, PolicyManager.POLICY_INDEX_REFERENCE_NODE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (referenceNodes == null || referenceNodes.isEmpty()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // iterating through each reference node
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_REFERENCE_NODE_NAME_ATTR);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster matchResult = st.compare(resource, referenceName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (matchResult.equals(ResourceMatch.EXACT_MATCH)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return removePolicyNameNode(referenceNode, policyName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (matchResult.equals(ResourceMatch.SUPER_RESOURCE_MATCH)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String subResource = st.getSubResource(resource, referenceName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_POLICYNAME_NODE_NAME_ATTR,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private boolean removePolicyNameNode(Node referenceNode,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_POLICYNAME_NODE_NAME_ATTR);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return true;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( n < 1 ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_POLICYNAME_NODE_NAME_ATTR,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_REFERENCE_NODE_NAME_ATTR,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_REFERENCE_NODE_NAME_ATTR,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private void removeReferenceNodes(Node referenceNode,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (!referenceNode.hasChildNodes() && !stack.empty()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the xml root node for the service type's resources xml blob
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serviceType the service type which the resources xml blob is
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * associated with
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return root node for the resources xml content.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception InvalidFormatException the retrieved resources
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * from the data store have been corrupted or do not have a
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * valid format.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception NoPermissionException the user does not have sufficient
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * privileges.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws InvalidFormatException, NoPermissionException,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "searching for resources of the service type: " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig policyResources = getResourcesServiceConfig(false);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "Resources branch is non-existent" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster serviceType + " branch under Resources is null" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Obtain the attributes
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "Unable to find resources attribute for the service: "+
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster serviceType + " under Resources in organization: "+
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Get the XML blob
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "Unable to find resources attribute value for " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "the service: " + serviceType + " in organization: " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "Unable to get resources of the service type: " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (se.getExceptionCode() == SMSException.STATUS_NO_PERMISSION) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new NoPermissionException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ResBundleUtils.rbName,"invalid_sso_token", null, null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster new ByteArrayInputStream(resourcesXml.getBytes("UTF8")));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.error("XML parsing error for resourcesXml");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "invalid (no root node) xml resources blob: " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ResBundleUtils.rbName, "invalid_resources_blob_no_root",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (!rootNode.getNodeName().equalsIgnoreCase(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_ROOT_NODE))
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new InvalidFormatException());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String referenceType = XMLUtils.getNodeAttributeValue(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_ROOT_NODE_TYPE_ATTR);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_ROOT_NODE_TYPE_ATTR_RESOURCES_VALUE)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "invalid (no type attr for PolicyCrossReference element) "+
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ResBundleUtils.rbName, "invalid_resources_blob_no_type",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.debug.message("returning XML root node");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * this method recursively finds the names of the policies corresponding
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * to the resource. Depending on the boolean input parameter, it would
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * either returns all the policies including those for super resources,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * or, just returns the policies at the final level with exact match or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the closest match
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_REFERENCE_NODE_NAME_ATTR);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster combinedName = st.append(superRes, referenceName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster matchResult = st.compare(resource, combinedName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (matchResult.equals(ResourceMatch.EXACT_MATCH)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (matchResult.equals(ResourceMatch.SUPER_RESOURCE_MATCH)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return getPolicyNames(referenceNode, combinedName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (policyNamesForTheReferenceNode.isEmpty()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // didn't find exact match, return policies for the last
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // super-resource match
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( !includePoliciesForSuperResources && superRes!=null ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * this method finds the names of policies in the first
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * level of the node,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private Set getPolicyNames(Node referenceNode) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.POLICY_INDEX_POLICYNAME_NODE_NAME_ATTR);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Adds specified resource prefixes for a certain service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serviceTypeName the service type name the resource prefixes are
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * associated with
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param resourcePrefixes the prefixes to be added
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster void addResourcePrefixes(String serviceTypeName, Set resourcePrefixes)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig resources = getResourcesServiceConfig(true);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig = resources.getSubConfig(serviceTypeName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // no resource node for this service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster = addResourcePrefixes(resourcePrefixes, new HashMap());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //newSet.addAll(resourcePrefixes);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, see if the attribute is there and non-empty
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (!existingAttrs.containsKey(RESOURCE_PREFIXES))) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster = addResourcePrefixes(resourcePrefixes, new HashMap());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //newSet.addAll(resourcePrefixes);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig.addAttribute(RESOURCE_PREFIXES, newSet);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, need to look into the attribute
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set existingRes = (Set) existingAttrs.get(RESOURCE_PREFIXES);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //existingRes.addAll(resourcePrefixes);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( (existingRes != null) && (!existingRes.isEmpty()) ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String prefixXml = (String) (existingRes.iterator().next());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster prefixMap = addResourcePrefixes(resourcePrefixes, prefixMap);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //newAttrs.put(RESOURCE_PREFIXES, existingRes);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Removed specified resource prefixes for a certain service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serviceTypeName the service type name the resource prefixes are
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * associated with
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param resourcePrefixes the prefixes to be removed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster void removeResourcePrefixes(String serviceTypeName, Set resourcePrefixes)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig resources = getResourcesServiceConfig(false);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig = resources.getSubConfig(serviceTypeName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // no resource node for this service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, see if the attribute is there and non-empty
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (!existingAttrs.containsKey(RESOURCE_PREFIXES))) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // else, need to look into the attribute
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set existingSet = (Set) existingAttrs.get(RESOURCE_PREFIXES);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ( (existingSet != null) && (!existingSet.isEmpty()) ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String prefixXml = (String) (existingSet.iterator().next());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster prefixMap = removeResourcePrefixes(resourcePrefixes, prefixMap);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster existingSet.removeAll(resourcePrefixes);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (existingSet.isEmpty()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig.removeAttribute(RESOURCE_PREFIXES);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster resources.removeSubConfig(serviceTypeName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster newAttrs.put(RESOURCE_PREFIXES, existingSet);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig.setAttributes(newAttrs);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw (new PolicyException(ResBundleUtils.rbName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the resource prefix (super-resource) and the rest of the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * resource name (sub-resource)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serviceTypeName the service type which the resource is
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * associated with
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param resourceName the resource name to be split
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return array of two strings, the first being the super-resource
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the second being the sub-resource
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception PolicyException if unable to get the policy services,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and will contain the exception thrown by SMS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception NameNotFoundException service for the given <code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * serviceTypeName</code> does not exist
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception SSOException single-sign-on token invalid or expired
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) throws NameNotFoundException, SSOException, PolicyException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceType st = getServiceType(serviceTypeName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set prefixes = getManagedResourceNames(serviceTypeName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean foundSuperMatch = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean foundExactMatch = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (matchResult.equals(ResourceMatch.SUPER_RESOURCE_MATCH)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (matchResult.equals(ResourceMatch.EXACT_MATCH)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster retVal[1] = st.getSubResource(resourceName, tmp);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Saves the resource index to data store
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param resourceType resource type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param indexXML xml representation of index ( index to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * policies keyed by resource name, in a tree structure)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws PolicyException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws SSOException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster void saveResourceIndex(String resourceType, String indexXML)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServiceConfig resources = getResourcesServiceConfig(true);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster leafConfig = resources.getSubConfig(resourceType);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // no resource node for this service type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Converts xml representation of resource prefixes
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * to a map representation
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Key in the map is the prefix and the value is
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * a count of how many times the prefix has been
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * effectively added. The count is incremented whenever
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the prefix is added and decremented whenever
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the prefix is removed. The count is not decremented
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param xmlResourcePrefixes xml representation of resource
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * prefixes. This is how it is stored in datastore.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return map representation of resource prefixes.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private Map xmlToResourcePrefixes(String xmlResourcePrefixes) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster new ByteArrayInputStream(xmlResourcePrefixes.getBytes("UTF8")));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster = XMLUtils.getRootNode(document, RESOURCE_PREFIXES);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PolicyManager.debug.error("XML parsing error for resource prefixes "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Converts map representation of resource prefixes
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * to an xml representation
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param resourcePrefixes map representation of resource
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return xml representation of resource prefixes
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static String resourcePrefixesToXml(Map resourcePrefixes) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster sb.append(LTS).append(RESOURCE_PREFIXES).append(GTS)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Iterator prefixes = resourcePrefixes.keySet().iterator();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String value = (String) resourcePrefixes.get(prefix);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster sb.append(LTSS).append(RESOURCE_PREFIXES).append(GTS)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Adds a set of resource prefixes to a map of resource prefixes.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Adding a prefix increments the the count for the prefix
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * in map value.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param prefixes a set of resource prefixes to add
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param prefixMap a map of resource prefixes to which to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * add the prefixes.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return prefixMap modified accounting for the addition
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of prefixes
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private Map addResourcePrefixes(Set prefixes, Map prefixMap) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "ResourceManager.addResourcePrefixes:", e);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster prefixMap.put(prefix, Integer.toString(intValue));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Removes a set of resource prefixes from a map of resource prefixes.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Removing a prefix decrements the count for the prefix in the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * map value. Count value is not decremented below 0.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param prefixes a set of resource prefixes to remove
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param prefixMap a map of resource prefixes from which to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * remove the prefixes.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return prefixMap modified accounting for the removal
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of prefixes.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private Map removeResourcePrefixes(Set prefixes, Map prefixMap) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "ResourceManager.removeResourcePrefixes:", e);