blob: 98abf301739d260fe9cb01c1169ed370c273dceb [file] [log] [blame]
Sho SHIMIZUfa62b472015-11-02 17:35:46 -08001/*
2 * Copyright 2015 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.onosproject.net.newresource;
17
18import com.google.common.annotations.Beta;
19import org.onosproject.event.AbstractEvent;
20
21import static com.google.common.base.Preconditions.checkNotNull;
22
23/**
24 * Describes an event related to a resource.
25 */
26@Beta
27public final class ResourceEvent extends AbstractEvent<ResourceEvent.Type, ResourcePath> {
28
29 /**
30 * Type of resource events.
31 */
32 @Beta
33 public enum Type {
34 /**
35 * Signifies that a new resource has been detected.
36 */
37 RESOURCE_ADDED,
38
39 /**
40 * Signifies that a resource has been removed.
41 */
42 RESOURCE_REMOVED
43 }
44
45 /**
46 * Create a resource event.
47 *
48 * @param type type of resource event
49 * @param subject subject of resource event
50 */
51 public ResourceEvent(Type type, ResourcePath subject) {
52 super(checkNotNull(type), checkNotNull(subject));
53 }
54}