Package net.shibboleth.idp.installer.impl

# Class CurrentInstallState

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.installer.impl.CurrentInstallState

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`

public final class CurrentInstallState extends AbstractInitializableComponent
Tells the installers about the current install state.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final String[][]`
`deleteAfterUpgrades`
The files we will delete if they created on upgrade.
`private Set<String>`
`enabledModules`
The module IDs which are enabled.
`private boolean`
`idpPropertiesPresent`
Whether the IdP properties file exists.
`private ClassLoader`
`installedPluginsLoader`
The classloader for "us plus the plugins in the target".
`private boolean`
`ldapPropertiesPresent`
Whether the LDAP properties file exists.
`private final org.slf4j.Logger`
`log`
Class logger.
`private String`
`oldVersion`
Old Version.
`private List<Path>`
`pathsToDelete`
The files to delete after an upgrade.
`private final Path`
`targetDir`
Where we are installing to.

## Constructor Summary

Constructors
Constructor
Description
`CurrentInstallState(InstallerPropertiesImpl installerProps)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`private void`
`findEnabledModules()`
Populate {`enabledModules` from the current classpath and the new IdP home.
`private void`
`findPreviousVersion()`
Work out what the "current" install state is (before we do any more work).
`Collection<String>`
`getEnabledModules()`
Get the module IDs that are enabled.
`ClassLoader`
`getInstalledPluginsLoader()`
Get class loader for installed plugin detection.
`String`
`getInstalledVersion()`
Get installed IdP version.
`List<Path>`
`getPathsToBeDeleted()`
Get list of paths to delete.
`boolean`
`isIdPPropertiesPresent()`
Get whether the idp.properties file is present.
`boolean`
`isLDAPPropertiesPresent()`
Get whether the ldap.properties file is present.

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### targetDir

@Nonnull private final Path targetDir
Where we are installing to.

### deleteAfterUpgrades

@Nonnull private final String[][] deleteAfterUpgrades
The files we will delete if they created on upgrade.

### enabledModules

@Nonnull private Set<String> enabledModules
The module IDs which are enabled.

### idpPropertiesPresent

private boolean idpPropertiesPresent
Whether the IdP properties file exists.

### ldapPropertiesPresent

private boolean ldapPropertiesPresent
Whether the LDAP properties file exists.

### oldVersion

@Nullable private String oldVersion
Old Version.

### pathsToDelete

@NonnullAfterInit private List<Path> pathsToDelete
The files to delete after an upgrade.

### installedPluginsLoader

@Nullable private ClassLoader installedPluginsLoader
The classloader for "us plus the plugins in the target".

## Constructor Details

### CurrentInstallState

public CurrentInstallState(InstallerPropertiesImpl installerProps)
Constructor.

Parameters:
  `installerProps` - the installer situation.

## Method Details

### findPreviousVersion

private void findPreviousVersion() throws ComponentInitializationException
Work out what the "current" install state is (before we do any more work).

Throws:
  `ComponentInitializationException` - if we find a strange state

### findEnabledModules

private void findEnabledModules() throws IOException
Populate {`enabledModules` from the current classpath and the new IdP home.

Throws:
  `IOException` - if we cannot convert a path to a URL

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### getInstalledVersion

@Nullable public String getInstalledVersion()
Get installed IdP version.

Returns:
  installed version

### isIdPPropertiesPresent

public boolean isIdPPropertiesPresent()
Get whether the idp.properties file is present.

Returns:
  whether the idp.properties file is present

### isLDAPPropertiesPresent

public boolean isLDAPPropertiesPresent()
Get whether the ldap.properties file is present.

Returns:
  whether the ldap.properties file is present

### getPathsToBeDeleted

@Nonnull public List<Path> getPathsToBeDeleted()
Get list of paths to delete.

Returns:
  list of paths to delete

### getEnabledModules

@Nonnull public Collection<String> getEnabledModules()
Get the module IDs that are enabled.

Returns:
  enabled module IDs

### getInstalledPluginsLoader

@Nullable public ClassLoader getInstalledPluginsLoader()
Get class loader for installed plugin detection.

Returns:
  class loader