Step4.java revision 8af80418ba1ec431c8027fa9668e5678658d3611
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * The contents of this file are subject to the terms
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * of the Common Development and Distribution License
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * (the License). You may not use this file except in
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * compliance with the License.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * You can obtain a copy of the License at
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * https://opensso.dev.java.net/public/CDDLv1.0.html or
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * See the License for the specific language governing
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * permission and limitations under the License.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * When distributing Covered Code, include this CDDL
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * Header Notice in each file and include the License file
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * If applicable, add the following below the CDDL Header,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * with the fields enclosed by brackets [] replaced by
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * your own identifying information:
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * "Portions Copyrighted [year] [name of copyright owner]"
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * $Id: Step4.java,v 1.20 2009/10/27 05:31:45 hengming Exp $
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync * Portions Copyrighted 2011-2012 ForgeRock AS
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncimport com.sun.identity.config.SessionAttributeNames;
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync * Step 4 is the input of the remote user data store properties.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync public static final String LDAP_STORE_SESSION_KEY = "wizardCustomUserStore";
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync new ActionLink("validateUMHost", this, "validateUMHost");
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync "validateUMDomainName");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync new ActionLink("setUMEmbedded", this, "setUMEmbedded");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync new ActionLink("resetUMEmbedded", this, "resetUMEmbedded");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync new ActionLink("setDomainName", this, "setDomainName");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync new ActionLink("setRootSuffix", this, "setRootSuffix");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync new ActionLink("setPassword", this, "setPassword");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync new ActionLink("setStoreType", this, "setStoreType");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync public void onInit() {
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync if (ctx.getSessionAttribute(SessionAttributeNames.USER_STORE_HOST)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync String val = getAttribute(SetupConstants.CONFIG_VAR_DATA_STORE,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync if (!val.equals(SetupConstants.SMS_EMBED_DATASTORE)) {
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_SSL,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync val = getAttribute("configStoreHost", getHostName());
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_HOST,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_PORT,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync val = getAttribute("configStoreLoginId",Wizard.defaultUserName);
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync val = getAttribute("rootSuffix", Wizard.defaultRootSuffix);
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync SessionAttributeNames.USER_STORE_ROOT_SUFFIX, val);
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.EXT_DATA_STORE,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_TYPE,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync "LDAPv3ForSUNDS");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync String smsType = getAttribute(SetupConstants.CONFIG_VAR_DATA_STORE,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync "embedded");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync String val = getAttribute(SetupConstants.USER_STORE_HOST,getHostName());
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_HOST, val);
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync val = getAttribute(SetupConstants.USER_STORE_SSL, "SIMPLE");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_SSL, val);
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync addModel("selectUserStoreSSL", "checked=\"checked\"");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync val = getAttribute(SetupConstants.USER_STORE_PORT, "389");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_PORT, val);
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync val = getAttribute(SetupConstants.USER_STORE_LOGIN_ID,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_LOGIN_ID, val);
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync val = getAttribute(SetupConstants.USER_STORE_ROOT_SUFFIX,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ctx.setSessionAttribute(SessionAttributeNames.USER_STORE_ROOT_SUFFIX,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync val = getAttribute(SetupConstants.USER_STORE_TYPE, "LDAPv3ForSUNDS");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync addModel("selectLDAPv3addc", "checked=\"checked\"");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync addModel("selectLDAPv3adam", "checked=\"checked\"");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync addModel("selectLDAPv3sunds", "checked=\"checked\"");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync addModel("selectLDAPv3opends", "checked=\"checked\"");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync addModel("selectLDAPv3tivoli", "checked=\"checked\"");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync addModel("selectExternalUM", "checked=\"checked\"");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync addModel("selectEmbeddedUM", "checked=\"checked\"");
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync public boolean setAll() {
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync return false;
public boolean setSSL() {
public boolean setDomainName() {
public boolean setHost() {
public boolean setUMEmbedded() {
public boolean resetUMEmbedded() {
public boolean setPort() {
public boolean setLoginID() {
public boolean setPassword() {
public boolean setRootSuffix() {
public boolean setStoreType() {
public boolean validateUMHost() {
new LDAPConnection();
attrs, false);
} catch (Exception e) {
public boolean validateUMDomainName() {
new LDAPConnection();
attrs, false);
} catch (Exception e) {
throw new NamingException();
} catch (NamingException e) {
throw new NamingException();
} catch (NamingException e) {
} catch (IOException e) {
return hostAndPort;