blob: 742a590f821ff2b6da3ce55b7b0e158c1edd7f2f [file] [log] [blame]
Brian O'Connorb876bf12014-10-02 14:59:37 -07001package org.onlab.onos.net.intent;
2
toma1d16b62014-10-02 23:45:11 -07003import org.onlab.onos.event.AbstractEvent;
Brian O'Connorb876bf12014-10-02 14:59:37 -07004
Brian O'Connorb876bf12014-10-02 14:59:37 -07005/**
6 * A class to represent an intent related event.
7 */
tom85258ee2014-10-07 00:10:02 -07008public class IntentEvent extends AbstractEvent<IntentEvent.Type, Intent> {
Brian O'Connorb876bf12014-10-02 14:59:37 -07009
tom85258ee2014-10-07 00:10:02 -070010 public enum Type {
11 /**
12 * Signifies that a new intent has been submitted to the system.
13 */
14 SUBMITTED,
Brian O'Connorb876bf12014-10-02 14:59:37 -070015
tom85258ee2014-10-07 00:10:02 -070016 /**
17 * Signifies that an intent has been successfully installed.
18 */
19 INSTALLED,
Brian O'Connorb876bf12014-10-02 14:59:37 -070020
tom85258ee2014-10-07 00:10:02 -070021 /**
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'Connorb876bf12014-10-02 14:59:37 -070030 }
31
32 /**
tom85258ee2014-10-07 00:10:02 -070033 * Creates an event of a given type and for the specified intent and the
34 * current time.
Brian O'Connorb876bf12014-10-02 14:59:37 -070035 *
tom85258ee2014-10-07 00:10:02 -070036 * @param type event type
37 * @param intent subject intent
38 * @param time time the event created in milliseconds since start of epoch
Brian O'Connorb876bf12014-10-02 14:59:37 -070039 */
tom85258ee2014-10-07 00:10:02 -070040 public IntentEvent(Type type, Intent intent, long time) {
41 super(type, intent, time);
Brian O'Connorb876bf12014-10-02 14:59:37 -070042 }
43
44 /**
tom85258ee2014-10-07 00:10:02 -070045 * Creates an event of a given type and for the specified intent and the
46 * current time.
Brian O'Connorb876bf12014-10-02 14:59:37 -070047 *
tom85258ee2014-10-07 00:10:02 -070048 * @param type event type
49 * @param intent subject intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070050 */
tom85258ee2014-10-07 00:10:02 -070051 public IntentEvent(Type type, Intent intent) {
52 super(type, intent);
Brian O'Connorb876bf12014-10-02 14:59:37 -070053 }
54
Brian O'Connorb876bf12014-10-02 14:59:37 -070055}