public class UrlProvider extends Object implements ContentProvider, PackageSource
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 and Description |
|---|
UrlProvider() |
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 ContentProviderpublic void synchronizePackages(String repoName, PackageSyncReport report, Collection<ContentProviderPackageDetails> existingPackages) throws SyncException
synchronizePackages in interface PackageSourceSyncExceptionpublic void testConnection()
throws Exception
testConnection in interface ContentProviderExceptionpublic InputStream getInputStream(String location) throws Exception
getInputStream in interface PackageSourceExceptionprotected InputStream getIndexInputStream() throws Exception
index file content.Exceptionprotected Map<String,RemotePackageInfo> getRemotePackageInfosFromIndex() throws Exception
index file.Exception - if the index file is missing or cannot be processedprotected 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 syncedException - if the sync failsprotected ContentProviderPackageDetails createPackage(RemotePackageInfo rpi) throws Exception
rpi - information about the remote packageExceptionprotected ContentProviderPackageDetails findPackage(List<ContentProviderPackageDetails> packages, ContentProviderPackageDetails pkg)
protected void initializePackageTypes(Configuration config)
protected RemotePackageInfo.SupportedPackageType determinePackageType(RemotePackageInfo rpi)
public SyncProgressWeight getSyncProgressWeight()
getSyncProgressWeight in interface ContentProviderCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.