Package org.onosproject.net.intent
Class IntentEvent
- java.lang.Object
-
- org.onosproject.event.AbstractEvent<IntentEvent.Type,Intent>
-
- org.onosproject.net.intent.IntentEvent
-
- All Implemented Interfaces:
Event<IntentEvent.Type,Intent>
@Beta public class IntentEvent extends AbstractEvent<IntentEvent.Type,Intent>
A class to represent an intent related event.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IntentEvent.Type
-
Constructor Summary
Constructors Constructor Description IntentEvent(IntentEvent.Type type, Intent intent)
Creates an event of a given type and for the specified intent and the current time.IntentEvent(IntentEvent.Type type, Intent intent, long time)
Creates an event of a given type and for the specified intent and the current time.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<IntentEvent>
getEvent(IntentData data)
Creates an IntentEvent based on the state contained in the given intent data.static java.util.Optional<IntentEvent>
getEvent(IntentState state, Intent intent)
Creates an IntentEvent based on the given state and intent.-
Methods inherited from class org.onosproject.event.AbstractEvent
subject, time, toString, type
-
-
-
-
Constructor Detail
-
IntentEvent
public IntentEvent(IntentEvent.Type type, Intent intent, long time)
Creates an event of a given type and for the specified intent and the current time.- Parameters:
type
- event typeintent
- subject intenttime
- time the event created in milliseconds since start of epoch
-
IntentEvent
public IntentEvent(IntentEvent.Type type, Intent intent)
Creates an event of a given type and for the specified intent and the current time.- Parameters:
type
- event typeintent
- subject intent
-
-
Method Detail
-
getEvent
public static java.util.Optional<IntentEvent> getEvent(IntentData data)
Creates an IntentEvent based on the state contained in the given intent data. Some states are not sent as external events, and these states will return null events.- Parameters:
data
- the intent data to create an event for- Returns:
- new intent event if the state is valid, otherwise null.
-
getEvent
public static java.util.Optional<IntentEvent> getEvent(IntentState state, Intent intent)
Creates an IntentEvent based on the given state and intent. Some states are not sent as external events, and these states will return null events.- Parameters:
state
- new state of the intentintent
- intent to put in event- Returns:
- new intent event if the state is valid, otherwise null.
-
-