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