
software.amazon.awssdk.services.datasync.model.DescribeLocationHdfsResponse 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.datasync.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeLocationHdfsResponse extends DataSyncResponse implements
ToCopyableBuilder {
private static final SdkField LOCATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LocationArn").getter(getter(DescribeLocationHdfsResponse::locationArn))
.setter(setter(Builder::locationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocationArn").build()).build();
private static final SdkField LOCATION_URI_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LocationUri").getter(getter(DescribeLocationHdfsResponse::locationUri))
.setter(setter(Builder::locationUri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocationUri").build()).build();
private static final SdkField> NAME_NODES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("NameNodes")
.getter(getter(DescribeLocationHdfsResponse::nameNodes))
.setter(setter(Builder::nameNodes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NameNodes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(HdfsNameNode::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField BLOCK_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("BlockSize").getter(getter(DescribeLocationHdfsResponse::blockSize)).setter(setter(Builder::blockSize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlockSize").build()).build();
private static final SdkField REPLICATION_FACTOR_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ReplicationFactor").getter(getter(DescribeLocationHdfsResponse::replicationFactor))
.setter(setter(Builder::replicationFactor))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationFactor").build()).build();
private static final SdkField KMS_KEY_PROVIDER_URI_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KmsKeyProviderUri").getter(getter(DescribeLocationHdfsResponse::kmsKeyProviderUri))
.setter(setter(Builder::kmsKeyProviderUri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyProviderUri").build()).build();
private static final SdkField QOP_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("QopConfiguration")
.getter(getter(DescribeLocationHdfsResponse::qopConfiguration)).setter(setter(Builder::qopConfiguration))
.constructor(QopConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QopConfiguration").build()).build();
private static final SdkField AUTHENTICATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AuthenticationType").getter(getter(DescribeLocationHdfsResponse::authenticationTypeAsString))
.setter(setter(Builder::authenticationType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthenticationType").build())
.build();
private static final SdkField SIMPLE_USER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SimpleUser").getter(getter(DescribeLocationHdfsResponse::simpleUser))
.setter(setter(Builder::simpleUser))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleUser").build()).build();
private static final SdkField KERBEROS_PRINCIPAL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KerberosPrincipal").getter(getter(DescribeLocationHdfsResponse::kerberosPrincipal))
.setter(setter(Builder::kerberosPrincipal))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KerberosPrincipal").build()).build();
private static final SdkField> AGENT_ARNS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AgentArns")
.getter(getter(DescribeLocationHdfsResponse::agentArns))
.setter(setter(Builder::agentArns))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AgentArns").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(DescribeLocationHdfsResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LOCATION_ARN_FIELD,
LOCATION_URI_FIELD, NAME_NODES_FIELD, BLOCK_SIZE_FIELD, REPLICATION_FACTOR_FIELD, KMS_KEY_PROVIDER_URI_FIELD,
QOP_CONFIGURATION_FIELD, AUTHENTICATION_TYPE_FIELD, SIMPLE_USER_FIELD, KERBEROS_PRINCIPAL_FIELD, AGENT_ARNS_FIELD,
CREATION_TIME_FIELD));
private final String locationArn;
private final String locationUri;
private final List nameNodes;
private final Integer blockSize;
private final Integer replicationFactor;
private final String kmsKeyProviderUri;
private final QopConfiguration qopConfiguration;
private final String authenticationType;
private final String simpleUser;
private final String kerberosPrincipal;
private final List agentArns;
private final Instant creationTime;
private DescribeLocationHdfsResponse(BuilderImpl builder) {
super(builder);
this.locationArn = builder.locationArn;
this.locationUri = builder.locationUri;
this.nameNodes = builder.nameNodes;
this.blockSize = builder.blockSize;
this.replicationFactor = builder.replicationFactor;
this.kmsKeyProviderUri = builder.kmsKeyProviderUri;
this.qopConfiguration = builder.qopConfiguration;
this.authenticationType = builder.authenticationType;
this.simpleUser = builder.simpleUser;
this.kerberosPrincipal = builder.kerberosPrincipal;
this.agentArns = builder.agentArns;
this.creationTime = builder.creationTime;
}
/**
*
* The ARN of the HDFS cluster location.
*
*
* @return The ARN of the HDFS cluster location.
*/
public final String locationArn() {
return locationArn;
}
/**
*
* The URI of the HDFS cluster location.
*
*
* @return The URI of the HDFS cluster location.
*/
public final String locationUri() {
return locationUri;
}
/**
* For responses, this returns true if the service returned a value for the NameNodes property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasNameNodes() {
return nameNodes != null && !(nameNodes instanceof SdkAutoConstructList);
}
/**
*
* The NameNode that manage the HDFS namespace.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasNameNodes} method.
*
*
* @return The NameNode that manage the HDFS namespace.
*/
public final List nameNodes() {
return nameNodes;
}
/**
*
* The size of the data blocks to write into the HDFS cluster.
*
*
* @return The size of the data blocks to write into the HDFS cluster.
*/
public final Integer blockSize() {
return blockSize;
}
/**
*
* The number of DataNodes to replicate the data to when writing to the HDFS cluster.
*
*
* @return The number of DataNodes to replicate the data to when writing to the HDFS cluster.
*/
public final Integer replicationFactor() {
return replicationFactor;
}
/**
*
* The URI of the HDFS cluster's Key Management Server (KMS).
*
*
* @return The URI of the HDFS cluster's Key Management Server (KMS).
*/
public final String kmsKeyProviderUri() {
return kmsKeyProviderUri;
}
/**
*
* The Quality of Protection (QOP) configuration specifies the Remote Procedure Call (RPC) and data transfer
* protection settings configured on the Hadoop Distributed File System (HDFS) cluster.
*
*
* @return The Quality of Protection (QOP) configuration specifies the Remote Procedure Call (RPC) and data transfer
* protection settings configured on the Hadoop Distributed File System (HDFS) cluster.
*/
public final QopConfiguration qopConfiguration() {
return qopConfiguration;
}
/**
*
* The type of authentication used to determine the identity of the user.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #authenticationType} will return {@link HdfsAuthenticationType#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #authenticationTypeAsString}.
*
*
* @return The type of authentication used to determine the identity of the user.
* @see HdfsAuthenticationType
*/
public final HdfsAuthenticationType authenticationType() {
return HdfsAuthenticationType.fromValue(authenticationType);
}
/**
*
* The type of authentication used to determine the identity of the user.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #authenticationType} will return {@link HdfsAuthenticationType#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #authenticationTypeAsString}.
*
*
* @return The type of authentication used to determine the identity of the user.
* @see HdfsAuthenticationType
*/
public final String authenticationTypeAsString() {
return authenticationType;
}
/**
*
* The user name used to identify the client on the host operating system. This parameter is used if the
* AuthenticationType
is defined as SIMPLE
.
*
*
* @return The user name used to identify the client on the host operating system. This parameter is used if the
* AuthenticationType
is defined as SIMPLE
.
*/
public final String simpleUser() {
return simpleUser;
}
/**
*
* The Kerberos principal with access to the files and folders on the HDFS cluster. This parameter is used if the
* AuthenticationType
is defined as KERBEROS
.
*
*
* @return The Kerberos principal with access to the files and folders on the HDFS cluster. This parameter is used
* if the AuthenticationType
is defined as KERBEROS
.
*/
public final String kerberosPrincipal() {
return kerberosPrincipal;
}
/**
* For responses, this returns true if the service returned a value for the AgentArns property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasAgentArns() {
return agentArns != null && !(agentArns instanceof SdkAutoConstructList);
}
/**
*
* The ARNs of the agents that are used to connect to the HDFS cluster.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasAgentArns} method.
*
*
* @return The ARNs of the agents that are used to connect to the HDFS cluster.
*/
public final List agentArns() {
return agentArns;
}
/**
*
* The time that the HDFS location was created.
*
*
* @return The time that the HDFS location was created.
*/
public final Instant creationTime() {
return creationTime;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(locationArn());
hashCode = 31 * hashCode + Objects.hashCode(locationUri());
hashCode = 31 * hashCode + Objects.hashCode(hasNameNodes() ? nameNodes() : null);
hashCode = 31 * hashCode + Objects.hashCode(blockSize());
hashCode = 31 * hashCode + Objects.hashCode(replicationFactor());
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyProviderUri());
hashCode = 31 * hashCode + Objects.hashCode(qopConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(authenticationTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(simpleUser());
hashCode = 31 * hashCode + Objects.hashCode(kerberosPrincipal());
hashCode = 31 * hashCode + Objects.hashCode(hasAgentArns() ? agentArns() : null);
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DescribeLocationHdfsResponse)) {
return false;
}
DescribeLocationHdfsResponse other = (DescribeLocationHdfsResponse) obj;
return Objects.equals(locationArn(), other.locationArn()) && Objects.equals(locationUri(), other.locationUri())
&& hasNameNodes() == other.hasNameNodes() && Objects.equals(nameNodes(), other.nameNodes())
&& Objects.equals(blockSize(), other.blockSize())
&& Objects.equals(replicationFactor(), other.replicationFactor())
&& Objects.equals(kmsKeyProviderUri(), other.kmsKeyProviderUri())
&& Objects.equals(qopConfiguration(), other.qopConfiguration())
&& Objects.equals(authenticationTypeAsString(), other.authenticationTypeAsString())
&& Objects.equals(simpleUser(), other.simpleUser())
&& Objects.equals(kerberosPrincipal(), other.kerberosPrincipal()) && hasAgentArns() == other.hasAgentArns()
&& Objects.equals(agentArns(), other.agentArns()) && Objects.equals(creationTime(), other.creationTime());
}
/**
* 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("DescribeLocationHdfsResponse").add("LocationArn", locationArn())
.add("LocationUri", locationUri()).add("NameNodes", hasNameNodes() ? nameNodes() : null)
.add("BlockSize", blockSize()).add("ReplicationFactor", replicationFactor())
.add("KmsKeyProviderUri", kmsKeyProviderUri()).add("QopConfiguration", qopConfiguration())
.add("AuthenticationType", authenticationTypeAsString()).add("SimpleUser", simpleUser())
.add("KerberosPrincipal", kerberosPrincipal()).add("AgentArns", hasAgentArns() ? agentArns() : null)
.add("CreationTime", creationTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "LocationArn":
return Optional.ofNullable(clazz.cast(locationArn()));
case "LocationUri":
return Optional.ofNullable(clazz.cast(locationUri()));
case "NameNodes":
return Optional.ofNullable(clazz.cast(nameNodes()));
case "BlockSize":
return Optional.ofNullable(clazz.cast(blockSize()));
case "ReplicationFactor":
return Optional.ofNullable(clazz.cast(replicationFactor()));
case "KmsKeyProviderUri":
return Optional.ofNullable(clazz.cast(kmsKeyProviderUri()));
case "QopConfiguration":
return Optional.ofNullable(clazz.cast(qopConfiguration()));
case "AuthenticationType":
return Optional.ofNullable(clazz.cast(authenticationTypeAsString()));
case "SimpleUser":
return Optional.ofNullable(clazz.cast(simpleUser()));
case "KerberosPrincipal":
return Optional.ofNullable(clazz.cast(kerberosPrincipal()));
case "AgentArns":
return Optional.ofNullable(clazz.cast(agentArns()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function