public class MastershipEvent extends AbstractEvent<MastershipEvent.Type,DeviceId>
| Modifier and Type | Class and Description |
|---|---|
static class |
MastershipEvent.Type
Type of mastership events.
|
| Constructor and Description |
|---|
MastershipEvent(MastershipEvent.Type type,
DeviceId device,
RoleInfo info)
Creates an event of a given type and for the specified device,
role information, and the current time.
|
MastershipEvent(MastershipEvent.Type type,
DeviceId device,
RoleInfo info,
long time)
Creates an event of a given type and for the specified device, master,
and time.
|
| Modifier and Type | Method and Description |
|---|---|
RoleInfo |
roleInfo()
Returns the current role state for the subject.
|
String |
toString() |
subject, time, typepublic MastershipEvent(MastershipEvent.Type type, DeviceId device, RoleInfo info)
type - mastership event typedevice - event device subjectinfo - mastership role informationpublic MastershipEvent(MastershipEvent.Type type, DeviceId device, RoleInfo info, long time)
type - mastership event typedevice - event device subjectinfo - role informationtime - occurrence timepublic RoleInfo roleInfo()
public String toString()
toString in class AbstractEvent<MastershipEvent.Type,DeviceId>