8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: ConfiguredModuleInstances.java,v 1.4 2008/06/25 05:42:04 qcheng Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Portions Copyrighted [2011] [ForgeRock AS]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpackage com.sun.identity.authentication.service;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.authentication.config.AMAuthenticationManager;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.security.AdminTokenAction;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The class determines the configured LDAP/DataStore Module Instances for realm
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This list is computed per realm.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpublic class ConfiguredModuleInstances extends ChoiceValues {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Creates <code>ConfiguredModuleInstances</code> object.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Default constructor that will be used by the SMS
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * to create an instance of this class
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // do nothing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the choice values and their corresponding I18N keys for top
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * organization.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the map of choice values.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the map of choice values for given environment params.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param envParams to get the map of choice values
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the map of choice values for given environment params.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster orgDN = (String)envParams.get(Constants.ORGANIZATION_NAME);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // do nothing as instanceNames will be empty.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //return the choice values map
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private void getInstanceNames(String orgDN, String moduleType, Map answer) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SSOToken adminToken = (SSOToken)AccessController.doPrivileged(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster instanceNames = amAM.getModuleInstanceNames(moduleType);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (instanceNames != null && !instanceNames.isEmpty()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Iterator it = instanceNames.iterator(); it.hasNext(); ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Do nothing