Class PluginInstallerCLI
java.lang.Object
net.shibboleth.ext.spring.cli.AbstractCommandLine<T>
net.shibboleth.idp.cli.AbstractIdPHomeAwareCommandLine<PluginInstallerArguments>
net.shibboleth.idp.installer.plugin.impl.PluginInstallerCLI
public final class PluginInstallerCLI
extends AbstractIdPHomeAwareCommandLine<PluginInstallerArguments>
Command line for Plugin Installation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Predicate to ask the user if they want to install the trust store provided.Nested classes/interfaces inherited from class net.shibboleth.ext.spring.cli.AbstractCommandLine
AbstractCommandLine.TerminalCodes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PluginInstaller
A Plugin Installer to use.private org.slf4j.Logger
Class logger.Update URLs.Fields inherited from class net.shibboleth.ext.spring.cli.AbstractCommandLine
ARGS_PROPERTY, RC_INIT, RC_IO, RC_OK, RC_UNKNOWN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
autoPluginFromId
(String pluginId, boolean checkVersion) Given the pluginId find the best version and install.private void
Build the installer.private void
doContentList
(String pluginId) List the contents for the detailed plugin.private void
List all installed plugins (or just one if provided).private int
Go to the well known url (or the provided one) and list all the available plugin ids.protected int
private void
doUpdate
(String pluginId, PluginVersion pluginVersion, boolean checkVersion) Update the plugin.protected Class<PluginInstallerArguments>
private PluginVersion
getBestVersion
(PluginVersion pluginVersion, PluginInfo pluginInfo) Find the best update version.protected org.slf4j.Logger
protected String
private Properties
Load the property file describing all the plugin we know about from a known location.static void
CLI entry point.private void
Emit the line to System.out or the log if not present.private void
outputLicense
(String pluginId) Print the license file for the specified plugin.private void
printDetails
(IdPPlugin plugin) Print our more information about a plugin.static int
Shim for CLI entry point: Allows the code to be run from a test.Methods inherited from class net.shibboleth.idp.cli.AbstractIdPHomeAwareCommandLine
getHttpClient, getHttpClientSecurityParameters
Methods inherited from class net.shibboleth.ext.spring.cli.AbstractCommandLine
getApplicationContext, initLogging, run, setContextInitializer
-
Field Details
-
log
@Nullable private org.slf4j.Logger logClass logger. -
installer
A Plugin Installer to use. -
updateURLs
Update URLs.
-
-
Constructor Details
-
PluginInstallerCLI
private PluginInstallerCLI()Constrained Constructor.
-
-
Method Details
-
getLogger
@Nonnull protected org.slf4j.Logger getLogger()- Specified by:
getLogger
in classAbstractCommandLine<PluginInstallerArguments>
-
getArgumentClass
- Specified by:
getArgumentClass
in classAbstractCommandLine<PluginInstallerArguments>
-
getVersion
- Specified by:
getVersion
in classAbstractCommandLine<PluginInstallerArguments>
-
getAdditionalSpringResources
- Overrides:
getAdditionalSpringResources
in classAbstractCommandLine<PluginInstallerArguments>
-
doRun
- Overrides:
doRun
in classAbstractIdPHomeAwareCommandLine<PluginInstallerArguments>
-
constructPluginInstaller
private void constructPluginInstaller(PluginInstaller inst, PluginInstallerArguments args) throws ComponentInitializationException Build the installer.- Parameters:
inst
- the newly created installedargs
- the arguments- Throws:
ComponentInitializationException
- as required
-
outOrLog
Emit the line to System.out or the log if not present.- Parameters:
message
- what to emit.
-
printDetails
Print our more information about a plugin. Helper method fordoList(boolean, String)
- Parameters:
plugin
- what we are interested in.
-
outputLicense
Print the license file for the specified plugin.- Parameters:
pluginId
- what to list
-
doList
List all installed plugins (or just one if provided).- Parameters:
fullList
- whether to do full deatilspluginId
- the pluginId or null.
-
doContentList
List the contents for the detailed plugin.- Parameters:
pluginId
- the pluginId
-
doListAvailable
private int doListAvailable()Go to the well known url (or the provided one) and list all the available plugin ids.- Returns:
- whether it worked
-
loadPluginInfo
Load the property file describing all the plugin we know about from a known location.- Returns:
- the property files plugins.
-
autoPluginFromId
Given the pluginId find the best version and install. If already installed whine- Parameters:
pluginId
- what to installcheckVersion
- are we checking the version.- Returns:
- installation status
-
getBestVersion
Find the best update version. Helper function for doUpdate(String, PluginVersion, boolean).- Parameters:
pluginVersion
- The Plugin versionpluginInfo
- all about the plugin- Returns:
- the best version (or null)
-
doUpdate
private void doUpdate(@Nonnull String pluginId, @Nullable PluginVersion pluginVersion, boolean checkVersion) Update the plugin.- Parameters:
pluginId
- the pluginId or null.pluginVersion
- (optionally) the version to update to.checkVersion
- are we checking the version.
-
runMain
Shim for CLI entry point: Allows the code to be run from a test.- Parameters:
args
- arguments- Returns:
- one of the predefines
AbstractCommandLine.RC_INIT
,AbstractCommandLine.RC_IO
,AbstractCommandLine.RC_OK
orAbstractCommandLine.RC_UNKNOWN
-
main
CLI entry point.- Parameters:
args
- arguments
-