Class EurekaRegistryService
java.lang.Object
org.kiwiproject.registry.eureka.server.EurekaRegistryService
- All Implemented Interfaces:
RegistryService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFunny story ...static final Stringstatic final StringKey for lease info representing lease duration in seconds.static final StringKey for lease info representing renewal interval in seconds.static final intMaximum number of attempts we will make to await confirmation that we're registered with Eureka.static final intMaximum number of attempts we will make trying to register with Eureka (via POST) -
Constructor Summary
ConstructorsConstructorDescriptionEurekaRegistryService(EurekaRegistrationConfig config, EurekaRestClient client, org.kiwiproject.base.KiwiEnvironment environment) EurekaRegistryService(EurekaRegistrationConfig config, EurekaRestClient client, org.kiwiproject.base.KiwiEnvironment environment, org.kiwiproject.retry.SimpleRetryer registerRetryer, org.kiwiproject.retry.SimpleRetryer awaitRetryer, org.kiwiproject.retry.SimpleRetryer updateStatusRetryer, org.kiwiproject.retry.SimpleRetryer unregisterRetryer) -
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
-
Field Details
-
DEFAULT_DATA_CENTER_INFO_CLASS
Funny story ... this class doesn't actually exist. It's for "backwards compatibility".See com.netflix.discovery.converters.jackson.DataCenterTypeInfoResolver for details. (NOTE: javadoc annotation not used to avoid unnecessary errors.)
- See Also:
-
DEFAULT_DATA_CENTER_NAME
- See Also:
-
LEASE_DURATION_IN_SECONDS
Key for lease info representing lease duration in seconds.- See Also:
-
LEASE_RENEWAL_INTERVAL_IN_SECONDS
Key for lease info representing renewal interval in seconds.- See Also:
-
MAX_AWAIT_REGISTRATION_CONFIRMATION_TRIES
public static final int MAX_AWAIT_REGISTRATION_CONFIRMATION_TRIESMaximum number of attempts we will make to await confirmation that we're registered with Eureka.- See Also:
-
MAX_REGISTRATION_ATTEMPTS
public static final int MAX_REGISTRATION_ATTEMPTSMaximum number of attempts we will make trying to register with Eureka (via POST)- See Also:
-
-
Constructor Details
-
EurekaRegistryService
public EurekaRegistryService(EurekaRegistrationConfig config, EurekaRestClient client, org.kiwiproject.base.KiwiEnvironment environment) -
EurekaRegistryService
public EurekaRegistryService(EurekaRegistrationConfig config, EurekaRestClient client, org.kiwiproject.base.KiwiEnvironment environment, org.kiwiproject.retry.SimpleRetryer registerRetryer, org.kiwiproject.retry.SimpleRetryer awaitRetryer, org.kiwiproject.retry.SimpleRetryer updateStatusRetryer, org.kiwiproject.retry.SimpleRetryer unregisterRetryer)
-
-
Method Details
-
createCandidateFrom
Description copied from interface:RegistryServiceCreates a newServiceInstanceinstance from aServiceInfothat can be registered with the registry server.- Specified by:
createCandidateFromin interfaceRegistryService- Parameters:
serviceInfo- Service information that will be used to set up a new instance to be registered.- Returns:
- The
ServiceInstanceobject that was created
-
register
Description copied from interface:RegistryServiceRegisters aServiceInstancewith the registry server and returns a new instance containing information about the registered instance.- Specified by:
registerin interfaceRegistryService- Parameters:
serviceToRegister- The service information to register- Returns:
- The service instance that was registered
-
updateStatus
Description copied from interface:RegistryServiceSends an update to the registry server to inform of a service status change- Specified by:
updateStatusin interfaceRegistryService- Parameters:
newStatus- The new status that will be sent- Returns:
- a copy of the original
ServiceInstancewith the new status set
-
unregister
public void unregister()Description copied from interface:RegistryServiceUnregisters any registrations that were previously registered. This should be a NO-OP if nothing has ever been registered.- Specified by:
unregisterin interfaceRegistryService
-