Class DownloadDistributionServiceRemoteImpl
java.lang.Object
org.opencastproject.serviceregistry.api.RemoteBase
org.opencastproject.distribution.download.remote.DownloadDistributionServiceRemoteImpl
- All Implemented Interfaces:
DistributionService,DownloadDistributionService
public class DownloadDistributionServiceRemoteImpl
extends RemoteBase
implements DistributionService, DownloadDistributionService
A remote distribution service invoker.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencastproject.serviceregistry.api.RemoteBase
RemoteBase.HttpClientClosingInputStream -
Field Summary
Fields inherited from class org.opencastproject.serviceregistry.api.RemoteBase
client, elementsFromHttpResponse, remoteServiceManager, serviceTypeFields inherited from interface org.opencastproject.distribution.api.DistributionService
CONFIG_KEY_STORE_TYPE, JOB_TYPE_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivate(org.osgi.service.component.ComponentContext cc) activates the componentdistribute(String channelId, MediaPackage mediaPackage, String elementId) Distribute a media package element.distribute(String channelId, MediaPackage mediaPackage, String elementId, boolean checkAvailability) distribute(String channelId, MediaPackage mediaPackage, Set<String> elementIds, boolean checkAvailability) distribute(String channelId, MediaPackage mediaPackage, Set<String> elementIds, boolean checkAvailability, boolean preserveReference) distributeSync(String channelId, MediaPackage mediapackage, String elementId) Distributes a media package element synchronously, bypassing the Opencast job system.distributeSync(String channelId, MediaPackage mediapackage, Set<String> elementIds, boolean checkAvailability) Distributes the given elements synchronously.Returns the distribution type for this service.retract(String channelId, MediaPackage mediaPackage, String elementId) Retract a media package element from the distribution channel.retract(String channelId, MediaPackage mediaPackage, Set<String> elementIds) retractSync(String channelId, MediaPackage mediaPackage, String elementId) Retract a media package element from the distribution channel synchronously, bypassing the Opencast job system.retractSync(String channelId, MediaPackage mediaPackage, Set<String> elementIds) Retracts the given elements synchronously.voidsetRemoteServiceManager(ServiceRegistry serviceRegistry) Sets the remote service manager.voidsetTrustedHttpClient(TrustedHttpClient trustedHttpClient) Sets the trusted http clientMethods inherited from class org.opencastproject.serviceregistry.api.RemoteBase
closeConnection, getResponse, getResponse, runRequest
-
Constructor Details
-
DownloadDistributionServiceRemoteImpl
public DownloadDistributionServiceRemoteImpl()
-
-
Method Details
-
getDistributionType
Description copied from interface:DistributionServiceReturns the distribution type for this service. This type should be unique within an Opencast instance, and is used to select where file distribution happens.- Specified by:
getDistributionTypein interfaceDistributionService- Returns:
- The distribution type. A string like "download", or "streaming"
-
activate
protected void activate(org.osgi.service.component.ComponentContext cc) activates the component -
distribute
public Job distribute(String channelId, MediaPackage mediaPackage, String elementId) throws DistributionException Description copied from interface:DistributionServiceDistribute a media package element.- Specified by:
distributein interfaceDistributionService- Parameters:
mediaPackage- the media packageelementId- the element in the media package to distribute- Returns:
- The job
- Throws:
DistributionException- if there was a problem distributing the media
-
distribute
public Job distribute(String channelId, MediaPackage mediaPackage, String elementId, boolean checkAvailability) throws DistributionException - Specified by:
distributein interfaceDownloadDistributionService- Throws:
DistributionException
-
distribute
public Job distribute(String channelId, MediaPackage mediaPackage, Set<String> elementIds, boolean checkAvailability) throws DistributionException - Specified by:
distributein interfaceDownloadDistributionService- Throws:
DistributionException
-
distribute
public Job distribute(String channelId, MediaPackage mediaPackage, Set<String> elementIds, boolean checkAvailability, boolean preserveReference) throws DistributionException - Specified by:
distributein interfaceDownloadDistributionService- Throws:
DistributionException
-
retract
public Job retract(String channelId, MediaPackage mediaPackage, String elementId) throws DistributionException Description copied from interface:DistributionServiceRetract a media package element from the distribution channel.- Specified by:
retractin interfaceDistributionService- Parameters:
mediaPackage- the media packageelementId- the media package element to retract- Throws:
DistributionException- if there was a problem retracting the mediapackage
-
retract
public Job retract(String channelId, MediaPackage mediaPackage, Set<String> elementIds) throws DistributionException - Specified by:
retractin interfaceDownloadDistributionService- Throws:
DistributionException
-
distributeSync
public List<MediaPackageElement> distributeSync(String channelId, MediaPackage mediapackage, String elementId) throws DistributionException, MediaPackageException Description copied from interface:DistributionServiceDistributes a media package element synchronously, bypassing the Opencast job system.- Specified by:
distributeSyncin interfaceDistributionService- Parameters:
mediapackage- the media packageelementId- the element in the media package to distribute- Returns:
- list of distributed media package elements
- Throws:
DistributionException- if there was a problem distributing the mediaMediaPackageException- if there was a problem with the mediapackage element
-
distributeSync
public List<MediaPackageElement> distributeSync(String channelId, MediaPackage mediapackage, Set<String> elementIds, boolean checkAvailability) throws DistributionException Description copied from interface:DownloadDistributionServiceDistributes the given elements synchronously. This should be used rarely since load balancing will be unavailable. However, since the dispatching logic is bypassed, synchronous execution is much faster. It is useful in interactive scenarios where you synchronously wait for job execution anyway and you don't want to make the user waiting for too long.- Specified by:
distributeSyncin interfaceDownloadDistributionService- Parameters:
channelId- The channel to retract from.mediapackage- A media package holding the elements to retract.elementIds- The IDs of the elements to retract.checkAvailability- Whether to check if the distributed elements are available through their URI.- Returns:
- The distributed elements.
- Throws:
DistributionException- In case distribution fails.
-
retractSync
public List<MediaPackageElement> retractSync(String channelId, MediaPackage mediaPackage, String elementId) throws DistributionException Description copied from interface:DistributionServiceRetract a media package element from the distribution channel synchronously, bypassing the Opencast job system.- Specified by:
retractSyncin interfaceDistributionService- Parameters:
mediaPackage- the media packageelementId- the media package element to retract- Returns:
- list of retracted media package elements
- Throws:
DistributionException- if there was a problem retracting the mediapackage
-
retractSync
public List<MediaPackageElement> retractSync(String channelId, MediaPackage mediaPackage, Set<String> elementIds) throws DistributionException Description copied from interface:DownloadDistributionServiceRetracts the given elements synchronously. This should be used rarely since load balancing will be unavailable. However, since the dispatching logic is bypassed, synchronous execution is much faster. It is useful in interactive scenarios where you synchronously wait for job execution anyway and you don't want to make the user waiting for too long.- Specified by:
retractSyncin interfaceDownloadDistributionService- Parameters:
channelId- The channel to retract from.mediaPackage- A media package holding the elements to retract.elementIds- The IDs of the elements to retract.- Returns:
- The retracted elements.
- Throws:
DistributionException- In case retraction fails.
-
setTrustedHttpClient
Description copied from class:RemoteBaseSets the trusted http client- Overrides:
setTrustedHttpClientin classRemoteBase- Parameters:
trustedHttpClient-
-
setRemoteServiceManager
Description copied from class:RemoteBaseSets the remote service manager.- Overrides:
setRemoteServiceManagerin classRemoteBase- Parameters:
serviceRegistry-
-