ResourceManager.java revision a14393818a78c503f7715c393044b33c86e90195
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * The contents of this file are subject to the terms
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * of the Common Development and Distribution License
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * (the License). You may not use this file except in
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * compliance with the License.
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * You can obtain a copy of the License at
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * https://opensso.dev.java.net/public/CDDLv1.0.html or
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * See the License for the specific language governing
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * permission and limitations under the License.
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * When distributing Covered Code, include this CDDL
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * Header Notice in each file and include the License file
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * If applicable, add the following below the CDDL Header,
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * with the fields enclosed by brackets [] replaced by
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * your own identifying information:
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * "Portions Copyrighted [year] [name of copyright owner]"
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * $Id: ResourceManager.java,v 1.7 2009/06/30 17:46:02 veiming Exp $
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * Portions Copyrighted 2011-2015 ForgeRock AS.
* resources managed by policies in a specific organization/realm.
public class ResourceManager {
private boolean canCreateNewRes = false;
token);
return managedResources;
throws PolicyException {
return resourcePrefixes;
* Only root level organization/realm has the privilege to create
throws PolicyException {
return canCreateNewRes;
boolean includePoliciesForSuperResources)
return (answer);
return (answer);
return st;
while (i.hasNext()) {
while (i.hasNext()) {
throws PolicyException {
if (create) {
null);
} catch (SMSException e) {
throw new PolicyException(e);
} catch (SSOException e) {
} catch (SMSException e) {
throw new PolicyException(e);
} catch (SSOException e) {
return rConfig;
newAttrs);
boolean modified =
if (!modified) {
private void removeRuleFromResourceTree(
boolean modified =
if (!modified) {
private boolean matchAndAddReferenceNode(
throws PolicyException {
boolean modified = true;
return modified;
boolean hasMatch = false;
hasMatch = true;
modified = false;
hasMatch = true;
if (!hasMatch) {
return modified;
private boolean matchAndRemoveReferenceNode(
throws PolicyException {
stack);
return matchAndRemoveReferenceNode(
throws PolicyException {
throws PolicyException {
throws PolicyException {
nodes[i] =
resources[i]);
return null;
return null;
org);
return null;
org);
return null;
throw new PolicyException(
throws PolicyException {
throw new InvalidFormatException(
throw new InvalidFormatException(
return retVal;
boolean includePoliciesForSuperResources) {
node,
if (!includePoliciesForSuperResources) {
return policyNamesForTheReferenceNode;
return policyNamesForChildrenNodes;
return policyNamesForTheReferenceNode;
return retVal;
throws PolicyException {
newAttrs);
} catch (SSOException e) {
} catch (SSOException e) {
} catch (SSOException e) {
throws PolicyException {
} catch (SSOException e) {
} catch (SSOException e) {
return retVal;
boolean foundSuperMatch = false;
boolean foundExactMatch = false;
foundSuperMatch = true;
foundExactMatch = true;
if (foundSuperMatch) {
return retVal;
if (foundExactMatch) {
return retVal;
return retVal;
newAttrs);
NAME);
COUNT);
return resourcePrefixes;
} catch (Exception e) {
intValue++;
return prefixMap;
} catch (Exception e) {
intValue--;
return prefixMap;