|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.registry.client.types.ServiceRecord
@InterfaceAudience.Public @InterfaceStability.Evolving public class ServiceRecord
JSON-marshallable description of a single component. It supports the deserialization of unknown attributes, but does not support their creation.
Field Summary | |
---|---|
String |
description
Description string |
List<Endpoint> |
external
List of endpoints intended for use to external callers |
List<Endpoint> |
internal
List of endpoints for use within an application. |
static String |
RECORD_TYPE
A type string which MUST be in the serialized json. |
String |
type
The type field. |
Constructor Summary | |
---|---|
ServiceRecord()
Create a service record with no ID, description or registration time. |
|
ServiceRecord(ServiceRecord that)
Deep cloning constructor |
Method Summary | |
---|---|
void |
addExternalEndpoint(Endpoint endpoint)
Add an external endpoint |
void |
addInternalEndpoint(Endpoint endpoint)
Add an internal endpoint |
Map<String,String> |
attributes()
The map of "other" attributes set when parsing. |
protected Object |
clone()
Shallow clone: all endpoints will be shared across instances |
String |
get(String key)
Get the "other" attribute with a specific key |
String |
get(String key,
String defVal)
Get the "other" attribute with a specific key. |
Endpoint |
getExternalEndpoint(String api)
Look up an external endpoint |
Endpoint |
getInternalEndpoint(String api)
Look up an internal endpoint |
void |
set(String key,
Object value)
Handle unknown attributes by storing them in the attributes map |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String RECORD_TYPE
public String type
RECORD_TYPE
public String description
public List<Endpoint> external
public List<Endpoint> internal
Constructor Detail |
---|
public ServiceRecord()
public ServiceRecord(ServiceRecord that)
that
- service record sourceMethod Detail |
---|
public void addExternalEndpoint(Endpoint endpoint)
endpoint
- endpoint to setpublic void addInternalEndpoint(Endpoint endpoint)
endpoint
- endpoint to setpublic Endpoint getInternalEndpoint(String api)
api
- API
public Endpoint getExternalEndpoint(String api)
api
- API
public void set(String key, Object value)
attributes
map
key
- attribute namevalue
- attribute value.public Map<String,String> attributes()
public String get(String key)
key
- key to look up
public String get(String key, String defVal)
key
- key to look updefVal
- default value
defval
if the value was not presentpublic String toString()
toString
in class Object
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |