Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.elastictranscoder.model;
 

The HLS content protection settings, if any, that you want Elastic Transcoder to apply to your output files.

 
 public class HlsContentProtection implements SerializableCloneable {

    
The content protection method for your output. The only valid value is: aes-128.

This value will be written into the method attribute of the EXT-X-KEY metadata tag in the output playlist.

Constraints:
Pattern: (^aes-128$)

 
     private String method;

    
If you want Elastic Transcoder to generate a key for you, leave this field blank.

If you choose to supply your own key, you must encrypt the key by using AWS KMS. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

Constraints:
Pattern: ^$|(^(?:[A-Za-z0-9\+/]{4})*(?:[A-Za-z0-9\+/]{2}==|[A-Za-z0-9\+/]{3}=)?$)

 
     private String key;

    
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The MD5 digest of the key that you want Elastic Transcoder to use to encrypt your output file, and that you want Elastic Transcoder to use as a checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must be exactly 16 bytes before being base64- encoded.

Constraints:
Pattern: ^$|(^(?:[A-Za-z0-9\+/]{4})*(?:[A-Za-z0-9\+/]{2}==|[A-Za-z0-9\+/]{3}=)?$)

 
     private String keyMd5;

    
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The series of random bits created by a random bit generator, unique for every encryption operation, that you want Elastic Transcoder to use to encrypt your output files. The initialization vector must be base64-encoded, and it must be exactly 16 bytes before being base64-encoded.

Constraints:
Length: 0 - 255

 
     private String initializationVector;

    
The location of the license key required to decrypt your HLS playlist. The URL must be an absolute path, and is referenced in the URI attribute of the EXT-X-KEY metadata tag in the playlist file.

Constraints:
Length: 0 - 512

 
     private String licenseAcquisitionUrl;

    
Specify whether you want Elastic Transcoder to write your HLS license key to an Amazon S3 bucket. If you choose WithVariantPlaylists, LicenseAcquisitionUrl must be left blank and Elastic Transcoder writes your data key into the same bucket as the associated playlist.

Constraints:
Pattern: (^NoStore$)|(^WithVariantPlaylists$)

 
     private String keyStoragePolicy;

    
The content protection method for your output. The only valid value is: aes-128.

This value will be written into the method attribute of the EXT-X-KEY metadata tag in the output playlist.

Constraints:
Pattern: (^aes-128$)

Returns:
The content protection method for your output. The only valid value is: aes-128.

This value will be written into the method attribute of the EXT-X-KEY metadata tag in the output playlist.

    public String getMethod() {
        return ;
    }
    
    
The content protection method for your output. The only valid value is: aes-128.

This value will be written into the method attribute of the EXT-X-KEY metadata tag in the output playlist.

Constraints:
Pattern: (^aes-128$)

Parameters:
method The content protection method for your output. The only valid value is: aes-128.

This value will be written into the method attribute of the EXT-X-KEY metadata tag in the output playlist.

    public void setMethod(String method) {
        this. = method;
    }
    
    
The content protection method for your output. The only valid value is: aes-128.

This value will be written into the method attribute of the EXT-X-KEY metadata tag in the output playlist.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: (^aes-128$)

Parameters:
method The content protection method for your output. The only valid value is: aes-128.

This value will be written into the method attribute of the EXT-X-KEY metadata tag in the output playlist.

Returns:
A reference to this updated object so that method calls can be chained together.
    public HlsContentProtection withMethod(String method) {
        this. = method;
        return this;
    }

    
If you want Elastic Transcoder to generate a key for you, leave this field blank.

If you choose to supply your own key, you must encrypt the key by using AWS KMS. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

Constraints:
Pattern: ^$|(^(?:[A-Za-z0-9\+/]{4})*(?:[A-Za-z0-9\+/]{2}==|[A-Za-z0-9\+/]{3}=)?$)

Returns:
If you want Elastic Transcoder to generate a key for you, leave this field blank.

If you choose to supply your own key, you must encrypt the key by using AWS KMS. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

    public String getKey() {
        return ;
    }
    
    
If you want Elastic Transcoder to generate a key for you, leave this field blank.

If you choose to supply your own key, you must encrypt the key by using AWS KMS. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

Constraints:
Pattern: ^$|(^(?:[A-Za-z0-9\+/]{4})*(?:[A-Za-z0-9\+/]{2}==|[A-Za-z0-9\+/]{3}=)?$)

Parameters:
key If you want Elastic Transcoder to generate a key for you, leave this field blank.

If you choose to supply your own key, you must encrypt the key by using AWS KMS. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

    public void setKey(String key) {
        this. = key;
    }
    
    
If you want Elastic Transcoder to generate a key for you, leave this field blank.

If you choose to supply your own key, you must encrypt the key by using AWS KMS. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: ^$|(^(?:[A-Za-z0-9\+/]{4})*(?:[A-Za-z0-9\+/]{2}==|[A-Za-z0-9\+/]{3}=)?$)

Parameters:
key If you want Elastic Transcoder to generate a key for you, leave this field blank.

If you choose to supply your own key, you must encrypt the key by using AWS KMS. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

Returns:
A reference to this updated object so that method calls can be chained together.
    public HlsContentProtection withKey(String key) {
        this. = key;
        return this;
    }

    
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The MD5 digest of the key that you want Elastic Transcoder to use to encrypt your output file, and that you want Elastic Transcoder to use as a checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must be exactly 16 bytes before being base64- encoded.

Constraints:
Pattern: ^$|(^(?:[A-Za-z0-9\+/]{4})*(?:[A-Za-z0-9\+/]{2}==|[A-Za-z0-9\+/]{3}=)?$)

Returns:
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The MD5 digest of the key that you want Elastic Transcoder to use to encrypt your output file, and that you want Elastic Transcoder to use as a checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must be exactly 16 bytes before being base64- encoded.

    public String getKeyMd5() {
        return ;
    }
    
    
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The MD5 digest of the key that you want Elastic Transcoder to use to encrypt your output file, and that you want Elastic Transcoder to use as a checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must be exactly 16 bytes before being base64- encoded.

Constraints:
Pattern: ^$|(^(?:[A-Za-z0-9\+/]{4})*(?:[A-Za-z0-9\+/]{2}==|[A-Za-z0-9\+/]{3}=)?$)

Parameters:
keyMd5 If Elastic Transcoder is generating your key for you, you must leave this field blank.

The MD5 digest of the key that you want Elastic Transcoder to use to encrypt your output file, and that you want Elastic Transcoder to use as a checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must be exactly 16 bytes before being base64- encoded.

    public void setKeyMd5(String keyMd5) {
        this. = keyMd5;
    }
    
    
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The MD5 digest of the key that you want Elastic Transcoder to use to encrypt your output file, and that you want Elastic Transcoder to use as a checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must be exactly 16 bytes before being base64- encoded.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: ^$|(^(?:[A-Za-z0-9\+/]{4})*(?:[A-Za-z0-9\+/]{2}==|[A-Za-z0-9\+/]{3}=)?$)

Parameters:
keyMd5 If Elastic Transcoder is generating your key for you, you must leave this field blank.

The MD5 digest of the key that you want Elastic Transcoder to use to encrypt your output file, and that you want Elastic Transcoder to use as a checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must be exactly 16 bytes before being base64- encoded.

Returns:
A reference to this updated object so that method calls can be chained together.
    public HlsContentProtection withKeyMd5(String keyMd5) {
        this. = keyMd5;
        return this;
    }

    
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The series of random bits created by a random bit generator, unique for every encryption operation, that you want Elastic Transcoder to use to encrypt your output files. The initialization vector must be base64-encoded, and it must be exactly 16 bytes before being base64-encoded.

Constraints:
Length: 0 - 255

Returns:
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The series of random bits created by a random bit generator, unique for every encryption operation, that you want Elastic Transcoder to use to encrypt your output files. The initialization vector must be base64-encoded, and it must be exactly 16 bytes before being base64-encoded.

    public String getInitializationVector() {
        return ;
    }
    
    
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The series of random bits created by a random bit generator, unique for every encryption operation, that you want Elastic Transcoder to use to encrypt your output files. The initialization vector must be base64-encoded, and it must be exactly 16 bytes before being base64-encoded.

Constraints:
Length: 0 - 255

Parameters:
initializationVector If Elastic Transcoder is generating your key for you, you must leave this field blank.

The series of random bits created by a random bit generator, unique for every encryption operation, that you want Elastic Transcoder to use to encrypt your output files. The initialization vector must be base64-encoded, and it must be exactly 16 bytes before being base64-encoded.

    public void setInitializationVector(String initializationVector) {
        this. = initializationVector;
    }
    
    
If Elastic Transcoder is generating your key for you, you must leave this field blank.

The series of random bits created by a random bit generator, unique for every encryption operation, that you want Elastic Transcoder to use to encrypt your output files. The initialization vector must be base64-encoded, and it must be exactly 16 bytes before being base64-encoded.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 255

Parameters:
initializationVector If Elastic Transcoder is generating your key for you, you must leave this field blank.

The series of random bits created by a random bit generator, unique for every encryption operation, that you want Elastic Transcoder to use to encrypt your output files. The initialization vector must be base64-encoded, and it must be exactly 16 bytes before being base64-encoded.

Returns:
A reference to this updated object so that method calls can be chained together.
    public HlsContentProtection withInitializationVector(String initializationVector) {
        this. = initializationVector;
        return this;
    }

    
The location of the license key required to decrypt your HLS playlist. The URL must be an absolute path, and is referenced in the URI attribute of the EXT-X-KEY metadata tag in the playlist file.

Constraints:
Length: 0 - 512

Returns:
The location of the license key required to decrypt your HLS playlist. The URL must be an absolute path, and is referenced in the URI attribute of the EXT-X-KEY metadata tag in the playlist file.
    public String getLicenseAcquisitionUrl() {
        return ;
    }
    
    
The location of the license key required to decrypt your HLS playlist. The URL must be an absolute path, and is referenced in the URI attribute of the EXT-X-KEY metadata tag in the playlist file.

Constraints:
Length: 0 - 512

Parameters:
licenseAcquisitionUrl The location of the license key required to decrypt your HLS playlist. The URL must be an absolute path, and is referenced in the URI attribute of the EXT-X-KEY metadata tag in the playlist file.
    public void setLicenseAcquisitionUrl(String licenseAcquisitionUrl) {
        this. = licenseAcquisitionUrl;
    }
    
    
The location of the license key required to decrypt your HLS playlist. The URL must be an absolute path, and is referenced in the URI attribute of the EXT-X-KEY metadata tag in the playlist file.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 512

Parameters:
licenseAcquisitionUrl The location of the license key required to decrypt your HLS playlist. The URL must be an absolute path, and is referenced in the URI attribute of the EXT-X-KEY metadata tag in the playlist file.
Returns:
A reference to this updated object so that method calls can be chained together.
    public HlsContentProtection withLicenseAcquisitionUrl(String licenseAcquisitionUrl) {
        this. = licenseAcquisitionUrl;
        return this;
    }

    
Specify whether you want Elastic Transcoder to write your HLS license key to an Amazon S3 bucket. If you choose WithVariantPlaylists, LicenseAcquisitionUrl must be left blank and Elastic Transcoder writes your data key into the same bucket as the associated playlist.

Constraints:
Pattern: (^NoStore$)|(^WithVariantPlaylists$)

Returns:
Specify whether you want Elastic Transcoder to write your HLS license key to an Amazon S3 bucket. If you choose WithVariantPlaylists, LicenseAcquisitionUrl must be left blank and Elastic Transcoder writes your data key into the same bucket as the associated playlist.
    public String getKeyStoragePolicy() {
        return ;
    }
    
    
Specify whether you want Elastic Transcoder to write your HLS license key to an Amazon S3 bucket. If you choose WithVariantPlaylists, LicenseAcquisitionUrl must be left blank and Elastic Transcoder writes your data key into the same bucket as the associated playlist.

Constraints:
Pattern: (^NoStore$)|(^WithVariantPlaylists$)

Parameters:
keyStoragePolicy Specify whether you want Elastic Transcoder to write your HLS license key to an Amazon S3 bucket. If you choose WithVariantPlaylists, LicenseAcquisitionUrl must be left blank and Elastic Transcoder writes your data key into the same bucket as the associated playlist.
    public void setKeyStoragePolicy(String keyStoragePolicy) {
        this. = keyStoragePolicy;
    }
    
    
Specify whether you want Elastic Transcoder to write your HLS license key to an Amazon S3 bucket. If you choose WithVariantPlaylists, LicenseAcquisitionUrl must be left blank and Elastic Transcoder writes your data key into the same bucket as the associated playlist.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: (^NoStore$)|(^WithVariantPlaylists$)

Parameters:
keyStoragePolicy Specify whether you want Elastic Transcoder to write your HLS license key to an Amazon S3 bucket. If you choose WithVariantPlaylists, LicenseAcquisitionUrl must be left blank and Elastic Transcoder writes your data key into the same bucket as the associated playlist.
Returns:
A reference to this updated object so that method calls can be chained together.
    public HlsContentProtection withKeyStoragePolicy(String keyStoragePolicy) {
        this. = keyStoragePolicy;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getMethod() != nullsb.append("Method: " + getMethod() + ",");
        if (getKey() != nullsb.append("Key: " + getKey() + ",");
        if (getKeyMd5() != nullsb.append("KeyMd5: " + getKeyMd5() + ",");
        if (getInitializationVector() != nullsb.append("InitializationVector: " + getInitializationVector() + ",");
        if (getLicenseAcquisitionUrl() != nullsb.append("LicenseAcquisitionUrl: " + getLicenseAcquisitionUrl() + ",");
        if (getKeyStoragePolicy() != nullsb.append("KeyStoragePolicy: " + getKeyStoragePolicy() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getMethod() == null) ? 0 : getMethod().hashCode()); 
        hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); 
        hashCode = prime * hashCode + ((getKeyMd5() == null) ? 0 : getKeyMd5().hashCode()); 
        hashCode = prime * hashCode + ((getInitializationVector() == null) ? 0 : getInitializationVector().hashCode()); 
        hashCode = prime * hashCode + ((getLicenseAcquisitionUrl() == null) ? 0 : getLicenseAcquisitionUrl().hashCode()); 
        hashCode = prime * hashCode + ((getKeyStoragePolicy() == null) ? 0 : getKeyStoragePolicy().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof HlsContentProtection == falsereturn false;
        HlsContentProtection other = (HlsContentProtection)obj;
        
        if (other.getMethod() == null ^ this.getMethod() == nullreturn false;
        if (other.getMethod() != null && other.getMethod().equals(this.getMethod()) == falsereturn false
        if (other.getKey() == null ^ this.getKey() == nullreturn false;
        if (other.getKey() != null && other.getKey().equals(this.getKey()) == falsereturn false
        if (other.getKeyMd5() == null ^ this.getKeyMd5() == nullreturn false;
        if (other.getKeyMd5() != null && other.getKeyMd5().equals(this.getKeyMd5()) == falsereturn false
        if (other.getInitializationVector() == null ^ this.getInitializationVector() == nullreturn false;
        if (other.getInitializationVector() != null && other.getInitializationVector().equals(this.getInitializationVector()) == falsereturn false
        if (other.getLicenseAcquisitionUrl() == null ^ this.getLicenseAcquisitionUrl() == nullreturn false;
        if (other.getLicenseAcquisitionUrl() != null && other.getLicenseAcquisitionUrl().equals(this.getLicenseAcquisitionUrl()) == falsereturn false
        if (other.getKeyStoragePolicy() == null ^ this.getKeyStoragePolicy() == nullreturn false;
        if (other.getKeyStoragePolicy() != null && other.getKeyStoragePolicy().equals(this.getKeyStoragePolicy()) == falsereturn false
        return true;
    }
    
    @Override
    public HlsContentProtection clone() {
        try {
            return (HlsContentProtectionsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X