Class BaseHlsTaskRunner
- java.lang.Object
-
- org.duracloud.s3task.streaminghls.BaseHlsTaskRunner
-
- All Implemented Interfaces:
TaskRunner
- Direct Known Subclasses:
DeleteHlsTaskRunner,DisableHlsTaskRunner,EnableHlsTaskRunner,GetHlsSignedCookiesUrlTaskRunner,GetUrlHlsTaskRunner
public abstract class BaseHlsTaskRunner extends Object implements TaskRunner
Provides shared capabilities to support HLS streaming
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseHlsTaskRunner.STREAMING_TYPE
-
Field Summary
Fields Modifier and Type Field Description protected StringcfAccountIdprotected com.amazonaws.services.cloudfront.AmazonCloudFrontClientcfClientprotected StringcfKeyIdprotected StringcfKeyPathprotected StringdcHoststatic StringHLS_STREAMING_HOST_PROPstatic StringHLS_STREAMING_TYPE_PROPprotected static intmaxRetriesstatic StringS3_ORIGIN_OAI_PREFIXstatic StringS3_ORIGIN_SUFFIXprotected com.amazonaws.services.s3.AmazonS3s3Clientprotected StorageProviders3Providerprotected S3StorageProviderunwrappedS3Provider
-
Constructor Summary
Constructors Constructor Description BaseHlsTaskRunner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckThatStreamingServiceIsEnabled(String spaceId, String taskName)Determines if a streaming distribution exists for a given spaceprotected List<com.amazonaws.services.cloudfront.model.DistributionSummary>getAllExistingWebDistributions(String bucketName)Determines if a streaming distribution already exists for a given bucketprotected com.amazonaws.services.cloudfront.model.DistributionSummarygetExistingDistribution(String bucketName)Returns the first streaming web distribution associated with a given bucketabstract StringgetName()protected Iterator<String>getSpaceContents(String spaceId)Get a listing of items in a spaceabstract StringperformTask(String taskParameters)protected voidremoveHlsStreamingHostFromSpaceProps(String spaceId)Updates the space properties to no longer include the streaming host value (if the value existed there in the first place)protected voidsetDistributionState(String distId, boolean enabled)Enables or disables an existing distributionprotected voidwait(int index)
-
-
-
Field Detail
-
HLS_STREAMING_HOST_PROP
public static final String HLS_STREAMING_HOST_PROP
- See Also:
- Constant Field Values
-
HLS_STREAMING_TYPE_PROP
public static final String HLS_STREAMING_TYPE_PROP
- See Also:
- Constant Field Values
-
S3_ORIGIN_SUFFIX
public static final String S3_ORIGIN_SUFFIX
- See Also:
- Constant Field Values
-
S3_ORIGIN_OAI_PREFIX
public static final String S3_ORIGIN_OAI_PREFIX
- See Also:
- Constant Field Values
-
maxRetries
protected static final int maxRetries
- See Also:
- Constant Field Values
-
s3Provider
protected StorageProvider s3Provider
-
unwrappedS3Provider
protected S3StorageProvider unwrappedS3Provider
-
s3Client
protected com.amazonaws.services.s3.AmazonS3 s3Client
-
cfClient
protected com.amazonaws.services.cloudfront.AmazonCloudFrontClient cfClient
-
cfAccountId
protected String cfAccountId
-
cfKeyId
protected String cfKeyId
-
cfKeyPath
protected String cfKeyPath
-
dcHost
protected String dcHost
-
-
Method Detail
-
getName
public abstract String getName()
- Specified by:
getNamein interfaceTaskRunner
-
performTask
public abstract String performTask(String taskParameters)
- Specified by:
performTaskin interfaceTaskRunner
-
getExistingDistribution
protected com.amazonaws.services.cloudfront.model.DistributionSummary getExistingDistribution(String bucketName)
Returns the first streaming web distribution associated with a given bucket
-
getAllExistingWebDistributions
protected List<com.amazonaws.services.cloudfront.model.DistributionSummary> getAllExistingWebDistributions(String bucketName)
Determines if a streaming distribution already exists for a given bucket
-
setDistributionState
protected void setDistributionState(String distId, boolean enabled)
Enables or disables an existing distribution- Parameters:
distId- the ID of the distributionenabled- true to enable, false to disable
-
getSpaceContents
protected Iterator<String> getSpaceContents(String spaceId)
Get a listing of items in a space
-
removeHlsStreamingHostFromSpaceProps
protected void removeHlsStreamingHostFromSpaceProps(String spaceId)
Updates the space properties to no longer include the streaming host value (if the value existed there in the first place)
-
wait
protected void wait(int index)
-
checkThatStreamingServiceIsEnabled
protected void checkThatStreamingServiceIsEnabled(String spaceId, String taskName)
Determines if a streaming distribution exists for a given space- Throws:
UnsupportedTaskException- if no distribution exists
-
-