Package net.shibboleth.idp.installer
Class V4Install
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.installer.V4Install
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent
public class V4Install extends AbstractInitializableComponent
Code to do most of the V4 Install.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classV4Install.InitializerAnApplicationContextInitializerwhich knows about our idp.home and also injects properties for the backchannel certificate and hostname.private classV4Install.KeyManagementCreate (if needs be) all the keys needed by an install.
-
Field Summary
Fields Modifier and Type Field Description private CurrentInstallStatecurrentStateCurrent Install.private InstallerPropertiesinstallerPropsInstaller Properties.private V4Install.KeyManagementkeyManagerKey Manager.private org.slf4j.LoggerlogLog.private MetadataGeneratormetadataGeneratorWhat will generate metadata?
-
Constructor Summary
Constructors Constructor Description V4Install(InstallerProperties props, CurrentInstallState installState)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckPreConditions()Check for any preconditions to the install.private voidcheckWebXml(Path webXml)If it exists check web.xml for deprecated content.protected voidcreateUserDirectories()Create (if they do not exist) the user editable folders, suitable for later population during update or install.protected voiddeleteSpuriousFiles()Delete those files which were created but not needed.protected voiddoInitialize()protected voidenableModules()ReEnable modules which were already enabled.voidexecute()Method to do the work.protected voidgenerateMetadata()Create and populate (if it does not exist) the "metadata/idp-metadata.xml" file.private PropertiesgetIdPReplacements(boolean sealerCreated)Create the properties we need to replace when we merge idp.properties.protected voidhandleEditWebApp()Create and populate (if it does not exist) edit-webapp.protected voidhandleVersioning()Report the to be installed and (if there is one) current versions.protected voidpopulatePropertyFiles(boolean sealerCreated)Create (if they do not exist) propertyFiles.protected voidpopulateUserDirectories()Create and populate (if they not exist) the "user visible" folders.protected voidreprotect()Set the protection on the files.voidsetMetadataGenerator(MetadataGenerator what)Set theMetadataGenerator.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
Log.
-
installerProps
@Nonnull private final InstallerProperties installerProps
Installer Properties.
-
currentState
@Nonnull private final CurrentInstallState currentState
Current Install.
-
keyManager
@Nonnull private final V4Install.KeyManagement keyManager
Key Manager.
-
metadataGenerator
private MetadataGenerator metadataGenerator
What will generate metadata?
-
-
Constructor Detail
-
V4Install
public V4Install(@Nonnull InstallerProperties props, @Nonnull CurrentInstallState installState)Constructor.- Parameters:
props- The properties to drive the installs.installState- The current install.
-
-
Method Detail
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
execute
public void execute() throws org.apache.tools.ant.BuildExceptionMethod to do the work. It assumes that the distribution has been copied.- Throws:
org.apache.tools.ant.BuildException- if unexpected badness occurs.
-
setMetadataGenerator
public void setMetadataGenerator(MetadataGenerator what)
Set theMetadataGenerator.- Parameters:
what- what to set. This need not have been initialized yetMetadataGenerator.setOutput(File)andMetadataGenerator.setParameters(MetadataGeneratorParameters)are called prior to initialization.
-
checkPreConditions
protected void checkPreConditions() throws org.apache.tools.ant.BuildExceptionCheck for any preconditions to the install.- Throws:
org.apache.tools.ant.BuildException- if one is broken.
-
handleVersioning
protected void handleVersioning() throws org.apache.tools.ant.BuildExceptionReport the to be installed and (if there is one) current versions. Write to be installed version to the dist folder.- Throws:
org.apache.tools.ant.BuildException- if the write fails
-
createUserDirectories
protected void createUserDirectories() throws org.apache.tools.ant.BuildExceptionCreate (if they do not exist) the user editable folders, suitable for later population during update or install.- Throws:
org.apache.tools.ant.BuildException- if badness occurs
-
getIdPReplacements
private Properties getIdPReplacements(boolean sealerCreated)
Create the properties we need to replace when we merge idp.properties.- Parameters:
sealerCreated- have we just created a sealer- Returns:
- what we need to replace
-
populatePropertyFiles
protected void populatePropertyFiles(boolean sealerCreated) throws org.apache.tools.ant.BuildExceptionCreate (if they do not exist) propertyFiles. (idp.properties, ldap.properties). This *MUST* happen beforepopulateUserDirectories()or it will not be effective. Note that in V3 serice.properties and nameid.properties but we do not any more.- Parameters:
sealerCreated- have we just created a sealer- Throws:
org.apache.tools.ant.BuildException- if badness occurs
-
handleEditWebApp
protected void handleEditWebApp() throws org.apache.tools.ant.BuildExceptionCreate and populate (if it does not exist) edit-webapp.- Throws:
org.apache.tools.ant.BuildException- if badness occurs
-
checkWebXml
private void checkWebXml(Path webXml) throws org.apache.tools.ant.BuildException
If it exists check web.xml for deprecated content.- Parameters:
webXml- the path of the file We do this in a very simplistic fashion at first- Throws:
org.apache.tools.ant.BuildException- if we have problems handling the web.xml file
-
populateUserDirectories
protected void populateUserDirectories() throws org.apache.tools.ant.BuildExceptionCreate and populate (if they not exist) the "user visible" folders. (conf, flows, messages, views, logs)- Throws:
org.apache.tools.ant.BuildException- if badness occurs
-
enableModules
protected void enableModules() throws org.apache.tools.ant.BuildExceptionReEnable modules which were already enabled.- Throws:
org.apache.tools.ant.BuildException- if badness occurs
-
deleteSpuriousFiles
protected void deleteSpuriousFiles() throws org.apache.tools.ant.BuildExceptionDelete those files which were created but not needed.- Throws:
org.apache.tools.ant.BuildException- if badness occurs
-
generateMetadata
protected void generateMetadata() throws org.apache.tools.ant.BuildExceptionCreate and populate (if it does not exist) the "metadata/idp-metadata.xml" file.- Throws:
org.apache.tools.ant.BuildException- if badness occurs
-
reprotect
protected void reprotect() throws org.apache.tools.ant.BuildExceptionSet the protection on the files.- Throws:
org.apache.tools.ant.BuildException- if badness occurs
-
-