public static final class InstanceInfo.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(InstanceInfo instanceInfo) |
Modifier and Type | Method and Description |
---|---|
InstanceInfo.Builder |
add(java.lang.String key,
java.lang.String val)
Add arbitrary metadata to running instance.
|
InstanceInfo |
build()
Build the
InstanceInfo object. |
InstanceInfo.Builder |
enablePort(InstanceInfo.PortType type,
boolean isEnabled)
Enabled or disable secure/non-secure ports .
|
InstanceInfo |
getRawInstance()
Returns the encapsulated instance info even it it is not built fully.
|
boolean |
isInitialized() |
static InstanceInfo.Builder |
newBuilder() |
static InstanceInfo.Builder |
newBuilder(java.util.function.Function<java.lang.String,java.lang.String> intern) |
static InstanceInfo.Builder |
newBuilder(VipAddressResolver vipAddressResolver) |
InstanceInfo.Builder |
setActionType(InstanceInfo.ActionType actionType) |
InstanceInfo.Builder |
setAppGroupName(java.lang.String appGroupName) |
InstanceInfo.Builder |
setAppGroupNameForDeser(java.lang.String appGroupName) |
InstanceInfo.Builder |
setAppName(java.lang.String appName)
Set the application name of the instance.This is mostly used in
querying of instances.
|
InstanceInfo.Builder |
setAppNameForDeser(java.lang.String appName) |
InstanceInfo.Builder |
setASGName(java.lang.String asgName)
Sets the AWS ASG name for this instance.
|
InstanceInfo.Builder |
setCountryId(int id)
Deprecated.
|
InstanceInfo.Builder |
setDataCenterInfo(DataCenterInfo datacenter)
Sets the datacenter information.
|
InstanceInfo.Builder |
setHealthCheckUrls(java.lang.String relativeUrl,
java.lang.String explicitUrl,
java.lang.String secureExplicitUrl)
Sets the absolute health check
URL for this instance for both
secure and non-secure communication The users can provide the
healthCheckUrlPath if the healthcheck page resides in
the same instance talking to discovery, else in the cases where the
instance is a proxy for some other server, it can provide the full
URL . |
InstanceInfo.Builder |
setHealthCheckUrlsForDeser(java.lang.String healthCheckUrl,
java.lang.String secureHealthCheckUrl)
setHealthCheckUrls(String, String, String) has complex logic that should not be invoked when
we deserialize InstanceInfo object, or health check URLs are formatted already by the client. |
InstanceInfo.Builder |
setHomePageUrl(java.lang.String relativeUrl,
java.lang.String explicitUrl)
Sets the absolute home page
URL for this instance. |
InstanceInfo.Builder |
setHomePageUrlForDeser(java.lang.String homePageUrl)
setHomePageUrl(String, String) has complex logic that should not be invoked when
we deserialize InstanceInfo object, or home page URL is formatted already by the client. |
InstanceInfo.Builder |
setHostName(java.lang.String hostName)
Sets the fully qualified hostname of this running instance.This is
mostly used in constructing the
URL for communicating with
the instance. |
InstanceInfo.Builder |
setInstanceId(java.lang.String instanceId) |
InstanceInfo.Builder |
setIPAddr(java.lang.String ip)
Sets the ip address of this running instance.
|
InstanceInfo.Builder |
setIsCoordinatingDiscoveryServer(boolean isCoordinatingDiscoveryServer) |
InstanceInfo.Builder |
setLastDirtyTimestamp(long lastDirtyTimestamp) |
InstanceInfo.Builder |
setLastUpdatedTimestamp(long lastUpdatedTimestamp) |
InstanceInfo.Builder |
setLeaseInfo(LeaseInfo info)
Set the instance lease information.
|
InstanceInfo.Builder |
setMetadata(java.util.Map<java.lang.String,java.lang.String> mt)
Replace the existing metadata map with a new one.
|
InstanceInfo.Builder |
setNamespace(java.lang.String namespace) |
InstanceInfo.Builder |
setOverriddenStatus(InstanceInfo.InstanceStatus status)
Sets the status overridden by some other external process.This is
mostly used in putting an instance out of service to block traffic to
it.
|
InstanceInfo.Builder |
setPort(int port)
Sets the port number that is used to service requests.
|
InstanceInfo.Builder |
setSecurePort(int port)
Sets the secure port that is used to service requests.
|
InstanceInfo.Builder |
setSecureVIPAddress(java.lang.String secureVIPAddress)
Sets the Secure Virtual Internet Protocol address for this instance.
|
InstanceInfo.Builder |
setSecureVIPAddressDeser(java.lang.String secureVIPAddress)
Setter used during deserialization process, that does not do macro expansion on the provided value.
|
InstanceInfo.Builder |
setSID(java.lang.String sid)
Deprecated.
|
InstanceInfo.Builder |
setStatus(InstanceInfo.InstanceStatus status)
Sets the status of the instances.If the status is UP, that is when
the instance is ready to service requests.
|
InstanceInfo.Builder |
setStatusPageUrl(java.lang.String relativeUrl,
java.lang.String explicitUrl)
Sets the absolute status page
URL for this instance. |
InstanceInfo.Builder |
setStatusPageUrlForDeser(java.lang.String statusPageUrl)
setStatusPageUrl(String, String) has complex logic that should not be invoked when
we deserialize InstanceInfo object, or status page URL is formatted already by the client. |
InstanceInfo.Builder |
setVIPAddress(java.lang.String vipAddress)
Sets the Virtual Internet Protocol address for this instance.
|
InstanceInfo.Builder |
setVIPAddressDeser(java.lang.String vipAddress)
Setter used during deserialization process, that does not do macro expansion on the provided value.
|
public Builder(InstanceInfo instanceInfo)
public static InstanceInfo.Builder newBuilder()
public static InstanceInfo.Builder newBuilder(java.util.function.Function<java.lang.String,java.lang.String> intern)
public static InstanceInfo.Builder newBuilder(VipAddressResolver vipAddressResolver)
public InstanceInfo.Builder setInstanceId(java.lang.String instanceId)
public InstanceInfo.Builder setAppName(java.lang.String appName)
appName
- the application name.public InstanceInfo.Builder setAppNameForDeser(java.lang.String appName)
public InstanceInfo.Builder setAppGroupName(java.lang.String appGroupName)
public InstanceInfo.Builder setAppGroupNameForDeser(java.lang.String appGroupName)
public InstanceInfo.Builder setHostName(java.lang.String hostName)
URL
for communicating with
the instance.hostName
- the host name of the instance.InstanceInfo
builder.public InstanceInfo.Builder setStatus(InstanceInfo.InstanceStatus status)
status
- the InstanceInfo.InstanceStatus
of the instance.InstanceInfo
builder.public InstanceInfo.Builder setOverriddenStatus(InstanceInfo.InstanceStatus status)
status
- the overridden InstanceInfo.InstanceStatus
of the instance.InstanceInfo
builder.public InstanceInfo.Builder setIPAddr(java.lang.String ip)
ip
- the ip address of the instance.InstanceInfo
builder.@Deprecated public InstanceInfo.Builder setSID(java.lang.String sid)
sid
- the sid of the instance.InstanceInfo
builder.public InstanceInfo.Builder setPort(int port)
port
- the port number that is used to service requests.InstanceInfo
builder.public InstanceInfo.Builder setSecurePort(int port)
port
- the secure port that is used to service requests.InstanceInfo
builder.public InstanceInfo.Builder enablePort(InstanceInfo.PortType type, boolean isEnabled)
type
- Secure or Non-Secure.isEnabled
- true if enabled.@Deprecated public InstanceInfo.Builder setCountryId(int id)
public InstanceInfo.Builder setHomePageUrl(java.lang.String relativeUrl, java.lang.String explicitUrl)
URL
for this instance. The users
can provide the homePageUrlPath
if the home page resides
in the same instance talking to discovery, else in the cases where
the instance is a proxy for some other server, it can provide the
full URL
. If the full URL
is provided it takes
precedence.
The full URL
should follow the format
http://${netflix.appinfo.hostname}:7001/ where the value
${netflix.appinfo.hostname} is replaced at runtime.
relativeUrl
- the relative url path of the home page.explicitUrl
- - The full URL
for the home pagepublic InstanceInfo.Builder setHomePageUrlForDeser(java.lang.String homePageUrl)
setHomePageUrl(String, String)
has complex logic that should not be invoked when
we deserialize InstanceInfo
object, or home page URL is formatted already by the client.public InstanceInfo.Builder setStatusPageUrl(java.lang.String relativeUrl, java.lang.String explicitUrl)
URL
for this instance. The
users can provide the statusPageUrlPath
if the status
page resides in the same instance talking to discovery, else in the
cases where the instance is a proxy for some other server, it can
provide the full URL
. If the full URL
is provided it
takes precedence.
The full URL
should follow the format
http://${netflix.appinfo.hostname}:7001/Status where the value
${netflix.appinfo.hostname} is replaced at runtime.
relativeUrl
- - The URL
path for status page for this instanceexplicitUrl
- - The full URL
for the status pagepublic InstanceInfo.Builder setStatusPageUrlForDeser(java.lang.String statusPageUrl)
setStatusPageUrl(String, String)
has complex logic that should not be invoked when
we deserialize InstanceInfo
object, or status page URL is formatted already by the client.public InstanceInfo.Builder setHealthCheckUrls(java.lang.String relativeUrl, java.lang.String explicitUrl, java.lang.String secureExplicitUrl)
URL
for this instance for both
secure and non-secure communication The users can provide the
healthCheckUrlPath
if the healthcheck page resides in
the same instance talking to discovery, else in the cases where the
instance is a proxy for some other server, it can provide the full
URL
. If the full URL
is provided it takes precedence.
The full URL
should follow the format
http://${netflix.appinfo.hostname}:7001/healthcheck where the value
${netflix.appinfo.hostname} is replaced at runtime.
relativeUrl
- - The URL
path for healthcheck page for this
instance.explicitUrl
- - The full URL
for the healthcheck page.secureExplicitUrl
- the full secure explicit url of the healthcheck page.public InstanceInfo.Builder setHealthCheckUrlsForDeser(java.lang.String healthCheckUrl, java.lang.String secureHealthCheckUrl)
setHealthCheckUrls(String, String, String)
has complex logic that should not be invoked when
we deserialize InstanceInfo
object, or health check URLs are formatted already by the client.public InstanceInfo.Builder setVIPAddress(java.lang.String vipAddress)
This
address needs to be resolved into a real address for communicating
with this instance.vipAddress
- - The Virtual Internet Protocol address of this instance.public InstanceInfo.Builder setVIPAddressDeser(java.lang.String vipAddress)
public InstanceInfo.Builder setSecureVIPAddress(java.lang.String secureVIPAddress)
secureVIPAddress
- the secure VIP address of the instance.public InstanceInfo.Builder setSecureVIPAddressDeser(java.lang.String secureVIPAddress)
public InstanceInfo.Builder setDataCenterInfo(DataCenterInfo datacenter)
datacenter
- the datacenter information for where this instance is
running.InstanceInfo
builder.public InstanceInfo.Builder setLeaseInfo(LeaseInfo info)
info
- the lease information for this instance.public InstanceInfo.Builder add(java.lang.String key, java.lang.String val)
key
- The key of the metadata.val
- The value of the metadata.InstanceInfo
builder.public InstanceInfo.Builder setMetadata(java.util.Map<java.lang.String,java.lang.String> mt)
mt
- the new metadata name.public InstanceInfo getRawInstance()
public InstanceInfo build()
InstanceInfo
object.InstanceInfo
that was built based on the
information supplied.public boolean isInitialized()
public InstanceInfo.Builder setASGName(java.lang.String asgName)
asgName
- the asg name for this instance.public InstanceInfo.Builder setIsCoordinatingDiscoveryServer(boolean isCoordinatingDiscoveryServer)
public InstanceInfo.Builder setLastUpdatedTimestamp(long lastUpdatedTimestamp)
public InstanceInfo.Builder setLastDirtyTimestamp(long lastDirtyTimestamp)
public InstanceInfo.Builder setActionType(InstanceInfo.ActionType actionType)
public InstanceInfo.Builder setNamespace(java.lang.String namespace)