MigrateFromInstFinderStore.java revision fb379c70e3fd8a537f311b99be4759ae41e02750
/**
* 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: MigrateFromInstFinderStore.java,v 1.2 2008/06/25 05:51:22 qcheng Exp $
*
*/
/**
* This class reads the instance finder file, belonging to previous product.
*
*/
public class MigrateFromInstFinderStore extends OrderedPropertyStore {
/**
* get the singleton of MigrateFromInstFinderStore.
*
* @return MigrateFromInstFinderStore
* @throws InstallException thrown if reading instance finder file fails.
*/
public static synchronized MigrateFromInstFinderStore getInstance()
throws InstallException {
if (instanceIdentifier == null) {
"initializing instance by loading" +
" the properties");
} else {
"Error - can not find old product finder store. " +
"File Name:" +
getTranslateFile());
throw new InstallException(message);
}
}
return instanceIdentifier;
}
/**
* return the instance name to be migrated from.
*
* @param map
* @param keysToUse
* @return
* @throws InstallException
*/
throws InstallException {
if (instanceName == null) {
"instanceName not " +
"found in the properties. Returning null value");
throw new InstallException(message);
} else {
" found in the properties.");
}
return instanceName;
}
/**
* get all instances' instance finder data.
*
* @param mapKeys
* @return Map of all product's install details.
* @throws InstallException
*/
mapKeys);
}
return productDetails;
}
"extractInstanceFinderValues(): " +
"Error - size of mapKeys and number of tokens " +
throw new InstallException(message);
}
for (int i=0; i<count; i++) {
}
return iFinderValues;
}
private MigrateFromInstFinderStore() {
}
// The keysToUse is an ArrayList which contains the keys to use in
// the order (as defined in config file).
for (int i = 0; i < count; i++) {
// The value should never be null. All instance finder
// interactions need a value.
}
}
"createUniqueKey() - key: " + uniqueKey);
return uniqueKey;
}
char newChar) {
for (int i=0; i<l1; i++) {
for (int j=0; j<l2; j++) {
if (replaceStrChar[i] == oldChars[j]) {
replaceStrChar[i] = newChar;
}
}
}
}
return returnStr;
}
"*******" +
"*** END MigrateFromInstFinderStore Data " +
"**********" +
return displayStr;
}
/**
* get product home of previous product.
* @return
*/
public static String getProductHome() {
return productHome;
}
/**
* set product home of previous product.
* @oldProductHome product home of previous product.
*/
}
//////////////////////////////////////////////////////////////////////////
// Overridden abstract methods of PropertyStore
//////////////////////////////////////////////////////////////////////////
return getTranslateFile();
}
public static String getTranslateFile() {
return getProductHome() + TRANSLATION_FILE;
}
public static String getRelativeTranslateFile() {
return TRANSLATION_FILE;
}
public String getFileHeader() {
return STR_IS_LOOK_UP_FILE_HEADER;
}
public LocalizedMessage getLoadErrorMessage() {
}
public LocalizedMessage getSaveErrorMessage() {
}
". Invalid data found at line " +
return getLoadErrorMessage(); // Generic message is sufficient
}
"reading " + "state file " +
getFile() + ". Invalid key found at line " +
return getLoadErrorMessage(); // Generic message is sufficient
}
//////////////////////////////////////////////////////////////////////////
private static final char CHR_REPLACE_WITH_CHAR = '-';
/** Field STR_IS_LOOK_UP_KEY_FIELD_SEP **/
/** Field STR_IS_LOOK_UP_FILE_HEADER **/
private static final String STR_IS_LOOK_UP_FILE_HEADER =
"# Product Instances Translation Lookup File"; // # is necessary
private static String TRANSLATION_FILE =
"Lookup";
private static final String LOC_IS_ERR_EXTRACT_IFINDER_DATA =
"IS_ERR_EXTRACT_IFINDER_DATA";
private static final String LOC_IS_ERR_IFINDER_FILE_NOT_EXIST =
"IS_ERR_IFINDER_FILE_NOT_EXIST";
private static final String LOC_IS_ERR_IFINDER_INSTANCE_NOT_FOUND =
"IS_ERR_IFINDER_INSTANCE_NOT_FOUND";
}