ListXACML.java revision 5819e70cd33d98751fbe907e0a358c3269159185
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: ListXACML.java,v 1.4 2010/01/10 06:39:42 dillidorai Exp $
*
* Portions Copyrighted 2011-2016 ForgeRock AS.
*/
/**
* Gets policies in a realm.
* @author dillidorai
*/
public class ListXACML extends AuthenticatedCommand {
private SSOToken adminSSOToken;
private Subject adminSubject;
private boolean getPolicyNamesOnly;
private IOutput outputWriter;
/**
* Services a Commandline Request.
*
* @param rc Request Context.
* @throws CLIException if the request cannot serviced.
*/
super.handleRequest(rc);
ldapLogin();
getAdminID());
}
if (getPolicyNamesOnly) {
} else {
getPolicies();
}
}
/**
* Convert the String filter parameters into SearchFilter instances.
*
* @param filters Non null but possibly empty.
* @return Empty if no strings provided.
*
* @throws EntitlementException If there was an unexpected error parsing the filter strings.
*/
throws EntitlementException {
return Collections.EMPTY_SET;
}
}
return results;
}
/**
* Indicates the names of the Privileges that match both the Realm and Search Filters
* provided.
*
* @throws CLIException If there was an unexpected error.
*/
private void getPolicyNames() throws CLIException {
try {
"ATTEMPT_TO_GET_POLICY_NAMES_IN_REALM", parameters);
try {
} catch (FileNotFoundException e) {
debugError("ListXACML.handleXACMLPolicyRequest", e);
try {
}
} catch (IOException ex) {
//do nothing
}
} catch (SecurityException e) {
debugError("ListXACML.handleXACMLPolicyRequest", e);
try {
}
} catch (IOException ex) {
//do nothing
}
}
}
}
} else {
}
try {
} catch (IOException e) {
//do nothing
}
}
} else {
getResourceString("get-policy-names-in-realm-no-policies"),
}
"GOT_POLICY_NAMES_IN_REALM", parameters);
getResourceString("get-policy-names-in-realm-succeed"),
} catch (EntitlementException e) {
debugError("ListXACML.handleRequest", e);
"FAILED_GET_POLICY_NAMES_IN_REALM", args);
}
}
/**
* Uses the Realm and Search Filters to identify all Privileges in the Entitlement
* framework to export.
*
* @throws CLIException If there was an unexpected error.
*/
private void getPolicies() throws CLIException {
try {
} catch (FileNotFoundException e) {
debugError("ListXACML.handleXACMLPolicyRequest", e);
try {
}
} catch (IOException ex) {
//do nothing
}
} catch (SecurityException e) {
debugError("ListXACML.handleXACMLPolicyRequest", e);
try {
}
} catch (IOException ex) {
//do nothing
}
}
}
try {
new XACMLReaderWriter(),
new SearchFilterFactory(),
service);
} catch (EntitlementException e) {
debugError("ListXACML.handleRequest", e);
} catch (SMSException e) {
debugError("ListXACML.handleRequest", e);
}
getResourceString("get-policy-in-realm-no-policies"),
} else {
try {
} else {
}
} catch (EntitlementException e) {
}
getResourceString("get-policy-in-realm-succeed"),
try {
} catch (IOException e) {
//do nothing
}
}
}
}
}