|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.geronimo.system.plugin.PluginInstallerGBean
public class PluginInstallerGBean
A GBean that knows how to download configurations from a Maven repository.
Field Summary | |
---|---|
static GBeanInfo |
GBEAN_INFO
|
Constructor Summary | |
---|---|
PluginInstallerGBean(ConfigurationManager configManager,
WritableListableRepository repository,
ConfigurationStore configStore,
Collection<? extends ServerInstanceData> serverInstanceDatas,
ServerInfo serverInfo,
ThreadPool threadPool,
ArtifactManager artifactManager,
Collection<PersistentConfigurationList> persistentConfigurationLists,
ClassLoader classLoader)
GBean constructor. |
|
PluginInstallerGBean(String targetRepositoryPath,
String targetServerPath,
Collection<? extends ServerInstanceData> serverInstanceDatas,
Kernel kernel,
ClassLoader classLoader)
Constructor for use in assembling a new server. |
Method Summary | |
---|---|
static void |
addGeronimoDependencies(ConfigurationData data,
List<DependencyType> deps,
boolean includeVersion)
|
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 |
static PluginType |
copy(PluginType metadata,
PluginArtifactType instance)
|
PluginListType |
createPluginListForRepositories(String repo)
|
static GBeanInfo |
getGBeanInfo()
|
Map |
getInstalledPlugins()
Lists the plugins installed in the local Geronimo server, by name and ID. |
PluginType |
getPluginMetadata(Artifact moduleId)
Gets a ConfigurationMetadata for a configuration installed in the local server. |
void |
install(File carFile,
String defaultRepository,
boolean restrictToDefaultRepository,
String username,
String password,
DownloadPoller poller)
Installs from a pre-downloaded CAR file |
void |
install(PluginListType pluginsToInstall,
SourceRepository defaultRepository,
boolean restrictToDefaultRepository,
String username,
String password,
DownloadPoller poller)
|
void |
install(PluginListType pluginsToInstall,
SourceRepository defaultRepository,
boolean restrictToDefaultRepository,
String username,
String password,
DownloadPoller poller,
boolean validatePlugins)
|
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)
This more or less clones the current PluginInstallerGBean to create one with the same server instances (structure) but using the current server as config store and assembling a server in a provided location. |
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. |
static Artifact |
toArtifact(ArtifactType moduleId)
|
static ArtifactType |
toArtifactType(Artifact id)
|
static DependencyType |
toDependencyType(Dependency dep,
boolean includeVersion)
|
static PluginType |
toKey(PluginType metadata)
|
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 is installable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final GBeanInfo GBEAN_INFO
Constructor Detail |
---|
public PluginInstallerGBean(ConfigurationManager configManager, WritableListableRepository repository, ConfigurationStore configStore, Collection<? extends ServerInstanceData> serverInstanceDatas, ServerInfo serverInfo, ThreadPool threadPool, ArtifactManager artifactManager, Collection<PersistentConfigurationList> persistentConfigurationLists, ClassLoader classLoader) throws IOException
configManager
- Configuration Manager for this serverrepository
- repository to install intoconfigStore
- configuration store to install intoserverInstanceDatas
- set of server "layouts" to install config info intoserverInfo
- location of serverthreadPool
- thread pool for async operationsartifactManager
- artifact manager to resolve existing artifactspersistentConfigurationLists
- used to start new plugins in a running serverclassLoader
- classLoader @throws IOException exception if server instance cannot be loaded
IOException
- from bad ServerInstancepublic PluginInstallerGBean(String targetRepositoryPath, String targetServerPath, Collection<? extends ServerInstanceData> serverInstanceDatas, Kernel kernel, ClassLoader classLoader) throws Exception
serverInstanceDatas
- set of server layoutskernel
- kernel for current serverclassLoader
- classLoadertargetRepositoryPath
- location of repo to install into (not in current server)targetServerPath
- location of server to install into (not current server
IOException
- if layouts can't be loaded
Exception
Method Detail |
---|
public DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList) throws Exception
installPluginList
in interface PluginInstaller
targetRepositoryPath
- location of repository in new server (normally "repository")relativeTargetServerPath
- Location of server to assemble relative to current serverpluginList
- list of plugins to install
Exception
- if something goes wrongpublic void mergeOverrides(String server, AttributesType overrides) throws InvalidGBeanException, IOException
mergeOverrides
in interface PluginInstaller
InvalidGBeanException
IOException
public Map getInstalledPlugins()
getInstalledPlugins
in interface PluginInstaller
public PluginType getPluginMetadata(Artifact moduleId)
getPluginMetadata
in interface PluginInstaller
moduleId
- Identifies the configuration. This must match a
configuration currently installed in the local server.
The configId must be fully resolved (isResolved() == true)public void updatePluginMetadata(PluginType metadata)
updatePluginMetadata
in interface PluginInstaller
metadata
- The data to save. The contained configId (which must
be fully resolved) identifies the configuration to save
this for.public PluginListType listPlugins(URL mavenRepository, String username, String password) throws IOException, FailedLoginException
listPlugins
in interface PluginInstaller
mavenRepository
- The base URL to the maven repository. This must
contain the file geronimo-plugins.xmlusername
- 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.
IOException
FailedLoginException
public DownloadResults install(PluginListType pluginsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
install
in interface PluginInstaller
pluginsToInstall
- The list of configurations to installdefaultRepository
- Default repo to look for plugins inrestrictToDefaultRepository
- Whether to follow hints to other plugin repos.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.public void install(PluginListType pluginsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password, DownloadPoller poller)
install
in interface PluginInstaller
pluginsToInstall
- The list of configurations to installdefaultRepository
- Default repo to look for plugins in (not required)restrictToDefaultRepository
- Whether to follow hints to other plugin repos.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 proceedspublic void install(PluginListType pluginsToInstall, SourceRepository defaultRepository, boolean restrictToDefaultRepository, String username, String password, DownloadPoller poller)
public void install(PluginListType pluginsToInstall, SourceRepository defaultRepository, boolean restrictToDefaultRepository, String username, String password, DownloadPoller poller, boolean validatePlugins)
public Object startInstall(PluginListType pluginsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
startInstall
in interface PluginInstaller
pluginsToInstall
- The list of configurations to installdefaultRepository
- Default repo to look for plugins inrestrictToDefaultRepository
- Whether to follow hints to other plugin repos.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. @return A key that can be passed to checkOnInstall
public Object startInstall(File carFile, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
startInstall
in interface PluginInstaller
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
- Default repo to look for plugins inrestrictToDefaultRepository
- Whether to follow hints to other plugin repos.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. @return A key that can be passed to checkOnInstall
public DownloadResults checkOnInstall(Object key)
checkOnInstall
in interface PluginInstaller
key
- Identifies the operation to check onpublic DownloadResults checkOnInstall(Object key, boolean remove)
checkOnInstall
in interface PluginInstaller
key
- Identifies the operation to check onremove
- 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).public void install(File carFile, String defaultRepository, boolean restrictToDefaultRepository, String username, String password, DownloadPoller poller)
carFile
- care file to installdefaultRepository
- Default repo to look for plugins inrestrictToDefaultRepository
- Whether to follow hints to other plugin repos.username
- repo usernamepassword
- repo passwordpoller
- monitor for reporting progresspublic void validatePlugin(PluginType plugin) throws MissingDependencyException
validatePlugin
in interface PluginInstaller
plugin
- plugin to check
MissingDependencyException
- if plugin requires a dependency that is not presentpublic Dependency[] checkPrerequisites(PluginType plugin)
checkPrerequisites
in interface PluginInstaller
plugin
- plugin artifact to check
public Artifact installLibrary(File libFile, String groupId) throws IOException
installLibrary
in interface PluginInstaller
IOException
public static void addGeronimoDependencies(ConfigurationData data, List<DependencyType> deps, boolean includeVersion)
public static DependencyType toDependencyType(Dependency dep, boolean includeVersion)
public static Artifact toArtifact(ArtifactType moduleId)
public static ArtifactType toArtifactType(Artifact id)
public static PluginType copy(PluginType metadata, PluginArtifactType instance)
public static PluginType toKey(PluginType metadata)
public PluginListType createPluginListForRepositories(String repo) throws NoSuchStoreException
createPluginListForRepositories
in interface PluginInstaller
NoSuchStoreException
public static GBeanInfo getGBeanInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |