public class InstanceLifecycleEvent extends Event
InstanceLifecycleEvent signal about changes in instance life (startup, shutdown, refresh, etc.) cycle and
contains all necessary information about instance: id, version, location in system and configuration.
To create instance of InstanceLifecycleEvent use {InstanceLifecycleEvent.Builder}.
Required properties is type, instanceId and version. All other are optional and can be null.
By default, event creates with random generated id and current time timestamp value. If necessary create copy of
other event or convert from DTO you must set value of both parameters id and timestamp.
When only one of two parameters initialized builder ignore it.
| Modifier and Type | Class and Description |
|---|---|
static class |
InstanceLifecycleEvent.Builder
Builder for constructing
InstanceLifecycleEvent objects. |
static class |
InstanceLifecycleEvent.Type
Enumeration of instance lifecycle states.
|
| Modifier and Type | Method and Description |
|---|---|
static InstanceLifecycleEvent.Builder |
builder()
Create new instance of
InstanceStartupEvent.Builder. |
java.lang.String |
getInstanceId()
Returns id of service instance.
|
java.lang.String |
getNodeId()
Returns node id of service instance.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Returns map with configuration properties of service instance.
|
InstanceLifecycleEvent.Type |
getType()
Return instance lifecycle state about that event signals.
|
java.net.URI |
getUri()
Returns URI to root path of service instance.
|
java.lang.String |
getVersion()
Returns version of service instance.
|
getId, getTimestamppublic InstanceLifecycleEvent.Type getType()
Type of life cycle event.public java.lang.String getInstanceId()
public java.lang.String getVersion()
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Map<String, Object object. If no properties present return empty map, never null.public java.lang.String getNodeId()
null.public java.net.URI getUri()
URI object. If URI not present returns null.public static InstanceLifecycleEvent.Builder builder()
InstanceStartupEvent.Builder.