Package org.kiwiproject.registry.server
Interface RegistryService
- All Known Implementing Classes:
ConsulRegistryService,EurekaRegistryService,NoopRegistryService
public interface RegistryService
Contract for implementations of a service registry.
-
Method Summary
Modifier and TypeMethodDescriptioncreateCandidateFrom(ServiceInfo serviceInfo) Creates a newServiceInstanceinstance from aServiceInfothat can be registered with the registry server.register(ServiceInstance serviceToRegister) Registers aServiceInstancewith the registry server and returns a new instance containing information about the registered instance.voidUnregisters any registrations that were previously registered.updateStatus(ServiceInstance.Status newStatus) Sends an update to the registry server to inform of a service status change
-
Method Details
-
createCandidateFrom
Creates a newServiceInstanceinstance from aServiceInfothat can be registered with the registry server.- Parameters:
serviceInfo- Service information that will be used to set up a new instance to be registered.- Returns:
- The
ServiceInstanceobject that was created
-
register
Registers aServiceInstancewith the registry server and returns a new instance containing information about the registered instance.- Parameters:
serviceToRegister- The service information to register- Returns:
- The service instance that was registered
-
updateStatus
Sends an update to the registry server to inform of a service status change- Parameters:
newStatus- The new status that will be sent- Returns:
- a copy of the original
ServiceInstancewith the new status set
-
unregister
void unregister()Unregisters any registrations that were previously registered. This should be a NO-OP if nothing has ever been registered.
-