java.lang.Cloneable@Public
@Evolving
public class ServiceRecord
extends java.lang.Object
implements java.lang.Cloneable
| Modifier and Type | Field | Description |
|---|---|---|
java.lang.String |
description |
Description string
|
java.util.List<Endpoint> |
external |
List of endpoints intended for use to external callers
|
java.util.List<Endpoint> |
internal |
List of endpoints for use within an application.
|
static java.lang.String |
RECORD_TYPE |
A type string which MUST be in the serialized json.
|
java.lang.String |
type |
The type field.
|
| Constructor | Description |
|---|---|
ServiceRecord() |
Create a service record with no ID, description or registration time.
|
ServiceRecord(ServiceRecord that) |
Deep cloning constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addExternalEndpoint(Endpoint endpoint) |
Add an external endpoint
|
void |
addInternalEndpoint(Endpoint endpoint) |
Add an internal endpoint
|
java.util.Map<java.lang.String,java.lang.String> |
attributes() |
The map of "other" attributes set when parsing.
|
protected java.lang.Object |
clone() |
Shallow clone: all endpoints will be shared across instances
|
boolean |
equals(java.lang.Object obj) |
|
java.lang.String |
get(java.lang.String key) |
Get the "other" attribute with a specific key
|
java.lang.String |
get(java.lang.String key,
java.lang.String defVal) |
Get the "other" attribute with a specific key.
|
Endpoint |
getExternalEndpoint(java.lang.String api) |
Look up an external endpoint
|
Endpoint |
getInternalEndpoint(java.lang.String api) |
Look up an internal endpoint
|
int |
hashCode() |
|
void |
set(java.lang.String key,
java.lang.Object value) |
Handle unknown attributes by storing them in the
attributes map |
java.lang.String |
toString() |
public static final java.lang.String RECORD_TYPE
public java.lang.String type
RECORD_TYPEpublic java.lang.String description
public java.util.List<Endpoint> external
public java.util.List<Endpoint> internal
public ServiceRecord()
public ServiceRecord(ServiceRecord that)
that - service record sourcepublic void addExternalEndpoint(Endpoint endpoint)
endpoint - endpoint to setpublic void addInternalEndpoint(Endpoint endpoint)
endpoint - endpoint to setpublic Endpoint getInternalEndpoint(java.lang.String api)
api - APIpublic Endpoint getExternalEndpoint(java.lang.String api)
api - APIpublic void set(java.lang.String key,
java.lang.Object value)
attributes mapkey - attribute namevalue - attribute value.public java.util.Map<java.lang.String,java.lang.String> attributes()
public java.lang.String get(java.lang.String key)
key - key to look uppublic java.lang.String get(java.lang.String key,
java.lang.String defVal)
key - key to look updefVal - default valuedefval if the value was not presentpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.