Class InstallState
- java.lang.Object
-
- com.sun.identity.install.tools.configurator.InstallState
-
- All Implemented Interfaces:
ICommonToolsConstants,InstallConstants
public class InstallState extends Object implements InstallConstants
Class that encapuslates the state of an install instance. It provides functionality to add/modify instance specific data or global data. It also provides API's to save/delete the instance state.
-
-
Field Summary
-
Fields inherited from interface com.sun.identity.install.tools.admin.ICommonToolsConstants
FILE_SEP, INSTANCE_AUDIT_DIR_NAME, INSTANCE_CONFIG_DIR_NAME, INSTANCE_DEBUG_DIR_NAME, INSTANCE_LIB_DIR_NAME, INSTANCE_LOCALE_DIR_NAME, INSTANCE_LOGS_DIR_NAME, LINE_SEP
-
Fields inherited from interface com.sun.identity.install.tools.configurator.InstallConstants
INT_OPERATION_TYPE_REGULAR, INT_OPERATION_TYPE_SAVE_RESPONSE, INT_OPERATION_TYPE_USE_RESPONSE, LOC_DR_ERR_APP_SERVER_HOME_LOCATOR, LOC_DR_ERR_CORRUPT_PRODUCT_INSTALL, LOC_DR_ERR_INVALID_INSTALL_HOME, LOC_DR_ERR_PRODUCT_ALREADY_MIGRATED, LOC_DR_ERR_PRODUCT_LOCATOR_BACKUP, LOC_DR_ERR_PRODUCT_LOCATOR_READ, LOC_DR_ERR_PRODUCT_LOCATOR_WRITE, LOC_DR_MSG_PRODUCT_SUMM_INFO_BEGIN, LOC_DR_MSG_PRODUCT_SUMM_INFO_BEGIN_LINE, LOC_DR_MSG_PRODUCT_SUMM_INFO_END, LOC_IS_ERR_LOAD_INSTALL_STATE, LOC_IS_ERR_SAVE_INSTALL_STATE, STR_AUDIT_DIR_PREFIX_TAG, STR_BEGIN_END_LINE_MARKER, STR_CONFIG_AGENT_CONFIG_FILE_PATH_TAG, STR_CONFIG_AGENT_MIGRATE_FILE_PATH_TAG, STR_CONFIG_DIR_PREFIX_MIGRATE_TAG, STR_CONFIG_DIR_PREFIX_TAG, STR_CONFIG_FILE_PATH_TAG, STR_CREATE_AGENT_PROFILE_KEY, STR_CREATE_AGENT_PROFILE_NAME, STR_CUSTOM, STR_DEBUG_DIR_PREFIX_TAG, STR_INSTALL, STR_INSTANCE_NAME_MIGRATE_TAG, STR_IS_GLOBAL_DATA_ID, STR_LOG_CONFIG_FILE_PATH, STR_LOG_CONFIG_FILENAME, STR_MIGRATE, STR_SAVE_AGENT_INSTANCE_NAME_KEY, STR_SAVE_REMOTE_AGENT_INSTALL_DIR_KEY, STR_UNINSTALL, STR_VERSION_FILE_NAME
-
-
Constructor Summary
Constructors Constructor Description InstallState(Map keyValuePairs, ArrayList keysToUse)Creates a new InstallState object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intgetInstanceCount()Returns the number of instances already configured.StringgetInstanceName()Returns the name of the instance associated with this InstallStatestatic SetgetInstanceNames()Returns the names of the instances already configured.PersistentStateAccessgetStateAccess()booleanisConfiguredInstance()Returns true if the instance is already configured.static booleanisFreshInstall()voidremoveInstance()Removes the instance.voidsaveState()protected voidsetStateAccess(PersistentStateAccess stateAccess)
-
-
-
Constructor Detail
-
InstallState
public InstallState(Map keyValuePairs, ArrayList keysToUse) throws InstallException
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.- Parameters:
keyValuePairs- a Map containing key value pairs that should be used to look up for the associated instance.keysToUse- A set of keys that should be only used to form a unique key.- Throws:
InstallException
-
-
Method Detail
-
getInstanceNames
public static Set getInstanceNames() throws InstallException
Returns the names of the instances already configured.- Returns:
- Set of instance names if any are configured otherwise an empty Set is returned.
- Throws:
InstallException
-
getInstanceCount
public static int getInstanceCount() throws InstallExceptionReturns the number of instances already configured.- Returns:
- a integer value representing the number of instances configured.
- Throws:
InstallException
-
isFreshInstall
public static boolean isFreshInstall() throws InstallException- Throws:
InstallException
-
getStateAccess
public PersistentStateAccess getStateAccess()
-
getInstanceName
public String getInstanceName()
Returns the name of the instance associated with this InstallState- Returns:
- the instance name
-
isConfiguredInstance
public boolean isConfiguredInstance()
Returns true if the instance is already configured. Otherwise returns false.- Returns:
- Returns true if the instance is already configured. Otherwise returns false.
-
removeInstance
public void removeInstance() throws InstallExceptionRemoves the instance. The method saveState() should be called to remove it from the persistent store.- Throws:
InstallException
-
saveState
public void saveState() throws InstallException- Throws:
InstallException
-
setStateAccess
protected void setStateAccess(PersistentStateAccess stateAccess)
-
-