blob: 04288641426a63eca8faecb47bce555d2d7de678 [file] [log] [blame]
Ray Milkeye97ede92014-11-20 10:43:12 -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.resource;
17
18import java.util.Collection;
19
20import org.onlab.onos.event.AbstractEvent;
21
22import com.google.common.collect.ImmutableList;
23
24/**
25 * Describes an event related to a Link Resource.
26 */
27public final class LinkResourceEvent
28 extends AbstractEvent<LinkResourceEvent.Type, Collection<LinkResourceAllocations>> {
29
30 /**
31 * Type of resource this event is for.
32 */
33 public enum Type {
34 /** Additional resources are now available. */
35 ADDITIONAL_RESOURCES_AVAILABLE
36 }
37
38 /**
39 * Constructs a link resource event.
40 *
41 * @param type type of resource event to create
42 * @param linkResourceAllocations allocations that are now available
43 */
44 public LinkResourceEvent(Type type,
45 Collection<LinkResourceAllocations> linkResourceAllocations) {
46 super(type, ImmutableList.copyOf(linkResourceAllocations));
47 }
48}