Class RemotePluginInstaller
- java.lang.Object
-
- com.identityworksllc.iiq.common.plugin.RemotePluginInstaller
-
public class RemotePluginInstaller extends Object
A utility to install plugins remotely using the IIQ REST API.This class can has no external dependencies, so can be isolated.
Usage: java com.identityworksllc.iiq.common.plugin.RemotePluginInstaller -p /path/to/properties install /path/to/file
Commands exit with a non-zero exit code when problems occur.
TODO when we migrate this library to minimum JDK 11, use the JDK HTTP client class
-
-
Constructor Summary
Constructors Constructor Description RemotePluginInstaller(URI iiq, String username, char[] password)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<com.identityworksllc.iiq.common.plugin.RemotePluginInstaller.Plugin>
getPlugin(String name)
void
installPlugin(Path toUpload)
Installs a plugin remotely using base Java8 classesboolean
isPluginInstalled(String pluginName)
Makes a query to the Suggest Service to check whether the plugin is installed.static void
main(String[] args)
The main method for this utility.static void
output(com.identityworksllc.iiq.common.plugin.RemotePluginInstaller.OutputLevel level, String output, Object... variables)
void
uninstallPlugin(String pluginName)
-
-
-
Constructor Detail
-
RemotePluginInstaller
public RemotePluginInstaller(URI iiq, String username, char[] password) throws URISyntaxException
- Throws:
URISyntaxException
-
-
Method Detail
-
main
public static void main(String[] args) throws Exception
The main method for this utility.Parses the command line arguments, validates them, and optionally prompts the user for a password. Then, executes the command specified if the inputs are valid.
- Parameters:
args
- The arguments to the main method- Throws:
Exception
- on any failures at all
-
output
public static void output(com.identityworksllc.iiq.common.plugin.RemotePluginInstaller.OutputLevel level, String output, Object... variables)
-
getPlugin
public Optional<com.identityworksllc.iiq.common.plugin.RemotePluginInstaller.Plugin> getPlugin(String name) throws IOException
- Throws:
IOException
-
installPlugin
public void installPlugin(Path toUpload) throws IOException
Installs a plugin remotely using base Java8 classes- Parameters:
toUpload
- The file to upload as a plugin- Throws:
IOException
- on any send failures
-
isPluginInstalled
public boolean isPluginInstalled(String pluginName) throws IOException
Makes a query to the Suggest Service to check whether the plugin is installed.The Suggest service is used because the basic plugin query API does not support names or display names, whereas the Suggester can take a filter.
- Parameters:
pluginName
- The plugin name- Returns:
- The suggest service
- Throws:
IOException
- if any failures occur
-
uninstallPlugin
public void uninstallPlugin(String pluginName) throws IOException
- Throws:
IOException
-
-