blob: 6d7a3b0cc7ca5affa5acb358c73e706962e710df [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska83e090e2014-10-22 14:25:35 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Thomas Vachuska83e090e2014-10-22 14:25:35 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Thomas Vachuska83e090e2014-10-22 14:25:35 -070015 */
Brian O'Connorb876bf12014-10-02 14:59:37 -070016package org.onlab.onos.net.intent;
17
toma1d16b62014-10-02 23:45:11 -070018import org.onlab.onos.event.AbstractEvent;
Brian O'Connorb876bf12014-10-02 14:59:37 -070019
Brian O'Connorb876bf12014-10-02 14:59:37 -070020/**
21 * A class to represent an intent related event.
22 */
tom85258ee2014-10-07 00:10:02 -070023public class IntentEvent extends AbstractEvent<IntentEvent.Type, Intent> {
Brian O'Connorb876bf12014-10-02 14:59:37 -070024
tom85258ee2014-10-07 00:10:02 -070025 public enum Type {
26 /**
27 * Signifies that a new intent has been submitted to the system.
28 */
29 SUBMITTED,
Brian O'Connorb876bf12014-10-02 14:59:37 -070030
tom85258ee2014-10-07 00:10:02 -070031 /**
32 * Signifies that an intent has been successfully installed.
33 */
34 INSTALLED,
Brian O'Connorb876bf12014-10-02 14:59:37 -070035
tom85258ee2014-10-07 00:10:02 -070036 /**
37 * Signifies that an intent has failed compilation or installation.
38 */
39 FAILED,
40
41 /**
42 * Signifies that an intent has been withdrawn from the system.
43 */
44 WITHDRAWN
Brian O'Connorb876bf12014-10-02 14:59:37 -070045 }
46
47 /**
tom85258ee2014-10-07 00:10:02 -070048 * Creates an event of a given type and for the specified intent and the
49 * current time.
Brian O'Connorb876bf12014-10-02 14:59:37 -070050 *
tom85258ee2014-10-07 00:10:02 -070051 * @param type event type
52 * @param intent subject intent
53 * @param time time the event created in milliseconds since start of epoch
Brian O'Connorb876bf12014-10-02 14:59:37 -070054 */
tom85258ee2014-10-07 00:10:02 -070055 public IntentEvent(Type type, Intent intent, long time) {
56 super(type, intent, time);
Brian O'Connorb876bf12014-10-02 14:59:37 -070057 }
58
59 /**
tom85258ee2014-10-07 00:10:02 -070060 * Creates an event of a given type and for the specified intent and the
61 * current time.
Brian O'Connorb876bf12014-10-02 14:59:37 -070062 *
tom85258ee2014-10-07 00:10:02 -070063 * @param type event type
64 * @param intent subject intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070065 */
tom85258ee2014-10-07 00:10:02 -070066 public IntentEvent(Type type, Intent intent) {
67 super(type, intent);
Brian O'Connorb876bf12014-10-02 14:59:37 -070068 }
69
Brian O'Connorb876bf12014-10-02 14:59:37 -070070}