/**
* 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: InstallState.java,v 1.3 2008/06/25 05:51:21 qcheng Exp $
*
*/
/**
* Class that encapuslates the state of an install instance. It provides
*
*/
/**
* Returns the names of the instances already configured.
*
* @return Set of instance names if any are configured otherwise an empty
* Set is returned.
*/
return getInstFinderStore().getInstanceNames();
}
/**
* Returns the number of instances already configured.
*
* @return a integer value representing the number of instances configured.
*/
return getInstFinderStore().getInstancesCount();
}
return !getInstallDataStore().isExistingStore();
}
/**
* Creates a new InstallState object. One of the following cases may
* apply:-
* If no instances are configured corresponding to the given keyValuePairs,
* then an InstallState object containing the input instance
* (keyValuePairs) data (supplied map) will be returned. If a configured
* instance is found associated with keyValuePairs supplied, then an
* InstallState object containing the corresponding instance data and
* global data is returned. If none of the configured instances correspond
* to the given keyValuePairs then an InstallState object with just the
* global data is returned.
*
* @param keyValuePairs
* a Map containing key value pairs that should be used to look
* up for the associated instance.
* @param keysToUse
* A set of keys that should be only used to form a unique key.
*/
throws InstallException {
// If instance name was not found in store. Generate a new one.
if (instanceName == null) {
}
if (!getInstallDataStore().isExistingStore()) {
+ "Creating state with Instance Finder data.");
// New InstallStateOld
} else {
+ "state.");
// Existing install state (global & may be instance state too)
}
}
return pStateAccess;
}
/**
* Returns the name of the instance associated with this InstallState
*
* @return the instance name
*/
return instanceName;
}
/**
* Returns true if the instance is already configured. Otherwise returns
* false.
*
* @return Returns true if the instance is already configured. Otherwise
* returns false.
*/
public boolean isConfiguredInstance() {
}
/**
* Removes the instance. The method saveState() should be called to remove
* it from the persistent store.
*/
}
// TODO: Set the time stamps for the instance & global data's
// A new instance has been configured. So add it
if (!instanceData.isEmpty()) {
}
// Save it to the file
getInstallDataStore().save();
// Save the Translation Properties
if (getInstFinderData() != null) {
}
getInstFinderStore().save();
}
false);
}
throws InstallException {
// Retrieve Global data copy (not reference)
// Retrieve copy of instance data (not reference)
if (instanceData == null) {
+ "for instance " + instanceName);
// New Instance
} else {
// Already Configured Instance
+ "for instance " + instanceName);
}
}
{
return InstFinderStore.getInstance();
}
throws InstallException {
return InstallDataStore.getInstallDataStore();
}
return iFinderData;
}
}
instanceName = name;
}
iFinderData = data;
}
}