OpenSSOConfigurator.java revision 35aa0eb9e26184b324e1060f735c63d9da6d7038
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 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: OpenSSOConfigurator.java,v 1.4 2009/08/11 23:50:42 goodearth Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
* Portions Copyrighted 2012 Open Source Solution Technology Corporation
*/
/**
* Application which accepts a config file, displays licenses to the user
* and triggers OpenAM's configurator system. Once begun, uses a second thread
* to connect to the installation progress page and print out its status.
*/
public class OpenSSOConfigurator {
private final LicensePresenter licensePresenter;
private boolean acceptLicense = false;
this.licensePresenter = licensePresenter;
}
/**
* Runs the configurator
*
* @param args Program arguments
*/
}
configArg = i + 1;
acceptLicense = true;
}
}
try {
} catch (IOException ex) {
} finally {
try {
} catch (IOException ex) {
}
}
}
try {
} catch (LicenseRejectedException e) {
}
// User must have accepted all license terms now, so ensure parameter is added to request
}
if (success) {
} else {
}
}
/**
* Sets up the Configurator with the appropriate values read from the supplied file,
* may also set the acceptLicense instance variable.
*
* @param config the properties file to configure from
* @return the OpenAM URL to post data to
*/
if (config.getProperty(ACCEPT_LICENSES) != null && !config.getProperty(ACCEPT_LICENSES).isEmpty()) {
}
continue;
}
continue;
}
}
try {
} catch (UnsupportedEncodingException ueex) {
encodedVal = val;
}
}
}
}
if (deploymentURI == null) {
}
}
}
return serverURL + deploymentURI;
}
/**
* Talks to the OpenAM server
*
* @param readProgress Thread that prints out the current progress of the installation
* @param openAmURL URL of the OpenAM instance to update
*
* @return true if installation succeeds, false otherwise
*/
try {
conn.setDoOutput(true);
conn.setUseCaches(false);
if (responseCode == 200) {
conn.getInputStream()));
}
} else {
if ((userStoreType != null) &&
}
return false;
}
} catch (ProtocolException ex) {
return false;
} catch (IOException ex) {
return false;
} finally {
try {
} catch (IOException ex) {
}
}
try {
} catch (IOException ex) {
}
}
try {
// wait 5 seconds if ReadProgress thread does not finished.
} catch (InterruptedException e) {
}
try {
conn.disconnect();
}
}
}
return true;
}
}