ServicesDefaultValues.java revision 80f1a7b5dcc0201eae0bf5d0e3c0cad042b69232
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: ServicesDefaultValues.java,v 1.38 2009/01/28 05:35:02 ww203982 Exp $
*
* Portions Copyrighted 2013-2015 ForgeRock AS.
*/
/**
* This class holds the default values of service schema.
*/
public class ServicesDefaultValues {
static {
}
private ServicesDefaultValues() {
"serviceDefaultValues");
while (e.hasMoreElements()) {
}
}
/**
* This method validates the form fields and populates the
* map with valid values.
*
* @param request is the Servlet Request.
*/
public static void setServiceConfigValues(
) {
if (!isEncryptionKeyValid()){
throw new ConfiguratorException("configurator.encryptkey",
}
// this set the encryption password for crypt class.
// otherwises password in serverconfig.xml will be incorrect
if (!isServiceURLValid()) {
throw new ConfiguratorException("configurator.invalidhostname",
}
if (!isCookieDomainValid(cookieDomain)) {
throw new ConfiguratorException("configurator.invalidcookiedomain",
}
if (!embedded) { //Sun DS as SM datastore
throw new ConfiguratorException(
}
throw new ConfiguratorException("configurator.invalidsuffix",
}
}
// Enable data store notifications and switch persistent search on for sms.
// This is now done by default for embedded data stores as well as external
// to ensure consistent behaviour for refreshing data store cache.
if (bUseExtUMDS) {
} else {
}
} else {
}
}
/**
* Set the platform locale.
*/
private static void setPlatformLocale() {
}
}
/**
* Validates serverURL.
*
* @return <code>true</code> if service URL is valid.
*/
private static boolean isServiceURLValid() {
try {
if (valid) {
if ((idx != -1)) {
} else {
}
protocol = "https";
}
} else {
if (intPort < 0) {
port = "443";
}
} else {
}
}
if (isHostnameValid(hostName)) {
} else {
valid = false;
}
}
} catch (MalformedURLException mue){
valid = false;
}
return valid;
}
/*
* valid: localhost (no period)
* valid: abc.sun.com (two periods)
*
* @param hostname is the user specified host name.
* @return <code>true</code> if syntax for host is correct.
*/
if (valid) {
}
}
return valid;
}
/**
* Validates if cookie Domain is syntactically correct.
*
* @param cookieDomain is the user specified cookie domain.
* @return <code>true</code> if syntax for cookie domain is correct.
*/
if (!valid) {
// need to have a period and cannot be the last char.
if (valid) {
/*
* need to be have a period before the last one e.g.
* .sun.com and cannot be ..com
*/
}
}
return valid;
}
/**
* Returns the cookie Domain based on the hostname.
*
* @param cookieDomain is the user specified cookie domain.
* @param hostname is the host for which the cookie domain is set.
* @return cookieDomain containing the valid cookie domain for
* the specified hostname.
*/
private static String getCookieDomain(
) {
) {
cookieDomain = "";
// try to determine the cookie domain if it is not set
}
}
return cookieDomain;
}
/**
* Validates the encryption key.
*
* @return <code>true</code> if ecryption key is valid.
*/
private static boolean isEncryptionKeyValid() {
}
// in future release need to check if length of greater from 10.
}
/**
* Validates Admin passwords.
*/
}
if (urlAccessAgentPwd != null) {
}
boolean embedded =
boolean dbSunDS = false;
boolean dbMsAD = false;
if (embedded) {
dbSunDS = true;
} else { // Keep old behavior for now.
}
if (embedded) {
}
}
}
if (ldapUserPwd != null) {
ldapUserPwd.trim();
}
}
/*
* valid: password greater than 8 characters
* valid: password and confirm passwords match
*
* @param pwd is the Admin password.
* @param cPwd is the confirm Admin password.
* @param locale Locale of the HTTP Request.
* @return <code>true</code> if password is valid.
*/
private static boolean isPasswordValid(
) {
throw new ConfiguratorException("configurator.nopasswdmatch",
}
} else {
throw new ConfiguratorException("configurator.passwdlength",
}
return true;
}
private static boolean validateURLAccessAgentPassword(
) {
throw new ConfiguratorException(
}
throw new ConfiguratorException(
"configurator.urlaccessagent.passwd.match.amadmin.pwd",
}
} else {
throw new ConfiguratorException("configurator.passwdlength",
}
return true;
}
/**
* Returns the map of default attribute name to its value.
*
* @return the map of default attribute name to its value.
*/
public static Map getDefaultValues() {
}
/**
* Set the deploy URI.
*
* @param deployURI Deploy URI.
* @param map Service attribute values.
*/
}
/**
* Returns the tag swapped string.
*
* @param orig String to be tag swapped.
* @return the tag swapped string.
*/
}
/**
* Returns the tag swapped string.
*
* @param orig String to be tag swapped.
* @param bXML <code>true</code> if it is an XML file. and value
* needs to be escaped.
* @return the tag swapped string.
*/
if (bXML) {
}
}
tmp ;
tmp);
} else if (
) {
} else {
if (bXML) {
}
}
}
}
return orig;
}
}