All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ecs.model.ServiceRegistry Maven / Gradle / Ivy

Go to download

The AWS Java SDK for the Amazon EC2 Container Service holds the client classes that are used for communicating with the Amazon EC2 Container Service

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright 2014-2019 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.ecs.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.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;

/**
 * 

* Details of the service registry. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ServiceRegistry implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField REGISTRY_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ServiceRegistry::registryArn)).setter(setter(Builder::registryArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("registryArn").build()).build(); private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER) .getter(getter(ServiceRegistry::port)).setter(setter(Builder::port)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("port").build()).build(); private static final SdkField CONTAINER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ServiceRegistry::containerName)).setter(setter(Builder::containerName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("containerName").build()).build(); private static final SdkField CONTAINER_PORT_FIELD = SdkField. builder(MarshallingType.INTEGER) .getter(getter(ServiceRegistry::containerPort)).setter(setter(Builder::containerPort)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("containerPort").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REGISTRY_ARN_FIELD, PORT_FIELD, CONTAINER_NAME_FIELD, CONTAINER_PORT_FIELD)); private static final long serialVersionUID = 1L; private final String registryArn; private final Integer port; private final String containerName; private final Integer containerPort; private ServiceRegistry(BuilderImpl builder) { this.registryArn = builder.registryArn; this.port = builder.port; this.containerName = builder.containerName; this.containerPort = builder.containerPort; } /** *

* The Amazon Resource Name (ARN) of the service registry. The currently supported service registry is AWS Cloud * Map. For more information, see CreateService. *

* * @return The Amazon Resource Name (ARN) of the service registry. The currently supported service registry is AWS * Cloud Map. For more information, see CreateService. */ public String registryArn() { return registryArn; } /** *

* The port value used if your service discovery service specified an SRV record. This field may be used if both the * awsvpc network mode and SRV records are used. *

* * @return The port value used if your service discovery service specified an SRV record. This field may be used if * both the awsvpc network mode and SRV records are used. */ public Integer port() { return port; } /** *

* The container name value, already specified in the task definition, to be used for your service discovery * service. If the task definition that your service task specifies uses the bridge or * host network mode, you must specify a containerName and containerPort * combination from the task definition. If the task definition that your service task specifies uses the * awsvpc network mode and a type SRV DNS record is used, you must specify either a * containerName and containerPort combination or a port value, but not both. *

* * @return The container name value, already specified in the task definition, to be used for your service discovery * service. If the task definition that your service task specifies uses the bridge or * host network mode, you must specify a containerName and * containerPort combination from the task definition. If the task definition that your service * task specifies uses the awsvpc network mode and a type SRV DNS record is used, you must * specify either a containerName and containerPort combination or a * port value, but not both. */ public String containerName() { return containerName; } /** *

* The port value, already specified in the task definition, to be used for your service discovery service. If the * task definition your service task specifies uses the bridge or host network mode, you * must specify a containerName and containerPort combination from the task definition. If * the task definition your service task specifies uses the awsvpc network mode and a type SRV DNS * record is used, you must specify either a containerName and containerPort combination * or a port value, but not both. *

* * @return The port value, already specified in the task definition, to be used for your service discovery service. * If the task definition your service task specifies uses the bridge or host * network mode, you must specify a containerName and containerPort combination * from the task definition. If the task definition your service task specifies uses the awsvpc * network mode and a type SRV DNS record is used, you must specify either a containerName and * containerPort combination or a port value, but not both. */ public Integer containerPort() { return containerPort; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(registryArn()); hashCode = 31 * hashCode + Objects.hashCode(port()); hashCode = 31 * hashCode + Objects.hashCode(containerName()); hashCode = 31 * hashCode + Objects.hashCode(containerPort()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ServiceRegistry)) { return false; } ServiceRegistry other = (ServiceRegistry) obj; return Objects.equals(registryArn(), other.registryArn()) && Objects.equals(port(), other.port()) && Objects.equals(containerName(), other.containerName()) && Objects.equals(containerPort(), other.containerPort()); } /** * 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 String toString() { return ToString.builder("ServiceRegistry").add("RegistryArn", registryArn()).add("Port", port()) .add("ContainerName", containerName()).add("ContainerPort", containerPort()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "registryArn": return Optional.ofNullable(clazz.cast(registryArn())); case "port": return Optional.ofNullable(clazz.cast(port())); case "containerName": return Optional.ofNullable(clazz.cast(containerName())); case "containerPort": return Optional.ofNullable(clazz.cast(containerPort())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ServiceRegistry) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the service registry. The currently supported service registry is AWS Cloud * Map. For more information, see CreateService. *

* * @param registryArn * The Amazon Resource Name (ARN) of the service registry. The currently supported service registry is * AWS Cloud Map. For more information, see CreateService. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registryArn(String registryArn); /** *

* The port value used if your service discovery service specified an SRV record. This field may be used if both * the awsvpc network mode and SRV records are used. *

* * @param port * The port value used if your service discovery service specified an SRV record. This field may be used * if both the awsvpc network mode and SRV records are used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder port(Integer port); /** *

* The container name value, already specified in the task definition, to be used for your service discovery * service. If the task definition that your service task specifies uses the bridge or * host network mode, you must specify a containerName and containerPort * combination from the task definition. If the task definition that your service task specifies uses the * awsvpc network mode and a type SRV DNS record is used, you must specify either a * containerName and containerPort combination or a port value, but not * both. *

* * @param containerName * The container name value, already specified in the task definition, to be used for your service * discovery service. If the task definition that your service task specifies uses the * bridge or host network mode, you must specify a containerName * and containerPort combination from the task definition. If the task definition that your * service task specifies uses the awsvpc network mode and a type SRV DNS record is used, * you must specify either a containerName and containerPort combination or a * port value, but not both. * @return Returns a reference to this object so that method calls can be chained together. */ Builder containerName(String containerName); /** *

* The port value, already specified in the task definition, to be used for your service discovery service. If * the task definition your service task specifies uses the bridge or host network * mode, you must specify a containerName and containerPort combination from the task * definition. If the task definition your service task specifies uses the awsvpc network mode and * a type SRV DNS record is used, you must specify either a containerName and * containerPort combination or a port value, but not both. *

* * @param containerPort * The port value, already specified in the task definition, to be used for your service discovery * service. If the task definition your service task specifies uses the bridge or * host network mode, you must specify a containerName and * containerPort combination from the task definition. If the task definition your service * task specifies uses the awsvpc network mode and a type SRV DNS record is used, you must * specify either a containerName and containerPort combination or a * port value, but not both. * @return Returns a reference to this object so that method calls can be chained together. */ Builder containerPort(Integer containerPort); } static final class BuilderImpl implements Builder { private String registryArn; private Integer port; private String containerName; private Integer containerPort; private BuilderImpl() { } private BuilderImpl(ServiceRegistry model) { registryArn(model.registryArn); port(model.port); containerName(model.containerName); containerPort(model.containerPort); } public final String getRegistryArn() { return registryArn; } @Override public final Builder registryArn(String registryArn) { this.registryArn = registryArn; return this; } public final void setRegistryArn(String registryArn) { this.registryArn = registryArn; } public final Integer getPort() { return port; } @Override public final Builder port(Integer port) { this.port = port; return this; } public final void setPort(Integer port) { this.port = port; } public final String getContainerName() { return containerName; } @Override public final Builder containerName(String containerName) { this.containerName = containerName; return this; } public final void setContainerName(String containerName) { this.containerName = containerName; } public final Integer getContainerPort() { return containerPort; } @Override public final Builder containerPort(Integer containerPort) { this.containerPort = containerPort; return this; } public final void setContainerPort(Integer containerPort) { this.containerPort = containerPort; } @Override public ServiceRegistry build() { return new ServiceRegistry(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy