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 classPredicate 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 PluginInstallerA Plugin Installer to use.private org.slf4j.LoggerClass 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 intautoPluginFromId(String pluginId, boolean checkVersion) Given the pluginId find the best version and install.private voidBuild the installer.private voiddoContentList(String pluginId) List the contents for the detailed plugin.private voidList all installed plugins (or just one if provided).private intGo to the well known url (or the provided one) and list all the available plugin ids.protected intprivate voiddoUpdate(String pluginId, PluginVersion pluginVersion, boolean checkVersion) Update the plugin.protected Class<PluginInstallerArguments>private PluginVersiongetBestVersion(PluginVersion pluginVersion, PluginInfo pluginInfo) Find the best update version.protected org.slf4j.Loggerprotected Stringprivate PropertiesLoad the property file describing all the plugin we know about from a known location.static voidCLI entry point.private voidEmit the line to System.out or the log if not present.private voidoutputLicense(String pluginId) Print the license file for the specified plugin.private voidprintDetails(IdPPlugin plugin) Print our more information about a plugin.static intShim for CLI entry point: Allows the code to be run from a test.Methods inherited from class net.shibboleth.idp.cli.AbstractIdPHomeAwareCommandLine
getHttpClient, getHttpClientSecurityParametersMethods 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:
getLoggerin classAbstractCommandLine<PluginInstallerArguments>
-
getArgumentClass
- Specified by:
getArgumentClassin classAbstractCommandLine<PluginInstallerArguments>
-
getVersion
- Specified by:
getVersionin classAbstractCommandLine<PluginInstallerArguments>
-
getAdditionalSpringResources
- Overrides:
getAdditionalSpringResourcesin classAbstractCommandLine<PluginInstallerArguments>
-
doRun
- Overrides:
doRunin 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_OKorAbstractCommandLine.RC_UNKNOWN
-
main
CLI entry point.- Parameters:
args- arguments
-