blob: 1a80d59d65eb2456da09b5a993fc8df3ea2deb9a [file] [log] [blame]
Madan Jampani837a3632016-01-21 16:47:26 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Madan Jampani837a3632016-01-21 16:47:26 -08003 *
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.onosproject.store.primitives;
17
18import org.onosproject.cluster.Partition;
19import org.onosproject.event.AbstractEvent;
20
21/**
22 * Describes partition-related event.
23 */
24public class PartitionEvent extends AbstractEvent<PartitionEvent.Type, Partition> {
25
26 /**
27 * Type of partition-related events.
28 */
29 public enum Type {
30
31 /**
32 * Signifies that a partition has been administratively updated.
33 */
34 UPDATED,
35
36 /**
37 * Signifies that a partition has been successfully opened.
38 */
39 OPENED,
40
41 /**
42 * Signifies that a partition has been successfully closed.
43 */
44 CLOSED,
45
46 /**
47 * Signifies that a partition is available for operations.
48 */
49 AVAILABLE,
50
51 /**
52 * Signifies that a partition is unavailable for operations.
53 */
54 UNAVAILABLE,
55 }
56
57 /**
58 * Creates an event of a given type and for the specified partition and time.
59 *
60 * @param type partition event type
61 * @param subject event partition subject
62 * @param time occurrence time
63 */
64 protected PartitionEvent(Type type, Partition subject, long time) {
65 super(type, subject, time);
66 }
67}