Class Record
java.lang.Object
io.vertx.servicediscovery.Record
Describes a `service`. The record is the only piece of information shared between consumer and provider. It should
contains enough metadata to let consumer find the service they want.
- Author:
- Clement Escoffier
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether or not the current object is equal to the given object.Gets the metadata attached to the record.getName()Gets the name of the service.Gets the registration id if any.Gets the current status of the service.getType()Gets the service type.inthashCode()booleanmatch(JsonObject filter) Checks whether or not the currentRecordmatches the filter.setLocation(JsonObject location) Sets the json object describing the location of the service.setMetadata(JsonObject metadata) Sets the name of the service.setRegistration(String reg) Sets the registration id.Sets the status of the service.Sets the type of service.toJson()toString()
-
Field Details
-
ENDPOINT
- See Also:
-
-
Constructor Details
-
Method Details
-
toJson
- Returns:
- the JSON representation of the current
Record.
-
getLocation
- Returns:
- the json object describing the location of the service. By convention, this json object should contain
the
ENDPOINTentry.
-
setLocation
-
getMetadata
Gets the metadata attached to the record.- Returns:
- the metadata, cannot be
null.
-
setMetadata
-
getName
Gets the name of the service. It can reflect the service name of the name of the provider.- Returns:
- the name
-
setName
-
getStatus
-
setStatus
Sets the status of the service. When published, the status is set toStatus.UP. When withdrawn, the status is set toStatus.DOWN.- Parameters:
status- the status, must not benull- Returns:
- the current
Record
-
setRegistration
-
getRegistration
Gets the registration id if any. Getting anullresult means that the record has not been published.- Returns:
- the registration id.
-
getType
Gets the service type. The type represents what kind of "resource" is represented by this record. For example it can be "http-endpoint", "database", "message-source"... The set of types is extensible.The type defines how the the service object is retrieved, and also manages the binding. Some records may have no type and let the consumer manage how the service is used.
- Returns:
- the type
-
setType
-
match
Checks whether or not the currentRecordmatches the filter.- Parameters:
filter- the filter- Returns:
- whether or not the record matches the filter
-
equals
-
hashCode
-
toString
-