CreateMetaDataTemplate.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* 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: CreateMetaDataTemplate.java,v 1.38 2009/10/29 00:03:50 exu Exp $
*
*/
/**
* Create Meta Data Template.
*/
public class CreateMetaDataTemplate extends AuthenticatedCommand {
private String extendedData;
private String attraAlias;
private String attrqAlias;
private String authnaAlias;
private String idpSCertAlias;
private String idpECertAlias;
private String attraSCertAlias;
private String attraECertAlias;
private String authnaSCertAlias;
private String authnaECertAlias;
private String pdpSCertAlias;
private String pdpECertAlias;
private String spSCertAlias;
private String spECertAlias;
private String attrqSCertAlias;
private String attrqECertAlias;
private String affiOwnerID;
private List affiMembers;
private String affiSCertAlias;
private String affiECertAlias;
private String pepSCertAlias;
private String pepECertAlias;
private String deploymentURI;
private boolean isWebBased;
/**
* Creates Meta Data Template.
*
* @param rc Request Context.
* @throws CLIException if unable to process this request.
*/
throws CLIException {
super.handleRequest(rc);
ldapLogin();
getOptions(rc);
"ATTEMPT_CREATE_METADATA_TEMPL", params);
try {
"SUCCEEDED_CREATE_METADATA_TEMPL", params);
"SUCCEEDED_CREATE_METADATA_TEMPL", params);
"SUCCEEDED_CREATE_METADATA_TEMPL", params);
} else {
throw new CLIException(
getResourceString("unsupported-specification"),
}
} catch (CLIException e) {
"FAILED_CREATE_METADATA_TEMPL", args);
throw e;
}
}
throws CLIException {
}
}
}
throws CLIException {
}
}
}
throws CLIException {
}
}
}
if (isWebBased) {
try {
if (iPort == -1) {
} else {
}
if (slash == -1) {
deploymentURI = uri;
} else {
}
} catch (MalformedURLException ex) {
// default to local host
protocol =
}
} else {
}
}
private void normalizeOptions() {
}
}
}
}
}
}
}
}
if (idpSCertAlias == null) {
idpSCertAlias = "";
}
if (idpECertAlias == null) {
idpECertAlias = "";
}
if (spSCertAlias == null) {
spSCertAlias = "";
}
if (spECertAlias == null) {
spECertAlias = "";
}
if (attraSCertAlias == null) {
attraSCertAlias = "";
}
if (attraECertAlias == null) {
attraECertAlias = "";
}
if (attrqSCertAlias == null) {
attrqSCertAlias = "";
}
if (attrqECertAlias == null) {
attrqECertAlias = "";
}
if (authnaSCertAlias == null) {
authnaSCertAlias = "";
}
if (authnaECertAlias == null) {
authnaECertAlias = "";
}
if (affiSCertAlias == null) {
affiSCertAlias = "";
}
if (affiECertAlias == null) {
affiECertAlias = "";
}
if (pdpSCertAlias == null) {
pdpSCertAlias = "";
}
if (pdpECertAlias == null) {
pdpECertAlias = "";
}
if (pepSCertAlias == null) {
pepSCertAlias = "";
}
if (pepECertAlias == null) {
pepECertAlias = "";
}
}
private void validateOptions()
throws CLIException {
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-role-null"),
}
(authnaAlias != null))
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-affi-conflict"),
}
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-affi-members-empty"),
}
((affiOwnerID == null))
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-affi-ownerid-empty"),
}
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-affi-null-with-cert-alias"),
}
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-idp-null-with-cert-alias"),
}
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-sp-null-with-cert-alias"),
}
if ((attraAlias == null) &&
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-attra-null-with-cert-alias"),
}
if ((attrqAlias == null) &&
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-attrq-null-with-cert-alias"),
}
if ((authnaAlias == null) &&
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-authna-null-with-cert-alias"),
}
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-pdp-null-with-cert-alias"),
}
) {
throw new CLIException(getResourceString(
"create-meta-template-exception-pep-null-with-cert-alias"),
}
throw new CLIException(getResourceString(
"create-meta-template-exception-protocol-not-found"),
}
throw new CLIException(getResourceString(
"create-meta-template-exception-host-not-found"),
}
throw new CLIException(getResourceString(
"create-meta-template-exception-port-not-found"),
}
if (deploymentURI == null) {
throw new CLIException(getResourceString(
"create-meta-template-exception-deploymentURI-not-found"),
}
}
private void buildDescriptorTemplate()
throws CLIException {
try {
// check privilege
if (writeToFile) {
} else {
pw = new StringWriter();
}
if (writeToFile) {
"create-meta-template-created-descriptor-template"), objs));
}
} catch (SAML2MetaException e) {
throw new CLIException(e.getMessage(),
} catch (IOException e) {
} finally {
} else {
this.getOutputWriter().printlnMessage(
}
}
}
}
private void buildConfigTemplate()
throws CLIException {
try {
// check privilege
if (writeToFile) {
} else {
pw = new StringWriter();
}
if (writeToFile) {
"create-meta-template-created-configuration-template"),
objs));
}
} catch (SAML2MetaException e) {
throw new CLIException(e.getMessage(),
} catch (IOException ex) {
} finally {
} else {
this.getOutputWriter().printlnMessage(
}
}
}
private void buildIDFFConfigTemplate()
throws CLIException {
try {
// check privilege
if (writeToFile) {
} else {
pw = new StringWriter();
}
if (writeToFile) {
"create-meta-template-created-configuration-template"),
objs));
}
} catch (IDFFMetaException ime) {
} catch (IOException ex) {
} finally {
} else {
this.getOutputWriter().printlnMessage(
}
}
}
private void buildIDFFDescriptorTemplate()
throws CLIException {
try {
// check privilege
if (writeToFile) {
} else {
pw = new StringWriter();
}
if (writeToFile) {
"create-meta-template-created-descriptor-template"), objs));
}
} catch (IDFFMetaException e) {
throw new CLIException(e.getMessage(),
} catch (IOException e) {
} finally {
} else {
this.getOutputWriter().printlnMessage(
}
}
}
private void buildWSFedDescriptorTemplate()
throws CLIException {
try {
// check privilege
ssoToken);
if (writeToFile) {
} else {
pw = new StringWriter();
}
if (writeToFile) {
"create-meta-template-created-descriptor-template"), objs));
}
} catch (WSFederationMetaException e) {
throw new CLIException(e.getMessage(),
} catch (IOException e) {
} catch (JAXBException e) {
throw new CLIException(e.getMessage(),
} catch (CertificateEncodingException e) {
throw new CLIException(e.getMessage(),
} finally {
} else {
this.getOutputWriter().printlnMessage(
}
}
}
private void buildWSFedConfigTemplate()
throws CLIException {
try {
// check privilege
ssoToken);
if (writeToFile) {
} else {
pw = new StringWriter();
}
entityID, this.getWorkflowParamMap());
if (writeToFile) {
"create-meta-template-created-configuration-template"),
objs));
}
} catch (WSFederationMetaException e) {
throw new CLIException(e.getMessage(),
} catch (IOException ex) {
} catch (JAXBException e) {
throw new CLIException(e.getMessage(),
} finally {
} else {
this.getOutputWriter().printlnMessage(
}
}
}
private Map getWorkflowParamMap() {
return map;
}
}