public class ServiceInstance<T> extends Object
Constructor and Description |
---|
ServiceInstance(String name,
String id,
String address,
Integer port,
Integer sslPort,
T payload,
long registrationTimeUTC,
ServiceType serviceType,
UriSpec uriSpec) |
Modifier and Type | Method and Description |
---|---|
static <T> ServiceInstanceBuilder<T> |
builder()
Return a new builder.
|
String |
buildUriSpec() |
String |
buildUriSpec(Map<String,Object> variables) |
boolean |
equals(Object o) |
String |
getAddress() |
String |
getId() |
String |
getName() |
T |
getPayload() |
Integer |
getPort() |
long |
getRegistrationTimeUTC() |
ServiceType |
getServiceType() |
Integer |
getSslPort() |
UriSpec |
getUriSpec() |
int |
hashCode() |
String |
toString() |
public ServiceInstance(String name, String id, String address, Integer port, Integer sslPort, T payload, long registrationTimeUTC, ServiceType serviceType, UriSpec uriSpec)
name
- name of the serviceid
- id of this instance (must be unique)address
- address of this instanceport
- the port for this instance or nullsslPort
- the SSL port for this instance or nullpayload
- the payload for this instance or nullregistrationTimeUTC
- the time (in UTC) of the registrationserviceType
- type of the serviceuriSpec
- the uri spec or nullpublic static <T> ServiceInstanceBuilder<T> builder() throws Exception
address
is set to the ip of the first
NIC in the system. The id
is set to a random UUID.Exception
- errors getting the local IPpublic String getName()
public String getId()
public String getAddress()
public Integer getPort()
public Integer getSslPort()
public T getPayload()
public long getRegistrationTimeUTC()
public ServiceType getServiceType()
public UriSpec getUriSpec()
public String buildUriSpec()
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.