public class Record extends Object
| Constructor and Description |
|---|
Record()
Creates a new
Record. |
Record(JsonObject json)
Creates a new
Record from its json representation. |
Record(Record other)
|
| Modifier and Type | Method and Description |
|---|---|
JsonObject |
getLocation() |
JsonObject |
getMetadata()
Gets the metadata attached to the record.
|
String |
getName()
Gets the name of the service.
|
String |
getRegistration()
Gets the registration id if any.
|
Status |
getStatus()
Gets the current status of the service.
|
String |
getType()
Gets the service type.
|
boolean |
match(JsonObject filter)
Checks whether or not the current
Record matches the filter. |
Record |
setLocation(JsonObject location)
Sets the json object describing the location of the service.
|
Record |
setMetadata(JsonObject metadata) |
Record |
setName(String name)
Sets the name of the service.
|
Record |
setRegistration(String reg)
Sets the registration id.
|
Record |
setStatus(Status status)
Sets the status of the service.
|
Record |
setType(String type)
Sets the type of service.
|
JsonObject |
toJson() |
public static final String ENDPOINT
public Record()
Record.public Record(JsonObject json)
Record from its json representation.json - the json objectpublic Record(Record other)
other - the record to copypublic JsonObject toJson()
Record.public JsonObject getLocation()
ENDPOINT entry.public Record setLocation(JsonObject location)
ENDPOINT entry.location - the locationRecordpublic JsonObject getMetadata()
null.public Record setMetadata(JsonObject metadata)
public String getName()
public Record setName(String name)
name - the nameRecordpublic Status getStatus()
public Record setStatus(Status status)
Status.UP. When withdrawn, the
status is set to Status.DOWN.status - the status, must not be nullRecordpublic Record setRegistration(String reg)
reg - the registration idRecordpublic String getRegistration()
null result means that the record has not been published.public String getType()
public Record setType(String type)
type - the typeRecordpublic boolean match(JsonObject filter)
Record matches the filter.filter - the filterCopyright © 2016. All rights reserved.