org.apache.geronimo.system.plugin
Interface PluginInstaller

All Known Subinterfaces:
GeronimoDeploymentManager
All Known Implementing Classes:
PluginInstallerGBean, RemoteDeploymentManager

public interface PluginInstaller

Knows how to import and export configurations


Method Summary
 DownloadResults checkOnInstall(Object key)
          Gets the current progress of a download operation.
 DownloadResults checkOnInstall(Object key, boolean remove)
          Gets the current progress of a download operation.
 Dependency[] checkPrerequisites(PluginType plugin)
          Ensures that a plugin's prerequisites are installed
 PluginListType createPluginListForRepositories(String repo)
           
 Map getInstalledPlugins()
          Lists the plugins installed in the local Geronimo server, by name and ID.
 PluginType getPluginMetadata(Artifact moduleId)
          Gets a CofigurationMetadata for a configuration installed in the local server.
 DownloadResults install(PluginListType pluginsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
          Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies.
 void install(PluginListType pluginsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password, DownloadPoller poller)
          Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies.
 Artifact installLibrary(File libFile, String groupId)
           
 DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList)
           
 PluginListType listPlugins(URL mavenRepository, String username, String password)
          Lists the plugins available for download in a particular Geronimo repository.
 void mergeOverrides(String server, AttributesType overrides)
           
 Object startInstall(File carFile, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
          Installs a configuration downloaded from a remote repository into the local Geronimo server, including all its dependencies.
 Object startInstall(PluginListType pluginsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
          Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies.
 void updatePluginMetadata(PluginType metadata)
          Saves a ConfigurationMetadata for a particular plugin, if the server is able to record it.
 void validatePlugin(PluginType plugin)
          Ensures that a plugin artifact is installable.
 

Method Detail

listPlugins

PluginListType listPlugins(URL mavenRepository,
                           String username,
                           String password)
                           throws IOException,
                                  FailedLoginException
Lists the plugins available for download in a particular Geronimo repository.

Parameters:
mavenRepository - The base URL to the maven repository. This must contain the file geronimo-plugins.xml
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
Throws:
IOException
FailedLoginException

getInstalledPlugins

Map getInstalledPlugins()
Lists the plugins installed in the local Geronimo server, by name and ID.

Returns:
A Map with key type String (plugin name) and value type Artifact (config ID of the plugin).

getPluginMetadata

PluginType getPluginMetadata(Artifact moduleId)
Gets a CofigurationMetadata for a configuration installed in the local server. Should load a saved one if available, or else create a new default one to the best of its abilities.

Parameters:
moduleId - Identifies the configuration. This must match a configuration currently installed in the local server. The configId must be fully resolved (isResolved() == true)

updatePluginMetadata

void updatePluginMetadata(PluginType metadata)
Saves a ConfigurationMetadata for a particular plugin, if the server is able to record it. This can be used if you later re-export the plugin, or just want to review the information for a particular installed plugin.

Parameters:
metadata - The data to save. The contained configId (which must be fully resolved) identifies the configuration to save this for.

install

DownloadResults install(PluginListType pluginsToInstall,
                        String defaultRepository,
                        boolean restrictToDefaultRepository,
                        String username,
                        String password)
Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies. The caller will get the results when the operation completes. Note that this method does not throw exceptions on failure, but instead sets the failure property of the DownloadResults.

Parameters:
pluginsToInstall - The list of configurations to install
defaultRepository -
restrictToDefaultRepository -
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.

install

void install(PluginListType pluginsToInstall,
             String defaultRepository,
             boolean restrictToDefaultRepository,
             String username,
             String password,
             DownloadPoller poller)
Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies. The method blocks until the operation completes, but the caller will be notified of progress frequently along the way (using the supplied DownloadPoller). Therefore the caller is meant to create the poller and then call this method in a background thread. Note that this method does not throw exceptions on failure, but instead sets the failure property of the DownloadPoller.

Parameters:
pluginsToInstall - The list of configurations to install
defaultRepository -
restrictToDefaultRepository -
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
poller - Will be notified with status updates as the download proceeds

startInstall

Object startInstall(PluginListType pluginsToInstall,
                    String defaultRepository,
                    boolean restrictToDefaultRepository,
                    String username,
                    String password)
Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies. The method returns immediately, providing a key that can be used to poll the status of the download operation. Note that the installation does not throw exceptions on failure, but instead sets the failure property of the DownloadResults that the caller can poll for.

Parameters:
pluginsToInstall - The list of configurations to install
defaultRepository -
restrictToDefaultRepository -
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
Returns:
A key that can be passed to checkOnInstall

startInstall

Object startInstall(File carFile,
                    String defaultRepository,
                    boolean restrictToDefaultRepository,
                    String username,
                    String password)
Installs a configuration downloaded from a remote repository into the local Geronimo server, including all its dependencies. The method returns immediately, providing a key that can be used to poll the status of the download operation. Note that the installation does not throw exceptions on failure, but instead sets the failure property of the DownloadResults that the caller can poll for.

Parameters:
carFile - A CAR file downloaded from a remote repository. This is a packaged configuration with included configuration information, but it may still have external dependencies that need to be downloaded separately. The metadata in the CAR file includes a repository URL for these downloads, and the username and password arguments are used in conjunction with that.
defaultRepository -
restrictToDefaultRepository -
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
Returns:
A key that can be passed to checkOnInstall

checkOnInstall

DownloadResults checkOnInstall(Object key)
Gets the current progress of a download operation. Note that once the DownloadResults is returned for this operation shows isFinished = true, the operation will be forgotten, so the caller should be careful not to call this again after the download has finished.

Parameters:
key - Identifies the operation to check on

checkOnInstall

DownloadResults checkOnInstall(Object key,
                               boolean remove)
Gets the current progress of a download operation.

Parameters:
key - Identifies the operation to check on
remove - If true and the download operation has finished, the DownloadResults will be forgotten and the next call to this function will return null. Otherwise, the DownloadResults will be retained until this function is called with the remove parameter set to true. This parameter is only used when the download operation has finished (DownloadResults.isFinished() returns true).

validatePlugin

void validatePlugin(PluginType plugin)
                    throws MissingDependencyException
Ensures that a plugin artifact is installable. Checks the Geronimo version, JVM version, and whether or not the plugin is already installed.

Parameters:
plugin - plugin artifact to check
Throws:
MissingDependencyException - if a dependency is not satisfied

checkPrerequisites

Dependency[] checkPrerequisites(PluginType plugin)
Ensures that a plugin's prerequisites are installed

Parameters:
plugin - plugin artifact to check
Returns:
array of missing depedencies

createPluginListForRepositories

PluginListType createPluginListForRepositories(String repo)
                                               throws NoSuchStoreException
Throws:
NoSuchStoreException

installLibrary

Artifact installLibrary(File libFile,
                        String groupId)
                        throws IOException
Throws:
IOException

installPluginList

DownloadResults installPluginList(String targetRepositoryPath,
                                  String relativeTargetServerPath,
                                  PluginListType pluginList)
                                  throws Exception
Throws:
Exception

mergeOverrides

void mergeOverrides(String server,
                    AttributesType overrides)
                    throws InvalidGBeanException,
                           IOException
Throws:
InvalidGBeanException
IOException


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.