Step3.java revision f6ed2652133dbe16345b6d7b5b9cd967e8e7e9ca
/*
* 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: Step3.java,v 1.39 2009/12/17 17:43:39 goodearth Exp $
*
* Portions Copyrighted 2010-2016 ForgeRock AS.
* Portions Copyright 2016 Nomura Research Institute, Ltd.
*/
/**
* Step 3 is for selecting the embedded or external configuration store
*/
public class Step3 extends LDAPStoreWizardPage {
public static final String LDAP_STORE_SESSION_KEY =
"wizardCustomConfigStore";
public ActionLink validateSMHostLink =
public ActionLink validateRootSuffixLink =
public ActionLink setReplicationLink =
public ActionLink validateHostNameLink =
public ActionLink validateConfigStoreHost =
public ActionLink setConfigType =
public ActionLink validateLocalPortLink =
public ActionLink validateLocalAdminPortLink =
public ActionLink validateLocalJmxPortLink =
public ActionLink validateEncKey =
private String localRepPort;
public Step3() {
}
public void onInit() {
} else {
}
// initialize the data store type being used
val = getAttribute(
} else {
}
} else {
}
super.onInit();
}
public boolean setConfigType() {
} else {
}
return true;
}
public boolean setReplication() {
}
return true;
}
public boolean validateRootSuffix() {
}
} else {
writeToResponse("true");
}
return false;
}
public boolean validateLocalPort() {
} else {
try {
} else {
boolean ok = false;
"configStoreHost");
host = "localhost";
}
ok = true;
} else {
}
} else {
ok = true;
}
if (ok) {
writeToResponse("ok");
}
}
} catch (NumberFormatException e) {
} catch (NullPointerException ne) {
}
}
return false;
}
public boolean validateLocalAdminPort() {
} else {
try {
} else {
boolean ok = false;
"configStoreHost");
host = "localhost";
}
ok = true;
} else {
}
} else {
ok = true;
}
if (ok) {
writeToResponse("ok");
}
}
} catch (NumberFormatException e) {
} catch (NullPointerException ne) {
}
}
return false;
}
public boolean validateLocalJmxPort() {
} else {
try {
} else {
boolean ok = false;
"configStoreHost");
host = "localhost";
}
ok = true;
} else {
}
} else {
ok = true;
}
if (ok) {
writeToResponse("ok");
}
}
} catch (NumberFormatException e) {
} catch (NullPointerException ne) {
}
}
return false;
}
/**
* Returns <code>false</code> always. Length of encryption key
* must be at least 10 chars.
*/
public boolean validateEncKey() {
} else {
} else {
writeToResponse("true");
}
}
return false;
}
public boolean validateConfigStoreHost() {
return false;
} else {
}
try {
writeToResponse("ok");
} catch (UnknownHostException uhe) {
}
return false;
}
/*
* a call is made to the OpenAM url entered in the browser. If
* the OpenAM server
* exists a <code>Map</code> of data will be returned which contains the
* information about the existing servers data store, including any
* replication ports if its embedded.
* Information to control the UI is returned in a JSON object of the form
* {
* "param1" : "value1",
* "param2" : "value2"
* }
* The JS on the browser will interpret the above and make the necessary
* changes to prompt the user for any more details required.
*/
public boolean validateHostName() {
getLocalizedString("missing.required.field"));
} else {
// try to retrieve the remote OpenAM information
try {
// data returned from existing OpenAM server
// true for embedded, false for ODSEE
// set the multi embedded flag
// get the existing replication ports if any
if (replAvailable == null) {
replAvailable = "false";
}
"existingserverid");
// dsmgr password is same as amadmin for embedded
} else {
"SSL" : "SIMPLE";
));
}
// set the replication ports pulled from the remote
// server in the session and pass back to the client
// set the configuration store port
// set the configuration store host
// set the configuration store port
}
} catch (ConfigurationException c) {
code = "999";
message = c.getMessage();
}
} catch (ConfiguratorException c) {
code = "999";
message = c.getMessage();
}
}
}
return false;
}
// add first object
} else {
}
}
/*
* the following value have been pulled from an existing OpenAM
* server which was configured to use an external DS. We need to set the DS
* values in the request so they can be used to configure the existing
* OpenAM server.
*/
}
/**
* Validate an Existing SM Host for Configuration Backend.
* @return
*/
public boolean validateSMHost() {
host = "localhost";
}
}
bindDN = "cn=Directory Manager";
}
if (rootSuffix == null) {
}
/*
* Check if the provided root suffix exists and 'services' entry does not exist under the suffix in the existing
* SM host. If not, OpenAM denies setting up.
*/
try {
} catch (EntryNotFoundException enfe) {
writeToResponse("ok");
}
} catch (LdapException lex) {
}
} catch (Exception e) {
}
return false;
}
}