Class WowzaStreamingDistributionService
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.distribution.api.AbstractDistributionService
org.opencastproject.distribution.streaming.wowza.WowzaStreamingDistributionService
- All Implemented Interfaces:
DistributionService,StreamingDistributionService,JobProducer
public class WowzaStreamingDistributionService
extends AbstractDistributionService
implements StreamingDistributionService
Distributes media to the local media delivery directory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatThe load on the system introduced by creating a distribute jobstatic final floatThe load on the system introduced by creating a retract jobprotected static final StringDefault schemestatic final StringThe key to look for in the service configuration file to override theDEFAULT_DISTRIBUTE_JOB_LOADstatic final StringReceipt typestatic final StringThe key to look for in the service configuration file to override theDEFAULT_RETRACT_JOB_LOADprotected static final StringThe key in the properties file that specifies in which order the videos in the SMIL file should be storedprotected static final StringThe key in the properties file that defines the streaming directory.protected static final StringThe key in the properties file that defines the streaming formats to distribute.protected static final StringThe tenant specific key in the properties file that defines the wowza port.protected static final StringThe tenant-specific key in the properties file that defines the wowza url.Fields inherited from class org.opencastproject.distribution.api.AbstractDistributionService
distributionChannel, organizationDirectoryService, securityService, serviceRegistry, serviceUrl, trustedHttpClient, userDirectoryService, workspaceFields inherited from class org.opencastproject.job.api.AbstractJobProducer
ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobTypeFields inherited from interface org.opencastproject.distribution.api.DistributionService
CONFIG_KEY_STORE_TYPE, JOB_TYPE_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the streaming distribution service. -
Method Summary
Modifier and TypeMethodDescriptionvoiddistribute(String channelId, MediaPackage mediapackage, String elementId) Distribute a media package element.distribute(String channelId, MediaPackage mediapackage, Set<String> elementIds) 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) Distributes the given elements synchronously.Returns the distribution type for this service.voidprotected StringAsks the overriding class to process the arguments using the given operation.booleanChecks if streaming is enabled for the current tenant.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.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) Sets a reference to the organization directory service.voidsetSecurityService(SecurityService securityService) Callback for setting the security service.voidsetServiceRegistry(ServiceRegistry serviceRegistry) Callback for the OSGi environment to set the service registry reference.voidsetUserDirectoryService(UserDirectoryService userDirectoryService) Callback for setting the user directory service.voidsetWorkspace(Workspace workspace) Callback for the OSGi environment to set the workspace reference.Methods inherited from class org.opencastproject.distribution.api.AbstractDistributionService
getOrganizationDirectoryService, getSecurityService, getServiceRegistry, getTrustedHttpClient, getUserDirectoryService, setTrustedHttpClientMethods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, activate, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
STREAMING_DIRECTORY_KEY
The key in the properties file that defines the streaming directory.- See Also:
-
WOWZA_FORMATS_KEY
The key in the properties file that defines the streaming formats to distribute.- See Also:
-
WOWZA_URL_KEY
The tenant-specific key in the properties file that defines the wowza url.- See Also:
-
WOWZA_PORT_KEY
The tenant specific key in the properties file that defines the wowza port.- See Also:
-
streamingUrls
-
SMIL_ORDER_KEY
The key in the properties file that specifies in which order the videos in the SMIL file should be stored- See Also:
-
DEFAULT_SCHEME
Default scheme- See Also:
-
JOB_TYPE
Receipt type- See Also:
-
DEFAULT_DISTRIBUTE_JOB_LOAD
public static final float DEFAULT_DISTRIBUTE_JOB_LOADThe load on the system introduced by creating a distribute job- See Also:
-
DEFAULT_RETRACT_JOB_LOAD
public static final float DEFAULT_RETRACT_JOB_LOADThe load on the system introduced by creating a retract job- See Also:
-
DISTRIBUTE_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_DISTRIBUTE_JOB_LOAD- See Also:
-
RETRACT_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_RETRACT_JOB_LOAD- See Also:
-
-
Constructor Details
-
WowzaStreamingDistributionService
public WowzaStreamingDistributionService()Creates a new instance of the streaming distribution service.
-
-
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
public void activate(org.osgi.framework.BundleContext bundleContext, Map<String, Object> properties) throws org.osgi.service.component.ComponentException, org.osgi.service.cm.ConfigurationException- Throws:
org.osgi.service.component.ComponentExceptionorg.osgi.service.cm.ConfigurationException
-
modified
public void modified(org.osgi.framework.BundleContext bundleContext, Map<String, Object> properties) throws org.osgi.service.component.ComponentException, org.osgi.service.cm.ConfigurationException- Throws:
org.osgi.service.component.ComponentExceptionorg.osgi.service.cm.ConfigurationException
-
publishToStreaming
public boolean publishToStreaming()Description copied from interface:StreamingDistributionServiceChecks if streaming is enabled for the current tenant.- Specified by:
publishToStreamingin interfaceStreamingDistributionService- Returns:
- whether streaming is enabled for the current tenant
-
distribute
public Job distribute(String channelId, MediaPackage mediapackage, Set<String> elementIds) throws DistributionException - Specified by:
distributein interfaceStreamingDistributionService- Throws:
DistributionException- See Also:
-
distribute
public Job distribute(String channelId, MediaPackage mediapackage, String elementId) throws DistributionException Distribute 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- See Also:
-
retract
public Job retract(String channelId, MediaPackage mediapackage, String elementId) throws DistributionException Retract 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- See Also:
-
retract
public Job retract(String channelId, MediaPackage mediaPackage, Set<String> elementIds) throws DistributionException - Specified by:
retractin interfaceStreamingDistributionService- Throws:
DistributionException- See Also:
-
distributeSync
public List<MediaPackageElement> distributeSync(String channelId, MediaPackage mediaPackage, String elementId) throws DistributionException 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 media
-
distributeSync
public List<MediaPackageElement> distributeSync(String channelId, MediaPackage mediaPackage, Set<String> elementIds) throws DistributionException Description copied from interface:StreamingDistributionServiceDistributes 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 interfaceStreamingDistributionService- 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 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:StreamingDistributionServiceRetracts 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 interfaceStreamingDistributionService- 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.
-
process
Asks the overriding class to process the arguments using the given operation. The result will be added to the associated job as the payload.- Specified by:
processin classAbstractJobProducer- Parameters:
job- the job to process- Returns:
- the operation result
- Throws:
Exception- See Also:
-
getDistributionDirectory
-
setWorkspace
Description copied from class:AbstractDistributionServiceCallback for the OSGi environment to set the workspace reference.- Overrides:
setWorkspacein classAbstractDistributionService- Parameters:
workspace- the workspace
-
setServiceRegistry
Description copied from class:AbstractDistributionServiceCallback for the OSGi environment to set the service registry reference.- Overrides:
setServiceRegistryin classAbstractDistributionService- Parameters:
serviceRegistry- the service registry
-
setSecurityService
Description copied from class:AbstractDistributionServiceCallback for setting the security service.- Overrides:
setSecurityServicein classAbstractDistributionService- Parameters:
securityService- the securityService to set
-
setUserDirectoryService
Description copied from class:AbstractDistributionServiceCallback for setting the user directory service.- Overrides:
setUserDirectoryServicein classAbstractDistributionService- Parameters:
userDirectoryService- the userDirectoryService to set
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) Description copied from class:AbstractDistributionServiceSets a reference to the organization directory service.- Overrides:
setOrganizationDirectoryServicein classAbstractDistributionService- Parameters:
organizationDirectoryService- the organization directory
-