blob: 22a24f928d9d6813d199b9b5ac0bbd65e637ba42 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
Brian O'Connorb876bf12014-10-02 14:59:37 -070019package org.onlab.onos.net.intent;
20
toma1d16b62014-10-02 23:45:11 -070021import org.onlab.onos.event.AbstractEvent;
Brian O'Connorb876bf12014-10-02 14:59:37 -070022
Brian O'Connorb876bf12014-10-02 14:59:37 -070023/**
24 * A class to represent an intent related event.
25 */
tom85258ee2014-10-07 00:10:02 -070026public class IntentEvent extends AbstractEvent<IntentEvent.Type, Intent> {
Brian O'Connorb876bf12014-10-02 14:59:37 -070027
tom85258ee2014-10-07 00:10:02 -070028 public enum Type {
29 /**
30 * Signifies that a new intent has been submitted to the system.
31 */
32 SUBMITTED,
Brian O'Connorb876bf12014-10-02 14:59:37 -070033
tom85258ee2014-10-07 00:10:02 -070034 /**
35 * Signifies that an intent has been successfully installed.
36 */
37 INSTALLED,
Brian O'Connorb876bf12014-10-02 14:59:37 -070038
tom85258ee2014-10-07 00:10:02 -070039 /**
40 * Signifies that an intent has failed compilation or installation.
41 */
42 FAILED,
43
44 /**
45 * Signifies that an intent has been withdrawn from the system.
46 */
47 WITHDRAWN
Brian O'Connorb876bf12014-10-02 14:59:37 -070048 }
49
50 /**
tom85258ee2014-10-07 00:10:02 -070051 * Creates an event of a given type and for the specified intent and the
52 * current time.
Brian O'Connorb876bf12014-10-02 14:59:37 -070053 *
tom85258ee2014-10-07 00:10:02 -070054 * @param type event type
55 * @param intent subject intent
56 * @param time time the event created in milliseconds since start of epoch
Brian O'Connorb876bf12014-10-02 14:59:37 -070057 */
tom85258ee2014-10-07 00:10:02 -070058 public IntentEvent(Type type, Intent intent, long time) {
59 super(type, intent, time);
Brian O'Connorb876bf12014-10-02 14:59:37 -070060 }
61
62 /**
tom85258ee2014-10-07 00:10:02 -070063 * Creates an event of a given type and for the specified intent and the
64 * current time.
Brian O'Connorb876bf12014-10-02 14:59:37 -070065 *
tom85258ee2014-10-07 00:10:02 -070066 * @param type event type
67 * @param intent subject intent
Brian O'Connorb876bf12014-10-02 14:59:37 -070068 */
tom85258ee2014-10-07 00:10:02 -070069 public IntentEvent(Type type, Intent intent) {
70 super(type, intent);
Brian O'Connorb876bf12014-10-02 14:59:37 -070071 }
72
Brian O'Connorb876bf12014-10-02 14:59:37 -070073}