RealmGetPolicy.java revision 80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: RealmGetPolicy.java,v 1.6 2009/12/18 07:13:27 dillidorai Exp $
*
*/
/**
* Gets policies in a realm.
*/
public class RealmGetPolicy extends AuthenticatedCommand {
private SSOToken adminSSOToken;
private boolean getPolicyNamesOnly;
private IOutput outputWriter;
/**
* Services a Commandline Request.
*
* @param rc Request Context.
* @throws CLIException if the request cannot serviced.
*/
throws CLIException {
super.handleRequest(rc);
ldapLogin();
if (getPolicyNamesOnly) {
} else {
getPolicies();
}
}
private void getPolicyNames() throws CLIException {
try {
"ATTEMPT_TO_GET_POLICY_NAMES_IN_REALM", parameters);
} else {
policyNames = new HashSet();
}
}
for (Object s : policyNames) {
}
try {
} catch (FileNotFoundException e) {
debugError("RealmGetPolicy.handleRequest", e);
try {
}
} catch (IOException ex) {
//do nothing
}
} catch (SecurityException e) {
debugError("RealmGetPolicy.handleRequest", e);
try {
}
} catch (IOException ex) {
//do nothing
}
}
}
try {
} catch (IOException e) {
//do nothing
}
} else {
}
} else {
getResourceString("get-policy-names-in-realm-no-policies"),
}
"GOT_POLICY_NAMES_IN_REALM", parameters);
getResourceString("get-policy-names-in-realm-succeed"),
} catch (PolicyException e) {
debugError("RealmGetPolicy.handleRequest", e);
"FAILED_GET_POLICY_NAMES_IN_REALM", args);
} catch (SSOException e) {
debugError("RealmGetPolicy.handleRequest", e);
"FAILED_GET_POLICY_NAMES_IN_REALM", args);
}
}
private void getPolicies() throws CLIException {
try {
} else {
policyNames = new HashSet();
}
}
.append("<!DOCTYPE Policies \n")
.append("PUBLIC \"-//OpenSSO Policy Administration DTD//EN\"\n")
.append(" -->\n<Policies>\n");
"ATTEMPT_GET_POLICY_IN_REALM", params);
"SUCCEED_GET_POLICY_IN_REALM", params);
}
try {
} catch (FileNotFoundException e) {
debugError("RealmGetPolicy.handleRequest", e);
try {
}
} catch (IOException ex) {
//do nothing
}
} catch (SecurityException e) {
debugError("RealmGetPolicy.handleRequest", e);
try {
}
} catch (IOException ex) {
//do nothing
}
}
}
getResourceString("get-policy-in-realm-succeed"),
try {
} catch (IOException e) {
//do nothing
}
} else {
}
} else {
getResourceString("get-policy-in-realm-no-policies"),
}
} catch (PolicyException e) {
debugError("RealmGetPolicy.handleRequest", e);
"FAILED_GET_POLICY_IN_REALM", args);
} catch (SSOException e) {
debugError("RealmGetPolicy.handleRequest", e);
"FAILED_GET_POLICY_IN_REALM", args);
}
}
}