blob: cd5297f0ce6f39d5335aa440a88befaaa0b601a0 [file] [log] [blame]
Brian O'Connor86f6f7f2014-12-01 17:02:45 -08001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
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
7 *
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.
15 */
16package org.onlab.onos.net.intent;
17
18import org.onlab.onos.core.ApplicationId;
19import org.onlab.onos.event.AbstractEvent;
20
21/**
22 * A class to represent an intent related event.
23 */
24public class IntentBatchLeaderEvent extends AbstractEvent<IntentBatchLeaderEvent.Type, ApplicationId> {
25
26 public enum Type {
27 /**
28 * Signifies that this instance has become the leader for the given application id.
29 */
30 ELECTED,
31
32 /**
33 * Signifies that instance is no longer the leader for a given application id.
34 */
35 BOOTED
36 }
37
38 /**
39 * Creates an event of a given type and for the specified appId and the
40 * current time.
41 *
42 * @param type event type
43 * @param appId subject appId
44 * @param time time the event created in milliseconds since start of epoch
45 */
46 public IntentBatchLeaderEvent(Type type, ApplicationId appId, long time) {
47 super(type, appId, time);
48 }
49
50 /**
51 * Creates an event of a given type and for the specified appId and the
52 * current time.
53 *
54 * @param type event type
55 * @param appId subject appId
56 */
57 public IntentBatchLeaderEvent(Type type, ApplicationId appId) {
58 super(type, appId);
59 }
60
61}