IdRepoUtils.java revision 4709b991352c6de69ba02928ed6cbf373ca62ed5
/**
* 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: IdRepoUtils.java,v 1.3 2010/01/06 22:31:55 veiming Exp $
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* This class provides common utility functions for IdRepo.
*/
public class IdRepoUtils {
static {
defaultPwdAttrs = new HashSet();
}
/**
* Returns an attribute map with all the password attributes being masked.
*
* @param attrMap an attribute map
* @param pwdAttrs a set of password attribute names
*
* @return an attribute map with all the password attributes being masked.
*/
return attrMap;
}
} else {
allPwdAttrs = new HashSet();
}
if (returnAttrMap == null) {
returnAttrMap = new AMHashMap();
}
}
}
}
}
return schemaFiles;
}
/**
* Return true if specified IdRepo type has schemas.
*
* @param idRepoType IdRepo type
* @return true if specified IdRepo type has schemas
*/
if (idRepoType == null) {
return false;
}
}
/**
* Loads schema to specified IdRepo.
*
* @param ssoToken single sign on token of authenticated user identity
* @param idRepoName IdRepo name
* @param realm the realm
* @param servletCtx the servlet context
*
* @throws IdRepoException If schema can't be loaded or there are
* repository related error conditions.
*/
if (servletCtx == null) {
return;
}
try {
if (debug.messageEnabled()) {
}
args);
}
if (debug.messageEnabled()) {
"schema files.");
}
return;
}
while (st.hasMoreTokens()) {
}
} catch (SMSException smsex) {
if (debug.messageEnabled()) {
}
} catch (SSOException ssoex) {
if (debug.messageEnabled()) {
}
if (debug.messageEnabled()) {
}
}
}
throws Exception {
try {
schemaFile));
char[] cbuf = new char[1024];
int len;
}
"sun-idrepo-ldapv3-config-organization_name");
"@userStoreRootSuffix@", suffix);
dbName);
}
if (adamInstanceGUID != null) {
"@INSTANCE_GUID@", adamInstanceGUID);
}
}
dis = new DataInputStream(
} finally {
try {
//No handling requried
}
}
try {
//No handling requried
}
}
try {
ld.disconnect();
} catch (LDAPException ex) {
}
}
}
}
try {
"(objectclass=*)", null, false );
if (res.hasMoreElements()) {
if (index != -1) {
}
}
}
} finally {
try {
ld.disconnect();
} catch (LDAPException ex) {
}
}
}
return null;
}
throws Exception {
"sun-idrepo-ldapv3-config-ssl-enabled");
new LDAPConnection();
"sun-idrepo-ldapv3-config-ldap-server");
}
"sun-idrepo-ldapv3-config-authid");
}
"sun-idrepo-ldapv3-config-authpw");
}
// hostPort contains port so 389 will be ignored
return ld;
}
}