Class RedisBackendService
- java.lang.Object
-
- io.vertx.servicediscovery.backend.redis.RedisBackendService
-
- All Implemented Interfaces:
ServiceDiscoveryBackend
public class RedisBackendService extends Object implements ServiceDiscoveryBackend
An implementation of the discovery backend based on Redis.- Author:
- Clement Escoffier
-
-
Constructor Summary
Constructors Constructor Description RedisBackendService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
getRecord(String uuid, Handler<AsyncResult<Record>> resultHandler)
Get the record with the given uuid.void
getRecords(Handler<AsyncResult<List<Record>>> resultHandler)
Gets all the recordsvoid
init(Vertx vertx, JsonObject configuration)
Initializes the backend.void
remove(Record record, Handler<AsyncResult<Record>> resultHandler)
Removes a record.void
remove(String uuid, Handler<AsyncResult<Record>> resultHandler)
Removes a records based on its UUID.void
store(Record record, Handler<AsyncResult<Record>> resultHandler)
Stores a record.void
update(Record record, Handler<AsyncResult<Void>> resultHandler)
Updates a record-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertx.servicediscovery.spi.ServiceDiscoveryBackend
name
-
-
-
-
Method Detail
-
init
public void init(Vertx vertx, JsonObject configuration)
Description copied from interface:ServiceDiscoveryBackend
Initializes the backend.- Specified by:
init
in interfaceServiceDiscoveryBackend
- Parameters:
vertx
- the vert.x instanceconfiguration
- the configuration if any.
-
store
public void store(Record record, Handler<AsyncResult<Record>> resultHandler)
Description copied from interface:ServiceDiscoveryBackend
Stores a record.- Specified by:
store
in interfaceServiceDiscoveryBackend
- Parameters:
record
- the recordresultHandler
- the completion handler
-
remove
public void remove(Record record, Handler<AsyncResult<Record>> resultHandler)
Description copied from interface:ServiceDiscoveryBackend
Removes a record.- Specified by:
remove
in interfaceServiceDiscoveryBackend
- Parameters:
record
- the recordresultHandler
- the completion handler
-
remove
public void remove(String uuid, Handler<AsyncResult<Record>> resultHandler)
Description copied from interface:ServiceDiscoveryBackend
Removes a records based on its UUID.- Specified by:
remove
in interfaceServiceDiscoveryBackend
- Parameters:
uuid
- the uuid / registration idresultHandler
- the completion handler
-
update
public void update(Record record, Handler<AsyncResult<Void>> resultHandler)
Description copied from interface:ServiceDiscoveryBackend
Updates a record- Specified by:
update
in interfaceServiceDiscoveryBackend
- Parameters:
record
- the record to updateresultHandler
- the completion handler
-
getRecords
public void getRecords(Handler<AsyncResult<List<Record>>> resultHandler)
Description copied from interface:ServiceDiscoveryBackend
Gets all the records- Specified by:
getRecords
in interfaceServiceDiscoveryBackend
- Parameters:
resultHandler
- the result handler
-
getRecord
public void getRecord(String uuid, Handler<AsyncResult<Record>> resultHandler)
Description copied from interface:ServiceDiscoveryBackend
Get the record with the given uuid.- Specified by:
getRecord
in interfaceServiceDiscoveryBackend
- Parameters:
uuid
- the uuid / registration idresultHandler
- the result handler
-
-