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 PlayReady DRM settings, if any, that you want Elastic Transcoder to apply to the output files associated with this playlist.

PlayReady DRM encrypts your media files using AES-CTR encryption.

If you use DRM for an HLSv3 playlist, your outputs must have a master playlist.

 
 public class PlayReadyDrm implements SerializableCloneable {

    
The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this playlist.

Constraints:
Pattern: (^microsoft$)|(^discretix-3.0$)

 
     private String format;

    
The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

The key must also be encrypted by using AWS KMS.

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

 
     private String key;

    
The MD5 digest of the key used for DRM on your 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;

    
The ID for your DRM key, so that your DRM license provider knows which key to provide.

The key ID must be provided in big endian, and Elastic Transcoder will convert it to little endian before inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your key ID in big or little endian, check with your DRM provider.

Constraints:
Pattern: (^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$)|(^[0-9A-Fa-f]{32}$)

 
     private String keyId;

    
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 files. The initialization vector must be base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic Transcoder generates one for you.

Constraints:
Length: 0 - 255

 
     private String initializationVector;

    
The location of the license key required to play DRM content. The URL must be an absolute path, and is referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS playlist outputs. An example URL looks like this: <programlisting>https://www.example.com/exampleKey/</programlisting>

Constraints:
Length: 1 - 512

    private String licenseAcquisitionUrl;

    
The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this playlist.

Constraints:
Pattern: (^microsoft$)|(^discretix-3.0$)

Returns:
The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this playlist.
    public String getFormat() {
        return ;
    }
    
    
The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this playlist.

Constraints:
Pattern: (^microsoft$)|(^discretix-3.0$)

Parameters:
format The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this playlist.
    public void setFormat(String format) {
        this. = format;
    }
    
    
The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this playlist.

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

Constraints:
Pattern: (^microsoft$)|(^discretix-3.0$)

Parameters:
format The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this playlist.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PlayReadyDrm withFormat(String format) {
        this. = format;
        return this;
    }

    
The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

The key must also be encrypted by using AWS KMS.

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

Returns:
The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

The key must also be encrypted by using AWS KMS.

    public String getKey() {
        return ;
    }
    
    
The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

The key must also be encrypted by using AWS KMS.

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

Parameters:
key The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

The key must also be encrypted by using AWS KMS.

    public void setKey(String key) {
        this. = key;
    }
    
    
The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

The key must also be encrypted by using AWS KMS.

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 The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must be one of the following bit lengths before being base64-encoded:

128, 192, or 256.

The key must also be encrypted by using AWS KMS.

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

    
The MD5 digest of the key used for DRM on your 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:
The MD5 digest of the key used for DRM on your 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 ;
    }
    
    
The MD5 digest of the key used for DRM on your 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 The MD5 digest of the key used for DRM on your 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;
    }
    
    
The MD5 digest of the key used for DRM on your 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 The MD5 digest of the key used for DRM on your 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 PlayReadyDrm withKeyMd5(String keyMd5) {
        this. = keyMd5;
        return this;
    }

    
The ID for your DRM key, so that your DRM license provider knows which key to provide.

The key ID must be provided in big endian, and Elastic Transcoder will convert it to little endian before inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your key ID in big or little endian, check with your DRM provider.

Constraints:
Pattern: (^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$)|(^[0-9A-Fa-f]{32}$)

Returns:
The ID for your DRM key, so that your DRM license provider knows which key to provide.

The key ID must be provided in big endian, and Elastic Transcoder will convert it to little endian before inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your key ID in big or little endian, check with your DRM provider.

    public String getKeyId() {
        return ;
    }
    
    
The ID for your DRM key, so that your DRM license provider knows which key to provide.

The key ID must be provided in big endian, and Elastic Transcoder will convert it to little endian before inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your key ID in big or little endian, check with your DRM provider.

Constraints:
Pattern: (^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$)|(^[0-9A-Fa-f]{32}$)

Parameters:
keyId The ID for your DRM key, so that your DRM license provider knows which key to provide.

The key ID must be provided in big endian, and Elastic Transcoder will convert it to little endian before inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your key ID in big or little endian, check with your DRM provider.

    public void setKeyId(String keyId) {
        this. = keyId;
    }
    
    
The ID for your DRM key, so that your DRM license provider knows which key to provide.

The key ID must be provided in big endian, and Elastic Transcoder will convert it to little endian before inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your key ID in big or little endian, check with your DRM provider.

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

Constraints:
Pattern: (^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$)|(^[0-9A-Fa-f]{32}$)

