
software.amazon.awssdk.services.medialive.model.SrtCallerSourceRequest Maven / Gradle / Ivy
/*
* Copyright 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 software.amazon.awssdk.services.medialive.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* Configures the connection for a source that uses SRT as the connection protocol. In terms of establishing the
* connection, MediaLive is always the caller and the upstream system is always the listener. In terms of transmission
* of the source content, MediaLive is always the receiver and the upstream system is always the sender.
*/
@Generated("software.amazon.awssdk:codegen")
public final class SrtCallerSourceRequest implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DECRYPTION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Decryption")
.getter(getter(SrtCallerSourceRequest::decryption)).setter(setter(Builder::decryption))
.constructor(SrtCallerDecryptionRequest::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("decryption").build()).build();
private static final SdkField MINIMUM_LATENCY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MinimumLatency").getter(getter(SrtCallerSourceRequest::minimumLatency))
.setter(setter(Builder::minimumLatency))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("minimumLatency").build()).build();
private static final SdkField SRT_LISTENER_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SrtListenerAddress").getter(getter(SrtCallerSourceRequest::srtListenerAddress))
.setter(setter(Builder::srtListenerAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("srtListenerAddress").build())
.build();
private static final SdkField SRT_LISTENER_PORT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SrtListenerPort").getter(getter(SrtCallerSourceRequest::srtListenerPort))
.setter(setter(Builder::srtListenerPort))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("srtListenerPort").build()).build();
private static final SdkField STREAM_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StreamId").getter(getter(SrtCallerSourceRequest::streamId)).setter(setter(Builder::streamId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("streamId").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DECRYPTION_FIELD,
MINIMUM_LATENCY_FIELD, SRT_LISTENER_ADDRESS_FIELD, SRT_LISTENER_PORT_FIELD, STREAM_ID_FIELD));
private static final long serialVersionUID = 1L;
private final SrtCallerDecryptionRequest decryption;
private final Integer minimumLatency;
private final String srtListenerAddress;
private final String srtListenerPort;
private final String streamId;
private SrtCallerSourceRequest(BuilderImpl builder) {
this.decryption = builder.decryption;
this.minimumLatency = builder.minimumLatency;
this.srtListenerAddress = builder.srtListenerAddress;
this.srtListenerPort = builder.srtListenerPort;
this.streamId = builder.streamId;
}
/**
* Returns the value of the Decryption property for this object.
*
* @return The value of the Decryption property for this object.
*/
public final SrtCallerDecryptionRequest decryption() {
return decryption;
}
/**
* The preferred latency (in milliseconds) for implementing packet loss and recovery. Packet recovery is a key
* feature of SRT. Obtain this value from the operator at the upstream system.
*
* @return The preferred latency (in milliseconds) for implementing packet loss and recovery. Packet recovery is a
* key feature of SRT. Obtain this value from the operator at the upstream system.
*/
public final Integer minimumLatency() {
return minimumLatency;
}
/**
* The IP address at the upstream system (the listener) that MediaLive (the caller) will connect to.
*
* @return The IP address at the upstream system (the listener) that MediaLive (the caller) will connect to.
*/
public final String srtListenerAddress() {
return srtListenerAddress;
}
/**
* The port at the upstream system (the listener) that MediaLive (the caller) will connect to.
*
* @return The port at the upstream system (the listener) that MediaLive (the caller) will connect to.
*/
public final String srtListenerPort() {
return srtListenerPort;
}
/**
* This value is required if the upstream system uses this identifier because without it, the SRT handshake between
* MediaLive (the caller) and the upstream system (the listener) might fail.
*
* @return This value is required if the upstream system uses this identifier because without it, the SRT handshake
* between MediaLive (the caller) and the upstream system (the listener) might fail.
*/
public final String streamId() {
return streamId;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(decryption());
hashCode = 31 * hashCode + Objects.hashCode(minimumLatency());
hashCode = 31 * hashCode + Objects.hashCode(srtListenerAddress());
hashCode = 31 * hashCode + Objects.hashCode(srtListenerPort());
hashCode = 31 * hashCode + Objects.hashCode(streamId());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SrtCallerSourceRequest)) {
return false;
}
SrtCallerSourceRequest other = (SrtCallerSourceRequest) obj;
return Objects.equals(decryption(), other.decryption()) && Objects.equals(minimumLatency(), other.minimumLatency())
&& Objects.equals(srtListenerAddress(), other.srtListenerAddress())
&& Objects.equals(srtListenerPort(), other.srtListenerPort()) && Objects.equals(streamId(), other.streamId());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("SrtCallerSourceRequest").add("Decryption", decryption()).add("MinimumLatency", minimumLatency())
.add("SrtListenerAddress", srtListenerAddress()).add("SrtListenerPort", srtListenerPort())
.add("StreamId", streamId()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Decryption":
return Optional.ofNullable(clazz.cast(decryption()));
case "MinimumLatency":
return Optional.ofNullable(clazz.cast(minimumLatency()));
case "SrtListenerAddress":
return Optional.ofNullable(clazz.cast(srtListenerAddress()));
case "SrtListenerPort":
return Optional.ofNullable(clazz.cast(srtListenerPort()));
case "StreamId":
return Optional.ofNullable(clazz.cast(streamId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy