Class PluginInstallerCLI
java.lang.Object
net.shibboleth.shared.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/interfaces inherited from class net.shibboleth.shared.cli.AbstractCommandLine
AbstractCommandLine.TerminalCodes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate InstallableComponentVersionThe IdP Version (or a suitable default).private PluginInstallerA Plugin Installer to use.private org.slf4j.LoggerClass logger.static final intReturn code indicating an module mismatch, 3 .Update URLs.Fields inherited from class net.shibboleth.shared.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 intList 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 booleandoUpdate(String pluginId, InstallableComponentVersion pluginVersion, boolean checkVersion) Update the plugin.Null-safe getter forupdateURLs.protected Class<PluginInstallerArguments>getBestVersion(InstallableComponentVersion pluginVersion, InstallableComponentInfo pluginInfo) Find the best update version.private InstallableComponentVersionGet The IdP Version (or a suitable default).protected org.slf4j.Loggerprotected Stringprivate PropertiesDownload all plugin info from the provide or "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.shared.cli.AbstractCommandLine
getApplicationContext, initLogging, run, setCaseSensitiveOptions, setContextInitializer
-
Field Details
-
log
private org.slf4j.Logger logClass logger. -
RC_MODULE
public static final int RC_MODULEReturn code indicating an module mismatch, 3 .- See Also:
-
installer
A Plugin Installer to use. -
updateURLs
Update URLs. -
determinedIdpVersion
The IdP Version (or a suitable default).
-
-
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>
-
ensureUpdateURLs
Null-safe getter forupdateURLs.- Returns:
updateURLs, which is guaranteed to be non null.
-
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.- Returns:
RC_MODULEif we hit a module issue, otherwiseAbstractCommandLine.RC_OK
-
doContentList
List the contents for the detailed plugin.- Parameters:
pluginId- the pluginId
-
getIdPVersion
Get The IdP Version (or a suitable default).- Returns:
- the version.
-
getBestVersion
@Nullable public InstallableComponentVersion getBestVersion(@Nonnull InstallableComponentVersion pluginVersion, @Nonnull InstallableComponentInfo pluginInfo) Find the best update version.- Parameters:
pluginVersion- The Plugin versiongetpluginInfo- all about the plugin- Returns:
- the best version (or null)
-
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
-
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
-
loadAllPluginInfo
Download all plugin info from the provide or "known" location.- Returns:
- the properties.
-
doUpdate
private boolean doUpdate(@Nonnull String pluginId, @Nullable InstallableComponentVersion 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.- Returns:
- if the installation did any work.
-
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
-