CreateFedlet.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 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: CreateFedlet.java,v 1.20 2010/01/08 22:41:43 exu Exp $
*
*/
/**
* * Creates Fedlet.
* */
public class CreateFedlet
extends Task
{
private static String FEDLET_DEFAULT_SHARED_KEY =
"JKEK7DosAgR3Aw3Ece20F8qZdXtiMYJ+";
static {
"com.sun.identity.plugin.configuration.impl.FedletConfigurationImpl");
"com.sun.identity.plugin.datastore.impl.FedletDataStoreProvider");
"com.sun.identity.plugin.log.impl.FedletLogger");
"com.sun.identity.plugin.session.impl.FedletSessionProvider");
"com.sun.identity.plugin.monitoring.impl.FedletAgentProvider");
"com.sun.identity.plugin.monitoring.impl.FedletMonSAML1SvcProvider");
"com.sun.identity.plugin.monitoring.impl.FedletMonSAML2SvcProvider");
"com.sun.identity.plugin.monitoring.impl.FedletMonIDFFSvcProvider");
"com.sun.identity.saml.xmlsig.AMSignatureProvider");
"com.sun.identity.saml.xmlsig.JKSKeyProvider");
"com.sun.identity.fedlet.FedletEncodeDecode");
"com.sun.identity.common.serverMode=false");
}
while (st.hasMoreElements()) {
}
}
}
/**
* Returns secure random string.
*
* @return secure random string.
*/
private static String getRandomString() {
try {
byte [] bytes = new byte[24];
} catch (Exception e) {
}
}
public CreateFedlet() {
}
throws WorkflowException {
"/myfedlets/" + folderName;
}
}
return MessageFormat.format(
}
throws WorkflowException {
}
}
}
throws WorkflowException {
try {
if (size > 0) {
boolean bExtract = false;
) {
}
if (bExtract) {
byte[] b = new byte[size];
while (true) {
break;
} else {
}
}
zipOutputStream.write(b);
}
}
}
} catch (IOException ex) {
} finally {
try {
}
if (zipOutputStream != null) {
}
} catch (IOException ex) {
//ignore
}
}
}
}
throws WorkflowException {
}
try {
int length = 0;
byte[] bytes = new byte[1024];
}
} else {
}
} catch (IOException e) {
throw new WorkflowException(e.getMessage());
} finally {
try {
}
}
} catch (IOException ex) {
//ignore
}
}
}
throws WorkflowException {
"sun-fm-cot-status=Active\n" +
"sun-fm-saml2-readerservice-url=\n" +
"sun-fm-saml2-writerservice-url=\n";
}
throws WorkflowException {
try {
} catch (SAML2MetaException se) {
}
}
throws WorkflowException {
// Add the AttributeQueryConfig to SP extended meta data
// Add the XACMLAuthzDecisionQueryConfig to SP extended meta data
try {
} catch (COTException e) {
throw new WorkflowException(e.getMessage());
}
}
}
throws WorkflowException {
}
}
try {
new URL(assertConsumer);
} catch (MalformedURLException e) {
}
}
}
}
private void createFederationConfigProperties(
) throws WorkflowException {
}
}
throws WorkflowException {
try {
out = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int len;
}
} catch (IOException ex) {
} finally {
try {
}
}
} catch (IOException e) {
//ignore
}
}
}
throws WorkflowException {
try {
} catch (IOException e) {
throw new WorkflowException(e.getMessage());
} finally {
try {
//No handling requried
}
}
}
}
if (idx != -1) {
if (idx != -1) {
if (bHosted) {
} else {
}
}
}
return xml;
}
throws WorkflowException {
try {
byte[] buf = new byte[1024];
// use forward slash in jar path to avoid windows issue
}
int len;
}
out.closeEntry();
}
} catch (IOException e) {
throw new WorkflowException(e.getMessage());
} finally {
try {
}
} catch (IOException ex) {
// ignore
}
}
}
throws WorkflowException {
try {
byte[] buf = new byte[1024];
int len;
}
// Complete the entry
out.closeEntry();
}
return zipName;
} catch (IOException e) {
throw new WorkflowException(e.getMessage());
} finally {
try {
}
} catch (IOException ex) {
// ignore
}
}
}
}
if (test.isDirectory()) {
}
}
}
if (f.isDirectory()) {
if (!bFileOnly) {
}
} else {
}
}
return list;
}
/**
* Encodes special characters in a value.
* percent to %25 and comma to %2C.
*/
char[] chars = v.toCharArray();
if (chars[i] == '%') {
if (lastIdx != i) {
}
lastIdx = i + 1;
} else if (chars[i] == ',') {
if (lastIdx != i) {
}
lastIdx = i + 1;
}
}
if (lastIdx != i) {
}
}
/**
* Below method will add the AttributeQuery to the SP extended
* meta data
*/
" <AttributeQueryConfig metaAlias=\"/attrQuery\">\n" +
" <Attribute name=\"signingCertAlias\">\n" +
" <Value>" + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"encryptionCertAlias\">\n" +
" <Value>" + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"wantNameIDEncrypted\">\n" +
" <Value>" + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"cotlist\">\n" +
" </Attribute>\n" +
" </AttributeQueryConfig>\n"
);
if (idx != -1) {
"</EntityConfig>";
}
return extended;
}
/**
* Below method will add the XACMLAuthzDecisionQuery to the SP extended
* meta data
*/
" <XACMLAuthzDecisionQueryConfig metaAlias=\"/pep\">\n" +
" <Attribute name=\"signingCertAlias\">\n" +
" <Value>" + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"encryptionCertAlias\">\n" +
" <Value>" + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"basicAuthOn\">\n" +
" <Value>" + false + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"basicAuthUser\">\n" +
" <Value>" + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"basicAuthPassword\">\n" +
" <Value>" + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"wantXACMLAuthzDecisionResponseSigned\">\n" +
" <Value>" + false + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"wantAssertionEncrypted\">\n" +
" <Value>" + false + "</Value>\n" +
" </Attribute>\n" +
" <Attribute name=\"cotlist\">\n" +
" </Attribute>\n" +
" </XACMLAuthzDecisionQueryConfig>\n"
);
if (idx != -1) {
"</EntityConfig>";
}
return extended;
}
}