blob: 7bdc1d7df78dc22398ac017ddcdeadf1dbbad796 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
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 */
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 /**
45 * Signifies that a cluster instance became inactive.
46 */
tomfc9a4ff2014-09-22 18:22:47 -070047 INSTANCE_DEACTIVATED
tom73d6d1e2014-09-17 20:08:01 -070048 }
tom73d6d1e2014-09-17 20:08:01 -070049
50 /**
51 * Creates an event of a given type and for the specified instance and the
52 * current time.
53 *
54 * @param type cluster event type
55 * @param instance cluster device subject
56 */
tome4729872014-09-23 00:37:37 -070057 public ClusterEvent(Type type, ControllerNode instance) {
tom73d6d1e2014-09-17 20:08:01 -070058 super(type, instance);
59 }
60
61 /**
62 * Creates an event of a given type and for the specified device and time.
63 *
64 * @param type device event type
65 * @param instance event device subject
66 * @param time occurrence time
67 */
tome4729872014-09-23 00:37:37 -070068 public ClusterEvent(Type type, ControllerNode instance, long time) {
tom73d6d1e2014-09-17 20:08:01 -070069 super(type, instance, time);
70 }
71
72}