|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.plugin.pc.content.ContentProviderManager
public class ContentProviderManager
Responsible for managing ContentProvider implementations. These
implementations come from the content plugins themselves.
| Constructor Summary | |
|---|---|
ContentProviderManager()
|
|
| Method Summary | |
|---|---|
protected void |
createInitialAdaptersMap()
This is protected so only the plugin container and subclasses can use it. |
Set<org.rhq.core.domain.content.ContentSource> |
getAllContentSources()
Returns a set of all content sources whose adapters are managed by this object. |
ContentProvider |
getIsolatedContentProvider(int contentProviderId)
Given a ID to a content source, this returns the adapter that is responsible for communicating with that content source where that adapter object will ensure invocations on it are isolated to its plugin classloader. |
protected ContentProvider |
getIsolatedContentSourceAdapter(org.rhq.core.domain.content.ContentSource contentSource)
This returns the adapter that is responsible for communicating with the given content source where that adaptor object will ensure invocations on it are isolated to its plugin classloader. |
protected void |
initialize(ContentServerPluginManager pluginManager)
Tells this manager to initialize itself which will initialize all the adapters. |
protected ContentProvider |
instantiateAdapter(org.rhq.core.domain.content.ContentSource contentSource)
Creates a provider instance that will service the give ContentSource. |
InputStream |
loadDistributionFileBits(int contentSourceId,
String location)
Asks that the adapter responsible for the given content source return a stream to the DistributionFile bits for the DistributionFile at the given location. |
InputStream |
loadPackageBits(int contentSourceId,
String location)
Asks that the adapter responsible for the given content source return a stream to the package bits for the package at the given location. |
void |
restartAdapter(org.rhq.core.domain.content.ContentSource contentSource)
Convienence method that simply shuts down the adapter and then restarts it. |
protected void |
shutdown()
Tells this manager to shutdown. |
void |
shutdownAdapter(org.rhq.core.domain.content.ContentSource contentSource)
Call this method when a content source is removed from the system during runtime or if you just want to shutdown the adapter for whatever reason. |
void |
startAdapter(org.rhq.core.domain.content.ContentSource contentSource)
Call this method when a new content source is added to the system during runtime. |
boolean |
synchronizeContentProvider(int contentSourceId)
Asks the provider responsible for the given content source to synchronize with its remote repository. |
boolean |
synchronizeRepo(int repoId)
Asks each content source associated with the given repo to synchronize the following information for the given repo: Package Metadata Package Bits Distribution Tree Metadata Distribution Tree Bits |
void |
testConnection(int contentSourceId)
Tests the connection to the content source that has the given ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentProviderManager()
| Method Detail |
|---|
public InputStream loadPackageBits(int contentSourceId,
String location)
throws Exception
contentSourceId - the adapter for this content source will be used to stream the
bitslocation - where the adapter can find the package bits on the content
source
Exception - if the adapter failed to load the bits
public InputStream loadDistributionFileBits(int contentSourceId,
String location)
throws Exception
contentSourceId - the adapter for this content source will be used to stream the
bitslocation - where the adapter can find the DistributionFile bits on the
source
Exception - if the adapter failed to load the bits
public boolean synchronizeContentProvider(int contentSourceId)
throws Exception
false (in effect, will
let the currently running synchronization continue; we try not to step on
it). If this method does actually do a sync, true will be
returned.
contentSourceId - identifies the database entry of the provider
true if the synchronization completed;
false if there was already a synchronization
happening and this method aborted
Exceptionpublic boolean synchronizeRepo(int repoId)
repoId - must indicate a valid repo in the database
true if the synchronize took place;
false if it did not (for instance, if there is
already a sync taking place for this repo)
Exception - if the data required to perform the sync is missing or
invalid
public void testConnection(int contentSourceId)
throws Exception
contentSourceId - the id of the content source to be tested
Exception - if the test connection to the specified content source failedpublic Set<org.rhq.core.domain.content.ContentSource> getAllContentSources()
public void startAdapter(org.rhq.core.domain.content.ContentSource contentSource)
throws InitializationException
shutdown.
If there is already an adapter currently started for the given content source, this returns silently.
contentSource - the new content source that was added
InitializationException - if the provider throws an error on its startuppublic void shutdownAdapter(org.rhq.core.domain.content.ContentSource contentSource)
startAdapter(ContentSource).
If there are no adapters currently started for the given content source, this returns silently.
contentSource - the content source being deleted
public void restartAdapter(org.rhq.core.domain.content.ContentSource contentSource)
throws Exception
shuts down the adapter and then restarts it. Call this when, for example, a content source's
configuration has changed.
contentSource - the content source whose adapter is to be restarted
Exception - if there is an error asking the provider to shutdown or start
public ContentProvider getIsolatedContentProvider(int contentProviderId)
throws RuntimeException
contentProviderId - an ID to a ContentSource
RuntimeException - if there is no content source with the given IDprotected void initialize(ContentServerPluginManager pluginManager)
This is protected so only the plugin container and subclasses can use it.
pluginManager - the plugin manager this object can use to obtain information
from (like classloaders)protected void shutdown()
This is protected so only the plugin container and subclasses can use it.
protected void createInitialAdaptersMap()
protected ContentProvider getIsolatedContentSourceAdapter(org.rhq.core.domain.content.ContentSource contentSource)
throws RuntimeException
contentSource - the returned adapter communicates with this content source
RuntimeException - if there is no content source adapter availableprotected ContentProvider instantiateAdapter(org.rhq.core.domain.content.ContentSource contentSource)
ContentSource.
contentSource - the source that the adapter will connect to
null if failed to
create adapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||