Parameters:
keyId The ID for your DRM key, so that your DRM license provider knows which key to provide.

The key ID must be provided in big endian, and Elastic Transcoder will convert it to little endian before inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your key ID in big or little endian, check with your DRM provider.

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

    
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 files. The initialization vector must be base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic Transcoder generates one for you.

Constraints:
Length: 0 - 255

Returns:
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 files. The initialization vector must be base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic Transcoder generates one for you.
    public String getInitializationVector() {
        return ;
    }
    
    
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 files. The initialization vector must be base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic Transcoder generates one for you.

Constraints:
Length: 0 - 255

Parameters:
initializationVector 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 files. The initialization vector must be base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic Transcoder generates one for you.
    public void setInitializationVector(String initializationVector) {
        this. = initializationVector;
    }
    
    
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 files. The initialization vector must be base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic Transcoder generates one for you.

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

Constraints:
Length: 0 - 255

Parameters:
initializationVector 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 files. The initialization vector must be base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic Transcoder generates one for you.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PlayReadyDrm withInitializationVector(String initializationVector) {
        this. = initializationVector;
        return this;
    }

    
The location of the license key required to play DRM content. The URL must be an absolute path, and is referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS playlist outputs. An example URL looks like this: <programlisting>https://www.example.com/exampleKey/</programlisting>

Constraints:
Length: 1 - 512

Returns:
The location of the license key required to play DRM content. The URL must be an absolute path, and is referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS playlist outputs. An example URL looks like this: <programlisting>https://www.example.com/exampleKey/</programlisting>
    public String getLicenseAcquisitionUrl() {
        return ;
    }
    
    
The location of the license key required to play DRM content. The URL must be an absolute path, and is referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS playlist outputs. An example URL looks like this: <programlisting>https://www.example.com/exampleKey/</programlisting>

Constraints:
Length: 1 - 512

Parameters:
licenseAcquisitionUrl The location of the license key required to play DRM content. The URL must be an absolute path, and is referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS playlist outputs. An example URL looks like this: <programlisting>https://www.example.com/exampleKey/</programlisting>
    public void setLicenseAcquisitionUrl(String licenseAcquisitionUrl) {
        this. = licenseAcquisitionUrl;
    }
    
    
The location of the license key required to play DRM content. The URL must be an absolute path, and is referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS playlist outputs. An example URL looks like this: <programlisting>https://www.example.com/exampleKey/</programlisting>

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

Constraints:
Length: 1 - 512

Parameters:
licenseAcquisitionUrl The location of the license key required to play DRM content. The URL must be an absolute path, and is referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS playlist outputs. An example URL looks like this: <programlisting>https://www.example.com/exampleKey/</programlisting>
Returns:
A reference to this updated object so that method calls can be chained together.
    public PlayReadyDrm withLicenseAcquisitionUrl(String licenseAcquisitionUrl) {
        this. = licenseAcquisitionUrl;
        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 (getFormat() != nullsb.append("Format: " + getFormat() + ",");
        if (getKey() != nullsb.append("Key: " + getKey() + ",");
        if (getKeyMd5() != nullsb.append("KeyMd5: " + getKeyMd5() + ",");
        if (getKeyId() != nullsb.append("KeyId: " + getKeyId() + ",");
        if (getInitializationVector() != nullsb.append("InitializationVector: " + getInitializationVector() + ",");
        if (getLicenseAcquisitionUrl() != nullsb.append("LicenseAcquisitionUrl: " + getLicenseAcquisitionUrl() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); 
        hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); 
        hashCode = prime * hashCode + ((getKeyMd5() == null) ? 0 : getKeyMd5().hashCode()); 
        hashCode = prime * hashCode + ((getKeyId() == null) ? 0 : getKeyId().hashCode()); 
        hashCode = prime * hashCode + ((getInitializationVector() == null) ? 0 : getInitializationVector().hashCode()); 
        hashCode = prime * hashCode + ((getLicenseAcquisitionUrl() == null) ? 0 : getLicenseAcquisitionUrl().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PlayReadyDrm == falsereturn false;
        PlayReadyDrm other = (PlayReadyDrm)obj;
        
        if (other.getFormat() == null ^ this.getFormat() == nullreturn false;
        if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == 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.getKeyId() == null ^ this.getKeyId() == nullreturn false;
        if (other.getKeyId() != null && other.getKeyId().equals(this.getKeyId()) == 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
        return true;
    }
    
    @Override
    public PlayReadyDrm clone() {
        try {
            return (PlayReadyDrmsuper.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