|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.registry.client.types.Endpoint
@InterfaceAudience.Public @InterfaceStability.Evolving public final class Endpoint
Description of a single service/component endpoint. It is designed to be marshalled as JSON.
Every endpoint can have more than one address entry, such as a list of URLs to a replicated service, or a (hostname, port) pair. Each of these address entries is represented as a string list, as that is the only reliably marshallable form of a tuple JSON can represent.
| Field Summary | |
|---|---|
List<Map<String,String>> |
addresses
a list of address tuples —tuples whose format depends on the address type |
String |
addressType
Type of address. |
String |
api
API implemented at the end of the binding |
String |
protocolType
Protocol type. |
| Constructor Summary | |
|---|---|
Endpoint()
Create an empty instance. |
|
Endpoint(Endpoint that)
Create an endpoint from another endpoint. |
|
Endpoint(String api,
String addressType,
String protocolType)
Build an endpoint with an empty address list |
|
Endpoint(String api,
String addressType,
String protocolType,
List<Map<String,String>> addrs)
Build an endpoint with a list of addresses |
|
Endpoint(String api,
String addressType,
String protocolType,
Map<String,String>... addrs)
Build an endpoint with a list of addresses |
|
Endpoint(String api,
String addressType,
String protocolType,
Map<String,String> addr)
Build an endpoint with a single address entry. |
|
Endpoint(String api,
String protocolType,
URI... uris)
Build an endpoint from a list of URIs; each URI is ASCII-encoded and added to the list of addresses. |
|
| Method Summary | |
|---|---|
Object |
clone()
Shallow clone: the lists of addresses are shared |
String |
toString()
|
void |
validate()
Validate the record by checking for null fields and other invalid conditions |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public String api
public String addressType
AddressTypes
public String protocolType
ProtocolTypes
public List<Map<String,String>> addresses
| Constructor Detail |
|---|
public Endpoint()
public Endpoint(Endpoint that)
that - the endpoint to copy from
public Endpoint(String api,
String addressType,
String protocolType,
List<Map<String,String>> addrs)
api - API nameaddressType - address typeprotocolType - protocol typeaddrs - addresses
public Endpoint(String api,
String addressType,
String protocolType)
api - API nameaddressType - address typeprotocolType - protocol type
public Endpoint(String api,
String addressType,
String protocolType,
Map<String,String> addr)
This constructor is superfluous given the varags constructor is equivalent for a single element argument. However, type-erasure in java generics causes javac to warn about unchecked generic array creation. This constructor, which represents the common "one address" case, does not generate compile-time warnings.
api - API nameaddressType - address typeprotocolType - protocol typeaddr - address. May be null —in which case it is not added
public Endpoint(String api,
String addressType,
String protocolType,
Map<String,String>... addrs)
api - API nameaddressType - address typeprotocolType - protocol typeaddrs - addresses. Null elements will be skipped
public Endpoint(String api,
String protocolType,
URI... uris)
api - API nameprotocolType - protocol typeuris - URIs to convert to a list of tup;les| Method Detail |
|---|
public String toString()
toString in class Objectpublic void validate()
NullPointerException - if a field is null when it
MUST be set.
RuntimeException - on invalid entries
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||