Bootstrap.java revision aee26cce86cd7acccbcd94284b027d11cb9ac327
/**
* 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: Bootstrap.java,v 1.18 2009/05/13 21:26:36 hengming Exp $
*
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* This class is responsible for bootstrapping the WAR.
*/
public class Bootstrap {
/**
* Directory where bootstrap file resides.
*/
private static boolean isBootstrap;
private Bootstrap() {
}
/**
* Loads System Property with the bootstrap file that is
* found in <code>JVM_OPT_BOOTSTRAP</code> stated directory.
*
* @throws Exception if properties cannot be loaded.
*/
public synchronized static void load()
throws Exception
{
if (!isBootstrap) {
throw new ConfiguratorException(
"configurator.cannot.bootstrap", null,
Locale.getDefault());
}
}
}
/**
* Loads System Property with the bootstrap file that is
* found in a directory.
*
* @param basedir Directory where bootstrap file resides.
* bootstrap file can contain either an URL where
* we can go fetch the server configuration properties
* or a file that contains the properties.
* @param bServer <code>true</code> if server.
* @throws Exception if properties cannot be loaded.
*/
throws Exception {
}
prop = new Properties();
try {
} finally {
}
} else {
isBootstrap = true;
}
return prop;
}
throws Exception {
boolean configured = false;
isBootstrap = true;
}
return configured;
}
/**
* Returns <code>true</code> if able to bootstrap the system.
*
* @param bootstrapInfo object that contains information on how to
* fetch the server configuration properties.
* @param reinit <code>true</code> to re initialize the system.
* @throws Exception if there are errors in bootstrapping.
*/
throws Exception {
}
/**
* Returns System Property with an URL.
*
* @param bootstrapData an URL that contains information on how to
* fetch the server configuration properties.
* @param reinit <code>true</code> to re initialize the system.
* @throws Exception if properties cannot be loaded.
*/
private static Properties getConfiguration(
boolean reinit,
boolean bStartDS
) throws Exception {
if (reinit) {
}
try {
} catch (LDAPServiceException e) {
// ignore, DS is down
}
}
return null;
}
try {
if (properties != null) {
// set debug level to error because debug.message in
// SMSEntry.initializedClass won't work and will print out
// error message. Save the debug level and will be restored
// after SMSEntry.initializedClass.
boolean debugSetAtDefault = false;
if (debugLevel == null) {
debugSetAtDefault = true;
}
properties, true, false);
if (debugSetAtDefault) {
} else {
}
properties, true, true);
if (debugSetAtDefault) {
properties, true, true);
}
// ConfigurationObserver is already added when
// DebugPropertiesObserver.getInstance().notifyChanges();
// is called. Adding again causes 2 notification events
// to be sent.
// ServiceConfigManager scm = new ServiceConfigManager(
// Constants.SVC_NAME_PLATFORM, (SSOToken)
// AccessController.doPrivileged(
// AdminTokenAction.getInstance()));
// scm.addListener(ConfigurationObserver.getInstance());
}
} catch (SMSException e) {
//ignore. product is not configured yet.
properties = null;
}
return properties;
}
private static SSOToken getSSOToken(
) throws LoginException, InvalidAuthContextException {
}
return ssoToken;
}
throws IOException
{
try {
}
}
} finally {
try {
//No handling requried
}
}
}
return list;
}
/**
* Modifies the <code>dsameuser</code> password in bootstrap file.
*
* @param password New Password.
* @throws IOException if modification fails.
*/
throws IOException {
}
}
throws IOException {
if (start == -1) {
}
if (start != -1) {
if (end == -1) {
} else {
}
}
return url;
}
}