Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.intent; |
| 2 | |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 3 | import org.onlab.onos.event.AbstractEvent; |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 4 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 5 | /** |
| 6 | * A class to represent an intent related event. |
| 7 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 8 | public class IntentEvent extends AbstractEvent<IntentEvent.Type, Intent> { |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 9 | |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 10 | public enum Type { |
| 11 | /** |
| 12 | * Signifies that a new intent has been submitted to the system. |
| 13 | */ |
| 14 | SUBMITTED, |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 15 | |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 16 | /** |
| 17 | * Signifies that an intent has been successfully installed. |
| 18 | */ |
| 19 | INSTALLED, |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 20 | |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 21 | /** |
| 22 | * Signifies that an intent has failed compilation or installation. |
| 23 | */ |
| 24 | FAILED, |
| 25 | |
| 26 | /** |
| 27 | * Signifies that an intent has been withdrawn from the system. |
| 28 | */ |
| 29 | WITHDRAWN |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 33 | * Creates an event of a given type and for the specified intent and the |
| 34 | * current time. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 35 | * |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 36 | * @param type event type |
| 37 | * @param intent subject intent |
| 38 | * @param time time the event created in milliseconds since start of epoch |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 39 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 40 | public IntentEvent(Type type, Intent intent, long time) { |
| 41 | super(type, intent, time); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 45 | * Creates an event of a given type and for the specified intent and the |
| 46 | * current time. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 47 | * |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 48 | * @param type event type |
| 49 | * @param intent subject intent |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 50 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 51 | public IntentEvent(Type type, Intent intent) { |
| 52 | super(type, intent); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 53 | } |
| 54 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 55 | } |