Class CurrentInstallStateImpl
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.idp.installer.impl.CurrentInstallStateImpl
- All Implemented Interfaces:
CurrentInstallState
,Component
,DestructableComponent
,InitializableComponent
public final class CurrentInstallStateImpl
extends AbstractInitializableComponent
implements CurrentInstallState
Tells the installers about the current install state.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String[][]
The files we will delete if they created on upgrade.The module IDs which are enabled.private boolean
Whether the IdP properties file exists.private ClassLoader
The classloader for "us plus the plugins in the target".private boolean
Whether the LDAP properties file exists.private final org.slf4j.Logger
Class logger.private String
Old Version.The files to delete after an upgrade.private Properties
Previous props.private boolean
Whether system is present.private final Path
Where we are installing to.Fields inherited from interface net.shibboleth.idp.installer.CurrentInstallState
V3_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
private void
Populate {enabledModules
from the current classpath and the new IdP home.private void
Work out what the "current" install state is (before we do any more work).Get the properties associated with the current configuration.Which modules (by ID) are enabled for this release.Build a classpath loader which adds all the plugins in.What is the installer version.Return the list of paths of files which were not there prior to the install but which might be created by the installed but to no purpose.boolean
Was idp.properties present in the target file when we started the install?boolean
Was ldapp.properties present in the target file when we started the install?boolean
If this is an upgrade were there files in %{idp.home}system? If so then we need to copy the files in.private void
Populate {props
from idp.properties and other files pointed to by "idp.additionalProperties".Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
targetDir
Where we are installing to. -
deleteAfterUpgrades
The files we will delete if they created on upgrade. -
enabledModules
The module IDs which are enabled. -
idpPropertiesPresent
private boolean idpPropertiesPresentWhether the IdP properties file exists. -
ldapPropertiesPresent
private boolean ldapPropertiesPresentWhether the LDAP properties file exists. -
systemPresent
private boolean systemPresentWhether system is present. -
oldVersion
Old Version. -
props
Previous props. -
pathsToDelete
The files to delete after an upgrade. -
installedPluginsLoader
The classloader for "us plus the plugins in the target".
-
-
Constructor Details
-
CurrentInstallStateImpl
Constructor.- Parameters:
installerProps
- the installer situation.
-
-
Method Details
-
findPreviousVersion
Work out what the "current" install state is (before we do any more work).- Throws:
ComponentInitializationException
- if we find a strange state
-
setupPreviousProps
Populate {props
from idp.properties and other files pointed to by "idp.additionalProperties".- Throws:
ComponentInitializationException
- on various IO issues
-
findEnabledModules
private void findEnabledModules()Populate {enabledModules
from the current classpath and the new IdP home. -
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
getInstalledVersion
What is the installer version.- Specified by:
getInstalledVersion
in interfaceCurrentInstallState
- Returns:
- "3" for a V3 install, null for a new install or the value we wrote during last install.
-
isIdPPropertiesPresent
public boolean isIdPPropertiesPresent()Was idp.properties present in the target file when we started the install?- Specified by:
isIdPPropertiesPresent
in interfaceCurrentInstallState
- Returns:
- if it was.
-
isLDAPPropertiesPresent
public boolean isLDAPPropertiesPresent()Was ldapp.properties present in the target file when we started the install?- Specified by:
isLDAPPropertiesPresent
in interfaceCurrentInstallState
- Returns:
- if it was.
-
getCurrentlyInstalledProperties
Get the properties associated with the current configuration. This comes idp.properties and anything it points to via "idp.additionalProperties".- Specified by:
getCurrentlyInstalledProperties
in interfaceCurrentInstallState
- Returns:
- the properties, or null if this is a new install.
-
getPathsToBeDeleted
Return the list of paths of files which were not there prior to the install but which might be created by the installed but to no purpose.- Specified by:
getPathsToBeDeleted
in interfaceCurrentInstallState
- Returns:
- the list of paths.
-
isSystemPresent
public boolean isSystemPresent()If this is an upgrade were there files in %{idp.home}system? If so then we need to copy the files in. Otherwise not. For new installs this is false- Specified by:
isSystemPresent
in interfaceCurrentInstallState
- Returns:
- whether the old install has %{idp.home}\system
-
getEnabledModules
Which modules (by ID) are enabled for this release.- Specified by:
getEnabledModules
in interfaceCurrentInstallState
- Returns:
- those modules enabled.
-
getInstalledPluginsLoader
Build a classpath loader which adds all the plugins in.- Specified by:
getInstalledPluginsLoader
in interfaceCurrentInstallState
- Returns:
- a classloader
-