Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 4 | * 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 Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 8 | * 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 Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.intent; |
| 17 | |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 18 | import org.onlab.onos.event.AbstractEvent; |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 19 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 20 | /** |
| 21 | * A class to represent an intent related event. |
| 22 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 23 | public class IntentEvent extends AbstractEvent<IntentEvent.Type, Intent> { |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 24 | |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 25 | public enum Type { |
| 26 | /** |
| 27 | * Signifies that a new intent has been submitted to the system. |
| 28 | */ |
| 29 | SUBMITTED, |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 30 | |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 31 | /** |
| 32 | * Signifies that an intent has been successfully installed. |
| 33 | */ |
| 34 | INSTALLED, |
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 | /** |
| 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'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 48 | * Creates an event of a given type and for the specified intent and the |
| 49 | * current time. |
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 | * @param type event type |
| 52 | * @param intent subject intent |
| 53 | * @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] | 54 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 55 | public IntentEvent(Type type, Intent intent, long time) { |
| 56 | super(type, intent, time); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 60 | * Creates an event of a given type and for the specified intent and the |
| 61 | * current time. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 62 | * |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 63 | * @param type event type |
| 64 | * @param intent subject intent |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 65 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 66 | public IntentEvent(Type type, Intent intent) { |
| 67 | super(type, intent); |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 68 | } |
| 69 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 70 | } |