fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * The contents of this file are subject to the terms
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * of the Common Development and Distribution License
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * (the License). You may not use this file except in
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * compliance with the License.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * You can obtain a copy of the License at
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * https://opensso.dev.java.net/public/CDDLv1.0.html or
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * See the License for the specific language governing
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * permission and limitations under the License.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * When distributing Covered Code, include this CDDL
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Header Notice in each file and include the License file
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * If applicable, add the following below the CDDL Header,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * with the fields enclosed by brackets [] replaced by
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * your own identifying information:
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * "Portions Copyrighted [year] [name of copyright owner]"
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * $Id: MigrateFromInstallDataStore.java,v 1.2 2008/06/25 05:51:22 qcheng Exp $
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorpackage com.sun.identity.install.tools.configurator;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorimport com.sun.identity.install.tools.admin.ToolsConfiguration;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorimport com.sun.identity.install.tools.util.Debug;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorimport com.sun.identity.install.tools.util.LocalizedMessage;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * This class reads the install state file, belonging to previous product.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorclass MigrateFromInstallDataStore implements Serializable, InstallConstants {
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * get install state store, reading state file if install state store
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @return InstallDataStore
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @throws InstallException thrown when reading state file fails.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major public static synchronized InstallDataStore getInstallDataStore()
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major "MigrateFromInstallDataStore.getInstallDataStore() -" +
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major " does not exist");
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major "MigrateFromInstallDataStore.getInstallDataStore() -" +
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major "loading an existing store. File: " +
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major idStore = (InstallDataStore) oStream.readObject();
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major } catch (Exception e) {
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major "MigrateFromInstallDataStore.getInstallDataStore() - " +
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major "Error loading State information ", e);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * check if install state store exists.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @return true if install state store exists, false if it does not.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * set if install state store exists.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @param existingStore
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major private static void setIsExistingStore(boolean existingStore) {
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * return product's home.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @return the product home to migrate from
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * set product's home.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * @param oldProductHome the product home to migrate from
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major public static void setProductHome(String oldProductHome) {
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major private static final String STR_STATE_FILE_NAME =
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major ".am" + ToolsConfiguration.getProductShortName() + "State";
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major private static transient InstallDataStore idStore = null;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major private static transient boolean isExistingStore = false;