org.rhq.enterprise.server.plugin.pc.content
Interface DistributionSource


public interface DistributionSource

Indicates a content source has the capability to provide distributions into the server. Distribution synchronization will be done through the calls defined in this interface.

Author:
Pradeep Kilambi

Method Summary
 String getDistFileRemoteLocation(String repoName, String label, String relativeFilename)
           
 InputStream getInputStream(String location)
          Get an input stream for the specified distribution.
 void synchronizeDistribution(String repoName, DistributionSyncReport report, Collection<DistributionDetails> existingDistros)
          Requests that this distribution source perform a synchronization with its external repository.
 

Method Detail

synchronizeDistribution

void synchronizeDistribution(String repoName,
                             DistributionSyncReport report,
                             Collection<DistributionDetails> existingDistros)
                             throws SyncException,
                                    InterruptedException
Requests that this distribution source perform a synchronization with its external repository.

Parameters:
repoName - repo name used to look up distributions
report - used to accumulate the collection of distros
Throws:
Exception - if the source is unable to perform the synchronization, for instance if the external source cannot be connected to.
SyncException
InterruptedException

getInputStream

InputStream getInputStream(String location)
                           throws Exception
Get an input stream for the specified distribution.

Parameters:
location - The location of the distribution.
Returns:
An initialized input stream. The caller is responsible for closing the stream.
Throws:
Exception - if failed to obtain the stream to the remote distribution data

getDistFileRemoteLocation

String getDistFileRemoteLocation(String repoName,
                                 String label,
                                 String relativeFilename)
Parameters:
repoName - Name of repository
label - Distribution Label
relativeFilename - relative path of file to fetch
Returns:
a remote location that can be passed into getInputStream to fetch a file from this source.


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.