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 booleanWhether the IdP properties file exists.private ClassLoaderThe classloader for "us plus the plugins in the target".private booleanWhether the LDAP properties file exists.private final org.slf4j.LoggerClass logger.private StringOld Version.The files to delete after an upgrade.private PropertiesPrevious props.private booleanWhether system is present.private final PathWhere we are installing to.Fields inherited from interface net.shibboleth.idp.installer.CurrentInstallState
V3_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprivate voidPopulate {enabledModulesfrom the current classpath and the new IdP home.private voidWork 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.booleanWas idp.properties present in the target file when we started the install?booleanWas ldapp.properties present in the target file when we started the install?booleanIf this is an upgrade were there files in %{idp.home}system? If so then we need to copy the files in.private voidPopulate {propsfrom 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, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 {propsfrom idp.properties and other files pointed to by "idp.additionalProperties".- Throws:
ComponentInitializationException- on various IO issues
-
findEnabledModules
private void findEnabledModules()Populate {enabledModulesfrom the current classpath and the new IdP home. -
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getInstalledVersion
What is the installer version.- Specified by:
getInstalledVersionin 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:
isIdPPropertiesPresentin interfaceCurrentInstallState- Returns:
- if it was.
-
isLDAPPropertiesPresent
public boolean isLDAPPropertiesPresent()Was ldapp.properties present in the target file when we started the install?- Specified by:
isLDAPPropertiesPresentin 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:
getCurrentlyInstalledPropertiesin 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:
getPathsToBeDeletedin 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:
isSystemPresentin interfaceCurrentInstallState- Returns:
- whether the old install has %{idp.home}\system
-
getEnabledModules
Which modules (by ID) are enabled for this release.- Specified by:
getEnabledModulesin interfaceCurrentInstallState- Returns:
- those modules enabled.
-
getInstalledPluginsLoader
Build a classpath loader which adds all the plugins in.- Specified by:
getInstalledPluginsLoaderin interfaceCurrentInstallState- Returns:
- a classloader
-