Package org.onosproject.mastership
Class MastershipEvent
- java.lang.Object
-
- org.onosproject.event.AbstractEvent<MastershipEvent.Type,DeviceId>
-
- org.onosproject.mastership.MastershipEvent
-
- All Implemented Interfaces:
Event<MastershipEvent.Type,DeviceId>
public class MastershipEvent extends AbstractEvent<MastershipEvent.Type,DeviceId>
Describes a device mastership event.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MastershipEvent.Type
Type of mastership events.
-
Constructor Summary
Constructors Constructor Description MastershipEvent(MastershipEvent.Type type, DeviceId device, MastershipInfo mastershipInfo)
Creates an event of a given type and for the specified device, role information, and the current time.MastershipEvent(MastershipEvent.Type type, DeviceId device, MastershipInfo mastershipInfo, long time)
Creates an event of a given type and for the specified device, master, and time.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
MastershipInfo
mastershipInfo()
Returns the mastership info.RoleInfo
roleInfo()
Deprecated.since 1.14String
toString()
-
Methods inherited from class org.onosproject.event.AbstractEvent
subject, time, type
-
-
-
-
Constructor Detail
-
MastershipEvent
public MastershipEvent(MastershipEvent.Type type, DeviceId device, MastershipInfo mastershipInfo)
Creates an event of a given type and for the specified device, role information, and the current time.- Parameters:
type
- mastership event typedevice
- event device subjectmastershipInfo
- mastership info
-
MastershipEvent
public MastershipEvent(MastershipEvent.Type type, DeviceId device, MastershipInfo mastershipInfo, long time)
Creates an event of a given type and for the specified device, master, and time.- Parameters:
type
- mastership event typedevice
- event device subjectmastershipInfo
- mastership informationtime
- occurrence time
-
-
Method Detail
-
mastershipInfo
public MastershipInfo mastershipInfo()
Returns the mastership info.- Returns:
- the mastership info
-
roleInfo
@Deprecated public RoleInfo roleInfo()
Deprecated.since 1.14Returns the current role state for the subject.- Returns:
- RoleInfo associated with Device ID subject
-
toString
public String toString()
- Overrides:
toString
in classAbstractEvent<MastershipEvent.Type,DeviceId>
-
-