Package net.shibboleth.idp.installer
Class InstallerPropertiesImpl
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.idp.installer.InstallerPropertiesImpl
- All Implemented Interfaces:
InstallerProperties,Component,DestructableComponent,InitializableComponent
public class InstallerPropertiesImpl
extends AbstractInitializableComponent
implements InstallerProperties
Class implement
InstallerProperties with properties/UI driven values.
NOTE Updated to this properties should be reflected in the "PropertyDriverInstallation" wiki page."/-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe base directory, inherited and shared with ant.private PathThe base directory.static final StringThe name of a directory to overlay "under" the distribution conf.private Stringcredentials key file mode.static final intWhether to tidy up after ourselves.static final StringThe entity ID.private StringThe entity ID.static final StringGroup to set on files in the credential and conf directories.static final StringWhat is the installer host name?private StringHostname.static final StringThe name of a property file to merge with idp.properties.Local overload of properties (to deal with nested calling).static final StringThe name of a directory to use to populate the initial webapp.static final StringWhich modules to enable on initial install.private final org.apache.tools.ant.input.InputHandlerInput handler from the prompting.private PropertiesThe properties driving the install.static final StringThe the key size to generate.static final StringThe keystore password to use.private intKey Size.private StringKeystore Password.static final StringThe LDAP Password (usually associated with a username in ldap.properties).static final StringThe name of a property file to merge with ldap.properties.private final org.slf4j.LoggerClass logger.static final StringMode to set on credential *key files.private final booleanIs a source Dir needed?static final StringDo we cause a failure rather than a prompt.static final StringWhether to tidy up after ourselves.private booleanDo we allow prompting?static final StringDo we do any chgrp/chmod work?static final StringThe name of a property file to fill in some or all of the above.private Stringscope.static final StringThe scope to assert.static final StringThe sealer alias to use.static final StringThe sealer password to use.private StringSealer Alias.private StringSealer Password.private booleanwhether to tidy up.static final StringWhere to install from (installs only).private PathThe sourceDirectory.static final StringWhere to install to.private PathThe target Directory.private booleanwhether to tidy up.Fields inherited from interface net.shibboleth.idp.installer.InstallerProperties
DEFAULT_MODULES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringFind the most apposite network connector.protected StringEvaluate the default scope value.protected voidGet a directory to use to "pre-overlay" the conf directory.Group to set on all files in credentials and conf.Mode to set on all files in credentials.Get the EntityId for this install.Get the host name for this install.Get the a file to merge with idp.properties or null.Get a path to use to do the initial edit-webapp populate.protected org.apache.tools.ant.input.InputHandlerGet anInputHandlerfor the prompting.intGet the key size for signing, encryption and backchannel.Get the password for the keystore for this installation.Get the a file to merge with ldap.properties or null.Get the LDAP password iff one was provided.protected PathgetMergeDir(String propName) Get the directory specified as the property as a File, or null if it doesn't exist.protected PathgetMergeFile(String propName) Get the file specified as the property as a File, or null if it doesn't exist.private PathgetMergePath(String propName, Boolean mustBeDir) Get thePathspecified as the property as a File, or null if it doesn't exist.Get the modules to enable after first install.protected StringgetPassword(String propertyName, String prompt) Lookup a property.getScope()Get the scope for this installation.Get the alias for the sealer key.Get the password for the sealer for this installation.Where is the install coming from?Get the SubjectAltName for the certificates.Get where we are installing/updating/building the war.protected StringLookup a property.private booleanhasHostName(InetAddress addr) Is this address named? Helper method forbestHostName()booleanisNoTidy()Does the user want us to *not* tidy up.booleanDo we set the mode?voidsetInheritedProperties(Map<String, String> props) Set any properties inherited from the base environment.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
-
ANT_BASE_DIR
The base directory, inherited and shared with ant.- See Also:
-
PROPERTY_SOURCE_FILE
The name of a property file to fill in some or all of the above. This file is deleted after processing.- See Also:
-
IDP_PROPERTIES_MERGE
The name of a property file to merge with idp.properties.- See Also:
-
LDAP_PROPERTIES_MERGE
The name of a property file to merge with ldap.properties.- See Also:
-
LDAP_PASSWORD
The LDAP Password (usually associated with a username in ldap.properties).- See Also:
-
CONF_PRE_OVERLAY
The name of a directory to overlay "under" the distribution conf.- See Also:
-
INITIAL_EDIT_WEBAPP
The name of a directory to use to populate the initial webapp.- See Also:
-
TARGET_DIR
Where to install to. Default is basedir- See Also:
-
SOURCE_DIR
Where to install from (installs only).- See Also:
-
ENTITY_ID
The entity ID.- See Also:
-
NO_PROMPT
Do we cause a failure rather than a prompt.- See Also:
-
HOST_NAME
What is the installer host name?- See Also:
-
SCOPE
The scope to assert.- See Also:
-
KEY_STORE_PASSWORD
The keystore password to use.- See Also:
-
SEALER_PASSWORD
The sealer password to use.- See Also:
-
SEALER_ALIAS
The sealer alias to use.- See Also:
-
KEY_SIZE
The the key size to generate.- See Also:
-
MODE_CREDENTIAL_KEYS
Mode to set on credential *key files.- See Also:
-
GROUP_CONF_CREDENTIALS
Group to set on files in the credential and conf directories.- See Also:
-
PERFORM_SET_MODE
Do we do any chgrp/chmod work?- See Also:
-
NO_TIDY
Whether to tidy up after ourselves.- See Also:
-
INITIAL_INSTALL_MODULES
Which modules to enable on initial install.- Since:
- 4.1.0
- See Also:
-
DEFAULT_KEY_SIZE
public static final int DEFAULT_KEY_SIZEWhether to tidy up after ourselves.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
baseDir
The base directory. -
installerProperties
The properties driving the install. -
targetDir
The target Directory. -
srcDir
The sourceDirectory. -
noPrompt
private boolean noPromptDo we allow prompting? -
needSourceDir
private final boolean needSourceDirIs a source Dir needed? -
entityID
The entity ID. -
hostname
Hostname. -
scope
scope. -
keyStorePassword
Keystore Password. -
sealerPassword
Sealer Password. -
sealerAlias
Sealer Alias. -
keySize
private int keySizeKey Size. (for signing, encryption and backchannel). -
tidy
private boolean tidywhether to tidy up. -
setGroupAndMode
private boolean setGroupAndModewhether to tidy up. -
credentialsKeyFileMode
credentials key file mode. -
inheritedProperties
Local overload of properties (to deal with nested calling). -
inputHandler
private final org.apache.tools.ant.input.InputHandler inputHandlerInput handler from the prompting.
-
-
Constructor Details
-
InstallerPropertiesImpl
public InstallerPropertiesImpl(boolean copiedDistribution) Constructor.- Parameters:
copiedDistribution- Has the distribution been copied? If no we don't need the source dir.
-
-
Method Details
-
getInputHandler
protected org.apache.tools.ant.input.InputHandler getInputHandler()Get anInputHandlerfor the prompting.- Returns:
- an input handler
-
setInheritedProperties
Set any properties inherited from the base environment.- Parameters:
props- what to set
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getValue
protected String getValue(String propertyName, String prompt, Supplier<String> defaultSupplier) throws org.apache.tools.ant.BuildException Lookup a property. If it isn't defined then ask the user (if we are allowed). This is used by most (but all) getters that redirect through a property- Parameters:
propertyName- the property to lookup.prompt- what to say to the userdefaultSupplier- how to get the default value. Using a Supplier allows this to be a reasonably heavyweight operation.- Returns:
- the value
- Throws:
org.apache.tools.ant.BuildException- of anything goes wrong
-
getPassword
protected String getPassword(String propertyName, String prompt) throws org.apache.tools.ant.BuildException Lookup a property. If it isn't defined then ask the user (if we are allowed) via a no-echo interface. Note that this does not work within a debugger.- Parameters:
propertyName- the property to lookup.prompt- what to say to the user- Returns:
- the value. this is not repeated to the screen
- Throws:
org.apache.tools.ant.BuildException- of anything goes wrong
-
getTargetDir
Get where we are installing/updating/building the war. This is slightly complicated because the default depends on what we are doing.- Specified by:
getTargetDirin interfaceInstallerProperties- Returns:
- the target directory
- Throws:
org.apache.tools.ant.BuildException- if something goes awry.
-
getSourceDir
Where is the install coming from?- Specified by:
getSourceDirin interfaceInstallerProperties- Returns:
- the source directory
-
getEntityID
Get the EntityId for this install. Defaults to information pulled from {getHostName().- Specified by:
getEntityIDin interfaceInstallerProperties- Returns:
- the name.
-
isNoTidy
public boolean isNoTidy()Does the user want us to *not* tidy up.- Specified by:
isNoTidyin interfaceInstallerProperties- Returns:
- do we not tidy up?
-
hasHostName
Is this address named? Helper method forbestHostName()- Parameters:
addr- what to look at- Returns:
- true unless the name is the canonical name...
-
bestHostName
Find the most apposite network connector. Taken from Ant.- Returns:
- the best name we can work out
-
getHostName
Get the host name for this install. Defaults to information pulled from the network.- Specified by:
getHostNamein interfaceInstallerProperties- Returns:
- the host name.
-
getCredentialsKeyFileMode
Mode to set on all files in credentials.- Specified by:
getCredentialsKeyFileModein interfaceInstallerProperties- Returns:
- the mode
-
getCredentialsGroup
Group to set on all files in credentials and conf.- Specified by:
getCredentialsGroupin interfaceInstallerProperties- Returns:
- the mode or null if none to be set
-
isSetGroupAndMode
public boolean isSetGroupAndMode()Do we set the mode?- Specified by:
isSetGroupAndModein interfaceInstallerProperties- Returns:
- do we the mode
-
defaultScope
Evaluate the default scope value.- Returns:
- everything after the first '.' in
getHostName()
-
getScope
Get the scope for this installation..- Specified by:
getScopein interfaceInstallerProperties- Returns:
- The scope.
-
getLDAPPassword
Get the LDAP password iff one was provided. DO NOT PROMPT.- Specified by:
getLDAPPasswordin interfaceInstallerProperties- Returns:
- the password if provided by a properties
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-
getSubjectAltName
Get the SubjectAltName for the certificates..- Specified by:
getSubjectAltNamein interfaceInstallerProperties- Returns:
- the SubjectAltName
-
getKeyStorePassword
Get the password for the keystore for this installation..- Specified by:
getKeyStorePasswordin interfaceInstallerProperties- Returns:
- the password.
-
getSealerPassword
Get the password for the sealer for this installation..- Specified by:
getSealerPasswordin interfaceInstallerProperties- Returns:
- the password.
-
getModulesToEnable
Get the modules to enable after first install.- Specified by:
getModulesToEnablein interfaceInstallerProperties- Returns:
- the modules
-
getSealerAlias
Get the alias for the sealer key..- Specified by:
getSealerAliasin interfaceInstallerProperties- Returns:
- the alias
-
getKeySize
public int getKeySize()Get the key size for signing, encryption and backchannel.. default is 3072.- Specified by:
getKeySizein interfaceInstallerProperties- Returns:
- the keysize
-
getMergeDir
Get the directory specified as the property as a File, or null if it doesn't exist.- Parameters:
propName- the name to lookup;- Returns:
- null if the property is not provided a
Fileotherwise - Throws:
org.apache.tools.ant.BuildException- if the property is supplied but the file doesn't exist.
-
getMergeFile
Get the file specified as the property as a File, or null if it doesn't exist.- Parameters:
propName- the name to lookup;- Returns:
- null if the property is not provided a
Fileotherwise - Throws:
org.apache.tools.ant.BuildException- if the property is supplied but the file doesn't exist.
-
getMergePath
private Path getMergePath(String propName, Boolean mustBeDir) throws org.apache.tools.ant.BuildException Get thePathspecified as the property as a File, or null if it doesn't exist. Police for type if required- Parameters:
propName- the name to lookup;mustBeDir- if null do not policy. Otherwise policy according to value- Returns:
- null if the property is not provided a
Fileotherwise - Throws:
org.apache.tools.ant.BuildException- if the property is supplied but the file doesn't exist.
-
getIdPMergeProperties
Get the a file to merge with idp.properties or null..- Specified by:
getIdPMergePropertiesin interfaceInstallerProperties- Returns:
- the file or null if it none required.
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-
getLDAPMergeProperties
Get the a file to merge with ldap.properties or null..- Specified by:
getLDAPMergePropertiesin interfaceInstallerProperties- Returns:
- the path or null if it none required.
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-
getConfPreOverlay
Get a directory to use to "pre-overlay" the conf directory. Files will be copied from here if they don't already exist in conf, before the files are copied from the distribution..- Specified by:
getConfPreOverlayin interfaceInstallerProperties- Returns:
- the path or null if non specified.
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-
getInitialEditWeb
Get a path to use to do the initial edit-webapp populate..- Specified by:
getInitialEditWebin interfaceInstallerProperties- Returns:
- the path or null if non specified.
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-