Package com.netflix.appinfo
Class LeaseInfo
- java.lang.Object
-
- com.netflix.appinfo.LeaseInfo
-
public class LeaseInfo extends java.lang.ObjectRepresents the lease information with Eureka.Eureka decides to remove the instance out of its view depending on the duration that is set in
EurekaInstanceConfig.getLeaseExpirationDurationInSeconds()which is held in this lease. The lease also tracks the last time it was renewed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLeaseInfo.Builder
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LEASE_DURATIONstatic intDEFAULT_LEASE_RENEWAL_INTERVAL
-
Constructor Summary
Constructors Constructor Description LeaseInfo(int renewalIntervalInSecs, int durationInSecs, long registrationTimestamp, java.lang.Long lastRenewalTimestamp, long lastRenewalTimestampLegacy, long evictionTimestamp, long serviceUpTimestamp)TODO: note about renewalTimestamp legacy: The previous change to use Jackson ser/deser changed the field name for lastRenewalTimestamp to renewalTimestamp for serialization, which causes an incompatibility with the jacksonNG codec when the server returns data with field renewalTimestamp and jacksonNG expects lastRenewalTimestamp.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDurationInSecs()Returns client specified setting for eviction (e.g.longgetEvictionTimestamp()Returns the de-registration timestamp.longgetRegistrationTimestamp()Returns the registration timestamp.intgetRenewalIntervalInSecs()Returns client specified setting for renew interval.longgetRenewalTimestamp()Returns the last renewal timestamp of lease.longgetServiceUpTimestamp()Returns the service UP timestamp.
-
-
-
Field Detail
-
DEFAULT_LEASE_RENEWAL_INTERVAL
public static final int DEFAULT_LEASE_RENEWAL_INTERVAL
- See Also:
- Constant Field Values
-
DEFAULT_LEASE_DURATION
public static final int DEFAULT_LEASE_DURATION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LeaseInfo
public LeaseInfo(int renewalIntervalInSecs, int durationInSecs, long registrationTimestamp, java.lang.Long lastRenewalTimestamp, long lastRenewalTimestampLegacy, long evictionTimestamp, long serviceUpTimestamp)TODO: note about renewalTimestamp legacy: The previous change to use Jackson ser/deser changed the field name for lastRenewalTimestamp to renewalTimestamp for serialization, which causes an incompatibility with the jacksonNG codec when the server returns data with field renewalTimestamp and jacksonNG expects lastRenewalTimestamp. Remove this legacy field from client code in a few releases (once servers are updated to a release that generates json with the correct lastRenewalTimestamp).
-
-
Method Detail
-
getRegistrationTimestamp
public long getRegistrationTimestamp()
Returns the registration timestamp.- Returns:
- time in milliseconds since epoch.
-
getRenewalTimestamp
public long getRenewalTimestamp()
Returns the last renewal timestamp of lease.- Returns:
- time in milliseconds since epoch.
-
getEvictionTimestamp
public long getEvictionTimestamp()
Returns the de-registration timestamp.- Returns:
- time in milliseconds since epoch.
-
getServiceUpTimestamp
public long getServiceUpTimestamp()
Returns the service UP timestamp.- Returns:
- time in milliseconds since epoch.
-
getRenewalIntervalInSecs
public int getRenewalIntervalInSecs()
Returns client specified setting for renew interval.- Returns:
- time in milliseconds since epoch.
-
getDurationInSecs
public int getDurationInSecs()
Returns client specified setting for eviction (e.g. how long to wait w/o renewal event)- Returns:
- time in milliseconds since epoch.
-
-