/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 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: ServerConfigMgr.java,v 1.13 2009/01/28 05:34:49 ww203982 Exp $
*
*/
/**
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* The class <code>ServiceConfigMgr</code> provides interfaces to set the
* directory server information such as hostname, port number, admin DN and
* password, and proxy user DN and password.
*/
public class ServerConfigMgr {
// Private static varibales
// Run time property key to obtain serverconfig.xml path
"com.iplanet.coreservices.configpath";
private static boolean isAMSDKConfigured;
/**
* Constructor that get the serverconfig.xml file and gets the XML document.
*/
}
private void getServerConfigXMLDoc()
throws Exception {
try {
String strXML = ServerConfiguration.getServerConfigXML(ssoToken, SystemProperties.getServerInstanceName());
throw (new XMLException(
}
throw new XMLException(
}
if (defaultServerGroup == null) {
throw new XMLException(
}
} finally {
}
}
}
throws Exception {
try {
String strXML = ServerConfiguration.getServerConfigXML(ssoToken, SystemProperties.getServerInstanceName());
if (index == -1) {
} else {
if (--index > 0) {
}
break;
}
}
} finally {
}
}
throws Exception {
}
}
return fileLoc;
}
} else {
) {
}
) {
}
}
} else {
}
}
}
}
boolean processed = false;
) {
processed = true;
}
return processed;
}
boolean processed = false;
processed = true;
try {
"dscfg-null-password"), messageArgs));
}
} catch (FileNotFoundException e) {
"dscfg-passwd-file-not-found"), messageArgs));
} catch (IOException ioe) {
"dscfg-passwd-file-not-found"), messageArgs));
}
} else {
"dscfg-incorrect-usage"), messageArgs));
}
}
return processed;
}
throws Exception {
boolean adminPassword = false;
boolean proxyPassword = false;
adminPassword = true;
} else {
proxyPassword = true;
}
if (proxyPassword && !isAMSDKConfigured) {
}
} else {
"dscfg-invalid-option"),objs));
}
}
if (adminPassword && !isAMSDKConfigured) {
}
} else {
adminPassword = true;
proxyPassword = true;
}
if (adminPassword) {
}
if (proxyPassword) {
}
}
return true;
}
private static boolean authenticateDsameUser(
) {
"dummy", false);
try {
}
return true;
} catch (AuthLoginException ex) {
return false;
} catch (IdRepoException ex) {
return false;
}
}
try {
}
} catch (ConfiguratorException ex) {
} finally {
}
}
// ----------------------------------------------------------------------
// Currently supported methods
// ----------------------------------------------------------------------
/**
* Sets the admin user's password.
*/
throws Exception {
}
/**
* Sets the proxy user's password.
*/
throws Exception {
}
/**
* Stores the directory server configuration information to the file system.
*/
}
/**
* Checks and sets the password
*/
private void changePassword(
) throws Exception {
) {
" from file: " + configFile);
throw new XMLException(
}
// Verify old password
new DecodeAction(fileEncPassword)))
) {
}
if (isAMSDKConfigured) {
// this is to check if updating of DS is required.
try {
if (debug.messageEnabled()) {
" new password is already updated in the directory");
}
} catch (LoginException lee) {
try {
if (debug.messageEnabled()) {
" changing password in directory");
}
} catch (LoginException le) {
if (debug.warningEnabled()) {
" new and old passwords donot match with directory");
}
}
}
}
}
/**
* Returns the user DN for the given user type
*/
"dscfg-corrupted-serverconfig")));
}
}
/**
* Returns the user password for the given user type
*/
"dscfg-corrupted-serverconfig")));
}
}
throws Exception {
"dscfg-corrupted-serverconfig")));
}
// Encrypt the new password and store
new EncodeAction(password));
// Delete the remaining text nodes
}
}
/**
* Returns the user node given the user type
*/
+ " node from file: " + configFile);
throw (new XMLException(i18n
.getString("dscfg-corrupted-serverconfig")));
}
return (userNode);
}
private static void validatePasswords(
) {
}
}
}
}
throws FileNotFoundException, IOException {
try {
} finally {
try {
} catch (IOException ie) {
// Ignore
}
}
}
return lineData;
}
}