|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.rhq.enterprise.server.plugins.url.UrlProvider
public class UrlProvider
This is a basic implementation of a content source that provides primative package synchronization with a URL-based content source, such as an HTTP server. In order for this URL content source to properly scan and find content in the remote server, an index file must exist that provides metadata about each file. There are two forms of the index metadata file. The simple form is a list of each file relative to the root URL location. This index file can include paths to subdirectories under the root URL. The index file must be named "content-index.txt" unless overridden by the content source's configuration setting. The metadata stored in this simple index file describes the packages. Each line in the simple index file must be a single filename, followed by the MD5 of the files:
release-v1.0.zip|abe347586edbc6723461253457687bef release-v2.0.zip|456834fed6edb3452346125345768723d patches/patch-123.jar|56bc47586e5456edfb6a2534e7687345 patches/patch-4567.jar|dcb567886eabc6723461253457687befNote that this is a very inefficient type of content source because of the lack of metadata. Because the only thing we know is the URL to a piece of content and nothing else, the only way to determine things like version number is to possible download the content to scan it. The other index file supported is an XML file that contains the full set of metadata needed to fully define a package. Its XML file has a schema - look at the schema for the full syntax. Subclasses can override this class if they want to support more full-featured metadata (for example, an RSS feed found at the index URL). The index file can be specified as a full URL - if it is not, it will be assumed relative to the root URL.
| Constructor Summary | |
|---|---|
UrlProvider()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UrlProvider()
| Method Detail |
|---|
protected String getRootUrlString()
protected URL getRootUrl()
protected void setRootUrl(URL url)
protected URL getIndexUrl()
protected void setIndexUrl(URL indexURL)
protected Map<String,RemotePackageInfo.SupportedPackageType> getSupportedPackageTypes()
protected void setSupportedPackageTypes(Map<String,RemotePackageInfo.SupportedPackageType> supportedPackageTypes)
public void initialize(Configuration configuration)
throws Exception
initialize in interface ContentProviderExceptionpublic void shutdown()
shutdown in interface ContentProvider
public void synchronizePackages(String repoName,
PackageSyncReport report,
Collection<ContentProviderPackageDetails> existingPackages)
throws SyncException
synchronizePackages in interface PackageSourceSyncException
public void testConnection()
throws Exception
testConnection in interface ContentProviderException
public InputStream getInputStream(String location)
throws Exception
getInputStream in interface PackageSourceException
protected InputStream getIndexInputStream()
throws Exception
index file content.
Exception
protected Map<String,RemotePackageInfo> getRemotePackageInfosFromIndex()
throws Exception
index file.
Exception - if the index file is missing or cannot be processed
protected void syncPackage(PackageSyncReport report,
List<ContentProviderPackageDetails> packages,
RemotePackageInfo rpi)
throws Exception
packages if they exist
leaving only packages remaining that do not exist on the remote system.
report - the report that we are building uppackages - existing packages not yet found on the remote system but exist in server inventoryrpi - information about the package that needs to be synced
Exception - if the sync fails
protected ContentProviderPackageDetails createPackage(RemotePackageInfo rpi)
throws Exception
rpi - information about the remote package
Exception
protected ContentProviderPackageDetails findPackage(List<ContentProviderPackageDetails> packages,
ContentProviderPackageDetails pkg)
protected void initializePackageTypes(Configuration config)
protected RemotePackageInfo.SupportedPackageType determinePackageType(RemotePackageInfo rpi)
public SyncProgressWeight getSyncProgressWeight()
getSyncProgressWeight in interface ContentProvider
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||