Interface ServiceDiscoveryBackend
- All Known Implementing Classes:
RedisBackendService
public interface ServiceDiscoveryBackend
By default the service discovery uses a distributed map to store the records. But this backend can be replaced. To
replace a backend implement this interface and configure the SPI to point to your implementation.
check DefaultServiceDiscoveryBackend for more details.
- Author:
- Clement Escoffier
-
Method Summary
Modifier and TypeMethodDescriptionvoidgetRecord(String uuid, Handler<AsyncResult<Record>> resultHandler) Get the record with the given uuid.voidgetRecords(Handler<AsyncResult<List<Record>>> resultHandler) Gets all the recordsvoidinit(Vertx vertx, JsonObject config) Initializes the backend.default Stringname()voidremove(Record record, Handler<AsyncResult<Record>> resultHandler) Removes a record.voidremove(String uuid, Handler<AsyncResult<Record>> resultHandler) Removes a records based on its UUID.voidstore(Record record, Handler<AsyncResult<Record>> resultHandler) Stores a record.voidupdate(Record record, Handler<AsyncResult<Void>> resultHandler) Updates a record
-
Method Details
-
name
- Returns:
- the name of the implementation, used to select the right one (when there are several implementation on the classpath). By default it ruturns the class name of the implementation (as String).
-
init
Initializes the backend.- Parameters:
vertx- the vert.x instanceconfig- the configuration if any.
-
store
Stores a record.- Parameters:
record- the recordresultHandler- the completion handler
-
remove
Removes a record.- Parameters:
record- the recordresultHandler- the completion handler
-
remove
Removes a records based on its UUID.- Parameters:
uuid- the uuid / registration idresultHandler- the completion handler
-
update
Updates a record- Parameters:
record- the record to updateresultHandler- the completion handler
-
getRecords
Gets all the records- Parameters:
resultHandler- the result handler
-
getRecord
Get the record with the given uuid.- Parameters:
uuid- the uuid / registration idresultHandler- the result handler
-