/**
* 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]"
*
*/
/**
* This class extends class ConfigurePropertiesTask and performs
* data migration.
*/
public class MigrateWebAgentConfigurePropertiesTask extends
// Properties that are of list type
static {
"com.sun.identity.agents.config.cdsso.cdcservlet.url");
"com.sun.identity.agents.config.cdsso.cookie.domain");
}
// Properties that are of map type
static {
"com.sun.identity.agents.config.profile.attribute.mapping");
"com.sun.identity.agents.config.session.attribute.mapping");
"com.sun.identity.agents.config.response.attribute.mapping");
"com.sun.identity.agents.config.fqdn.mapping");
}
// Properties that are of list type
static {
"com.sun.identity.agents.config.cookie.reset");
"com.sun.identity.agents.config.logout.cookie.reset");
}
// parameter not to be migrated from previous product
static {
}
// New property introduced in 3.0
"com.sun.identity.agents.config.key";
// 2.2 agent encrypt key value, used during migration
throws InstallException {
boolean status = false;
if (status) {
status = false;
"instance config file name to migrate from: " +
"instance config file name: " + instanceConfigFile);
"config file name: " + instanceConfigFile);
try {
mappedProperties = new Properties();
} catch (Exception e) {
"MigrateWebAgentConfigurePropertiesTask.execute() - " +
"Error loading Migrate Properties file", e);
throw new InstallException(LocalizedMessage
.get(LOC_IS_ERR_LOAD_INSTALL_STATE), e);
}
try {
status = true;
} catch (Exception e) {
"MigrateWebAgentConfigurePropertiesTask.execute() - Exception "
+ "occurred while merging config files. ", e);
}
}
return status;
}
/**
* merge previous product's config file with the one newly generated.
*
* @param instanceConfigFileMigrate
* @param instanceConfigFile
* @throws Exception
*/
"MigrateWebAgentConfigurePropertiesTask.mergeConfigFiles() - " +
"config file to migrate from: " + instanceConfigFileMigrate +
" config file to migrate to: " + instanceConfigFile);
try {
// write back comment statement and empty line.
} else {
continue;
}
// For the new web agent property, get its corresponding
// old property name
keyValue.getParameter());
"MigrateWebAgentConfigurePropertiesTask.mergeConfigFiles()- " +
" matched migration parameter: " + migrateLines);
}
} else {
// encrypt key property
int count = 0;
while (st.hasMoreElements()) {
if (count == 0) {
} else {
}
count++;
}
} else {
// new parameter, write back.
}
}
} // end of if (lineData..
} // end of while
try {
}
try {
}
}
}
/**
* read the lines of parameter within previous product's config file
* for each parameter.
*
* @param parameter
* @param instanceConfigFileMigrate
* @return ArrayList of matching lines to be migrated from.
* @throws Exception
*/
if (oldPropertyName == null) {
return migrateLines;
}
try {
int index = 0;
// Property is a list
while (strTok.hasMoreElements()) {
index++;
}
// Property is a map
while (strTok_first.hasMoreElements()) {
new StringTokenizer(
while (strTok_sec.hasMoreElements()) {
parameter + "["
}
}
} else
// Property is reset cookie
while (strTok.hasMoreElements()) {
index++;
}
} else {
}
}
}
}
} finally {
try {
} catch (IOException ex) {
}
}
}
return migrateLines;
}
/*
* inner class to parse&wrap config parameter.
*/
class KeyValue {
int index = 0;
if (index > 0) {
}
}
}
return key;
}
}
return parameter;
}
}
return value;
}
}
private void getParameterName() {
if (index > 0) {
}
}
}
} // end of getParameterName
}
}