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 classMastershipEvent.TypeType 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 booleanequals(java.lang.Object obj)inthashCode()MastershipInfomastershipInfo()Returns the mastership info.RoleInforoleInfo()Deprecated.since 1.14java.lang.StringtoString()- 
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
 
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classAbstractEvent<MastershipEvent.Type,DeviceId>
 
 - 
 
 -