blob: 6542cd77a84554afcccc0b6208744751d3da62c6 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.cluster;
tom73d6d1e2014-09-17 20:08:01 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.event.AbstractEvent;
tom73d6d1e2014-09-17 20:08:01 -070019
20/**
21 * Describes cluster-related event.
22 */
tome4729872014-09-23 00:37:37 -070023public class ClusterEvent extends AbstractEvent<ClusterEvent.Type, ControllerNode> {
tom73d6d1e2014-09-17 20:08:01 -070024
25 /**
tomfc9a4ff2014-09-22 18:22:47 -070026 * Type of cluster-related events.
tom73d6d1e2014-09-17 20:08:01 -070027 */
28 public enum Type {
29 /**
30 * Signifies that a new cluster instance has been administratively added.
31 */
32 INSTANCE_ADDED,
33
34 /**
35 * Signifies that a cluster instance has been administratively removed.
36 */
37 INSTANCE_REMOVED,
38
39 /**
40 * Signifies that a cluster instance became active.
41 */
tomfc9a4ff2014-09-22 18:22:47 -070042 INSTANCE_ACTIVATED,
tom73d6d1e2014-09-17 20:08:01 -070043
44 /**
Thomas Vachuskafba7f3d2016-03-23 15:46:25 -070045 * Signifies that a cluster instance became ready.
46 */
47 INSTANCE_READY,
48
49 /**
tom73d6d1e2014-09-17 20:08:01 -070050 * Signifies that a cluster instance became inactive.
51 */
tomfc9a4ff2014-09-22 18:22:47 -070052 INSTANCE_DEACTIVATED
tom73d6d1e2014-09-17 20:08:01 -070053 }
tom73d6d1e2014-09-17 20:08:01 -070054
55 /**
56 * Creates an event of a given type and for the specified instance and the
57 * current time.
58 *
59 * @param type cluster event type
60 * @param instance cluster device subject
61 */
tome4729872014-09-23 00:37:37 -070062 public ClusterEvent(Type type, ControllerNode instance) {
tom73d6d1e2014-09-17 20:08:01 -070063 super(type, instance);
64 }
65
66 /**
67 * Creates an event of a given type and for the specified device and time.
68 *
69 * @param type device event type
70 * @param instance event device subject
71 * @param time occurrence time
72 */
tome4729872014-09-23 00:37:37 -070073 public ClusterEvent(Type type, ControllerNode instance, long time) {
tom73d6d1e2014-09-17 20:08:01 -070074 super(type, instance, time);
75 }
76
77}