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 Classes Modifier and Type Class Description private static class
PluginInstallerCLI.InstallerQuery
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
Fields Modifier and Type Field Description private PluginInstaller
installer
A Plugin Installer to use.private org.slf4j.Logger
log
Class logger.private List<URL>
updateURLs
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 Modifier Constructor Description private
PluginInstallerCLI()
Constrained Constructor. -
Method Summary
Modifier and Type Method Description private void
constructPluginInstaller(PluginInstaller inst, PluginInstallerArguments args)
Build the installer.private void
doContentList(String pluginId)
List the contents for the detailed plugin.private void
doList(boolean fullList, String pluginId)
List all installed plugins (or just one if provided).protected int
doRun(PluginInstallerArguments args)
private void
doUpdate(String pluginId, PluginVersion pluginVersion, boolean checkVersion)
Update the plugin.protected List<Resource>
getAdditionalSpringResources()
protected Class<PluginInstallerArguments>
getArgumentClass()
private PluginVersion
getBestVersion(IdPPlugin plugin, PluginState state)
Find the best update version.protected org.slf4j.Logger
getLogger()
protected String
getVersion()
static void
main(String[] args)
CLI entry point.private void
outOrLog(String message)
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
runMain(String[] args)
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 ComponentInitializationExceptionBuild 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
-
getBestVersion
Find the best update version. Helper function for doUpdate(String, PluginVersion, boolean).- Parameters:
plugin
- The Pluginstate
- 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
-