CreateXACML.java revision 9d652bb883e4c215dbdcab006aaf1941c3f412ba
/**
* 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: ImportXACML.java,v 1.3 2010/01/11 01:21:01 dillidorai Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* Converts access policies read from XACML XML into Entitlement Framework Privileges
* and then imports these into the specified realm.
*/
public class CreateXACML extends AuthenticatedCommand {
/**
* Services the command line request to import XACML.
*
* Required Arguments:
* realm - Defines the realm the Policies will be imported into.
* xmlfile - References the XACML file from which the Policies should be read.
*
* Optional Arguments:
* dryrun - Optional flag indicates that, rather than carrying out the import,
* a report of anticipated affects should be generated.
* outfile - Optional reference to a file for dryrun report to be written, if not provided
* the dryrun report is written directly to stdout.
*
* @param rc Request Context.
* @throws CLIException if the request cannot serviced.
*/
super.handleRequest(rc);
ldapLogin();
getAdminID());
throw clie;
}
try {
new XACMLReaderWriter(),
new SearchFilterFactory(),
} catch (EntitlementException e) {
debugError("CreateXACML.handleRequest", e);
logException(realm, e);
} catch (SMSException e) {
debugError("CreateXACML.handleRequest", e);
logException(realm, e);
}
if (importSteps.isEmpty()) {
} else {
if (isDryRun()) {
} else {
}
}
}
if (isDryRun()) {
} else {
}
}
if (isDryRun()) {
} else {
}
}
}
if (isDryRun()) {
} else {
}
}
private void ensureEntitlementServiceActive(Subject adminSubject, String realm) throws CLIException {
// FIXME: change to use entitlementService.xacmlPrivilegEnabled()
if (!ec.migratedToEntitlementService()) {
debugError("CreateXACML.handleRequest(): create-xacml not supported in legacy policy mode");
"create-xacml");
}
}
} else {
try {
} catch (FileNotFoundException e) {
debugError("CreateXACML.handleRequest", e);
logException(realm, e);
}
}
return inputStream;
}
}
if (isOutfileSet()) {
} else {
}
}
try {
} catch (FileNotFoundException e) {
debugError("CreateXACML.writeToOutputFile", e);
} catch (SecurityException e) {
debugError("CreateXACML.writeToOutputFile", e);
}
}
private boolean isDryRun() {
}
private boolean isOutfileSet() {
}
private String getOutfileName() {
}
}