BulkFederation.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 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: BulkFederation.java,v 1.5 2009/10/29 00:03:50 exu Exp $
*
*/
/**
* Do bulk federation. This is the first step of the 2 step process.
* It talks a file that contains local user Id to remote user Id mapping.
* And generate a file that contains remote user Id to name Id mapping.
*/
public class BulkFederation extends AuthenticatedCommand {
private String localEntityId;
private String remoteEntityId;
private boolean isIDP;
private String userIdMappingFileName;
static {
}
/**
* Does bulk federation.
*
* @param rc Request Context.
* @throws CLIException if unable to process this request.
*/
throws CLIException {
super.handleRequest(rc);
ldapLogin();
"ATTEMPT_DO_BULK_FEDERATION", params);
try {
out = validateFiles();
"SUCCEEDED_DO_BULK_FEDERATION", params);
out = validateFiles();
"SUCCEEDED_DO_BULK_FEDERATION", params);
} else {
throw new CLIException(
getResourceString("unsupported-specification"),
}
} catch (CLIException e) {
"FAILED_DO_BULK_FEDERATION", args);
throw e;
} finally {
try {
} catch (IOException ex) {
//ignored
}
}
}
}
throws CLIException {
}
"bulk-federation-succeeded"));
}
throws CLIException {
}
"bulk-federation-succeeded"));
}
private void idffFederateUser(
) throws CLIException {
try {
if (isIDP) {
IFSConstants.LOCAL_NAME_IDENTIFIER, true);
} else {
IFSConstants.REMOTE_NAME_IDENTIFIER, true);
}
}
}
} catch (FSAccountMgmtException e) {
debugError("BulkFederation.idffFederateUser", e);
getResourceString("bulk-federation-cannot-federate"),
} catch (SAMLException e) {
debugError("BulkFederation.idffFederateUser", e);
getResourceString("bulk-federation-cannot-federate"),
} catch (IOException e) {
debugError("BulkFederation.idffFederateUser", e);
getResourceString("bulk-federation-cannot-federate"),
} catch (IdRepoException e) {
debugError("BulkFederation.idffFederateUser", e);
} catch (SSOException e) {
debugError("BulkFederation.idffFederateUser", e);
}
}
private void saml2FederateUser(
) throws CLIException {
try {
"urn:oasis:names:tc:SAML:2.0:nameid-format:persistent");
if (isIDP) {
} else {
}
}
}
} catch (SAML2Exception e) {
debugError("BulkFederation.saml2FederateUser", e);
getResourceString("bulk-federation-cannot-federate"),
} catch (IOException e) {
debugError("BulkFederation.saml2FederateUser", e);
getResourceString("bulk-federation-cannot-federate"),
} catch (IdRepoException e) {
debugError("BulkFederation.saml2FederateUser", e);
} catch (SSOException e) {
debugError("BulkFederation.saml2FederateUser", e);
}
}
private void getEntityRoleAndIdIDFF()
throws CLIException {
try {
getResourceString("bulk-federation-unknown-metaalias"),
}
} catch (IDFFMetaException e) {
debugError("BulkFederation.getEntityRoleAndIdIDFF", e);
getResourceString("bulk-federation-unknown-metaalias"),
}
}
private void getEntityRoleAndIdSAML2()
throws CLIException {
try {
getResourceString("bulk-federation-unknown-metaalias"),
}
} catch (SAML2MetaException e) {
debugError("BulkFederation.getEntityRoleAndIdSAML2", e);
getResourceString("bulk-federation-unknown-metaalias"),
}
}
/*
* Checks if the input file exists
* Checks if the output file is writable
* Returns a handle to the output file writer.
*/
getResourceString("bulk-federation-infile-do-not-exists"),
}
}
try {
getResourceString("bulk-federation-outfile-cannot-write"),
}
} else {
}
return out;
} catch (IOException e) {
throw new CLIException(e.getMessage(),
}
}
/*
* Expecting localUserId|remoteUserId format
*/
throws CLIException {
try {
if (len > 0) {
getResourceString("bulk-federation-wrong-format"),
}
}
}
} catch (IOException e) {
throw new CLIException(e.getMessage(),
} finally {
try {
} catch (IOException ex) {
//ignored
}
}
}
return map;
}
private String createNameIdentifier()
throws CLIException {
byte[] handleBytes = new byte[21];
if (handleBytes == null) {
throw new CLIException(
getResourceString("bulk-federation-cannot-generate-name-id"),
}
}
}