Class InstallerPropertiesImpl
java.lang.Object
net.shibboleth.idp.installer.impl.InstallerPropertiesImpl
Class which encapsulated all the properties/UI driven configuration of an install.
NOTE Updated to this properties should be reflected in the "PropertyDriverInstallation" wiki page."/
-
Field Summary
FieldsModifier and TypeFieldDescriptionThose modules which are "core".private Stringcredentials key file mode.Those modules enabled by default.private StringThe entity ID.private StringHostname.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.private intKey Size.private StringKeystore Password.private final org.slf4j.LoggerClass logger.private booleanDo we allow prompting?private Stringscope.private StringSealer Alias.private StringSealer Password.private booleanwhether to tidy up.private final PathThe sourceDirectory.private PathThe target Directory.private booleanwhether to tidy up. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringEvaluate the default scope value.protected voidInitialization routine.Get the context path URL for IdP endpoints.Get the modules to enable before ant install.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.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 PathgetMergeFile(String propName) Get the file specified 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; if it isn't defined then ask the user (if we are allowed) via a no-echo interface.getScope()Get the scope for this installation.Get the alias for the sealer key.(package private) IntegerReturn the sealer key size, if this has been specified.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 StringgetValue(String propertyName, String prompt, NonnullSupplier<String> defaultSupplier) Lookup a property; if it isn't defined then ask the user (if we are allowed).booleanisNoTidy()Does the user want us to *not* tidy up?booleanDo we set the mode?private voidSet whether we tidy up behind ourselves.
-
Field Details
-
INITIAL_INSTALL_MODULES
Which modules to enable on initial install.- Since:
- 4.1.0
- See Also:
-
CORE_MODULES
Those modules which are "core". -
DEFAULT_MODULES
Those modules enabled by default. -
log
@Nonnull private final org.slf4j.Logger logClass logger. -
installerProperties
The properties driving the install. -
targetDir
The target Directory. -
srcDir
The sourceDirectory. -
noPrompt
private boolean noPromptDo we allow prompting? -
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. -
inputHandler
@Nonnull private final org.apache.tools.ant.input.InputHandler inputHandlerInput handler from the prompting.
-
-
Constructor Details
-
InstallerPropertiesImpl
Constructor.- Parameters:
sourceDir- Where the *source* installation is
-
-
Method Details
-
getInputHandler
@Nonnull protected org.apache.tools.ant.input.InputHandler getInputHandler()Get anInputHandlerfor the prompting.- Returns:
- an input handler
-
setNoTidy
private void setNoTidy()Set whether we tidy up behind ourselves. -
doInitialize
Initialization routine.- Throws:
ComponentInitializationException- if initialization fails
-
getPassword
@Nonnull 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 lookupprompt- what to say to the user- Returns:
- the value (this is not echoed to the terminal)
- 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.
- Returns:
- the target directory
- Throws:
org.apache.tools.ant.BuildException- if something goes awry
-
getSourceDir
Where is the install coming from?- Returns:
- the source directory
-
getEntityID
Get the EntityId for this install.- Returns:
- the name
-
isNoTidy
public boolean isNoTidy()Does the user want us to *not* tidy up?- Returns:
- do we not tidy up?
-
getHostName
Get the host name for this install.Defaults to information pulled from the network.
- Returns:
- the host name.
-
getCredentialsKeyFileMode
Mode to set on all files in credentials.- Returns:
- the mode
-
getCredentialsGroup
Group to set on all files in credentials and conf.- Returns:
- the mode or null if none to be set
-
isSetGroupAndMode
public boolean isSetGroupAndMode()Do we set the mode?- 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.- Returns:
- the scope
-
getLDAPPassword
Get the LDAP password iff one was provided. DO NOT PROMPT- Returns:
- the password if provided by a properties
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-
getSubjectAltName
Get the SubjectAltName for the certificates.- Returns:
- the SubjectAltName
-
getContextPath
Get the context path URL for IdP endpoints.- Returns:
- the base URL
-
getKeyStorePassword
Get the password for the keystore for this installation.- Returns:
- the password.
-
getSealerPassword
Get the password for the sealer for this installation.- Returns:
- the password.
-
getModulesToEnable
Get the modules to enable after first install.- Returns:
- the modules
-
getCoreModules
Get the modules to enable before ant install.- Returns:
- the modules
-
getSealerKeySize
Return the sealer key size, if this has been specified.- Returns:
- the key size or null if non specified
- Throws:
org.apache.tools.ant.BuildException- if the size was not an integer
-
getSealerAlias
Get the alias for the sealer key.- Returns:
- the alias
-
getKeySize
public int getKeySize()Get the key size for signing, encryption and backchannel.- Returns:
- the keysize, default is {link #DEFAULT_KEY_SIZE}.
-
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
Pathotherwise - 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.- 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.- Returns:
- the path or null if it none required
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-