blob: 9774e8e7acc8e05a5b3bd2be60cf7aaa437f1430 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Ray Milkey34c95902015-04-15 09:47:53 -07002 * Copyright 2014-2015 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'Connor6de2e202015-05-21 14:30:41 -070016package org.onosproject.net.resource.link;
Toshio Koide485b4782014-10-20 19:34:21 -070017
Sho SHIMIZU81cdc392015-10-27 15:18:49 -070018import java.util.Collection;
19import java.util.Map;
20import java.util.Set;
21
Sho SHIMIZUc25a0082015-10-27 17:06:29 -070022import com.google.common.annotations.Beta;
Brian O'Connorabafb502014-12-02 22:26:20 -080023import org.onosproject.net.Link;
24import org.onosproject.net.intent.Constraint;
25import org.onosproject.net.intent.IntentId;
Brian O'Connor6de2e202015-05-21 14:30:41 -070026import org.onosproject.net.resource.ResourceRequest;
Toshio Koide485b4782014-10-20 19:34:21 -070027
28/**
29 * Representation of a request for link resource.
Sho SHIMIZU364cbac2015-10-29 15:47:35 -070030 *
31 * @deprecated in Emu Release
Toshio Koide485b4782014-10-20 19:34:21 -070032 */
Sho SHIMIZU364cbac2015-10-29 15:47:35 -070033@Deprecated
Toshio Koide65e890f2014-10-23 12:02:25 -070034public interface LinkResourceRequest extends ResourceRequest {
Toshio Koide485b4782014-10-20 19:34:21 -070035
36 /**
37 * Returns the {@link IntentId} associated with the request.
38 *
39 * @return the {@link IntentId} associated with the request
40 */
Ayaka Koshibee114f042015-05-01 11:43:00 -070041 IntentId intentId();
Toshio Koide485b4782014-10-20 19:34:21 -070042
43 /**
44 * Returns the set of target links.
45 *
46 * @return the set of target links
47 */
Toshio Koide65e890f2014-10-23 12:02:25 -070048 Collection<Link> links();
Toshio Koide485b4782014-10-20 19:34:21 -070049
50 /**
51 * Returns the set of resource requests.
52 *
53 * @return the set of resource requests
54 */
Toshio Koide65e890f2014-10-23 12:02:25 -070055 Set<ResourceRequest> resources();
Toshio Koide569ca702014-10-23 11:37:44 -070056
57 /**
Sho SHIMIZU81cdc392015-10-27 15:18:49 -070058 * Returns the set of resource request against the specified link.
59 *
60 * @param link link whose associated resource request is to be returned
61 * @return set of resource request against the specified link
62 */
63 @Beta
64 Set<ResourceRequest> resources(Link link);
65
66 /**
Toshio Koide569ca702014-10-23 11:37:44 -070067 * Builder of link resource request.
68 */
Toshio Koide65e890f2014-10-23 12:02:25 -070069 interface Builder {
Sho SHIMIZU6603a852015-10-27 16:04:57 -070070 /**
Toshio Koide569ca702014-10-23 11:37:44 -070071 * Adds lambda request.
72 *
73 * @return self
Sho SHIMIZUc25a0082015-10-27 17:06:29 -070074 * @deprecated in Emu Release
Toshio Koide569ca702014-10-23 11:37:44 -070075 */
Sho SHIMIZUc25a0082015-10-27 17:06:29 -070076 @Deprecated
Sho SHIMIZU3310a342015-05-13 12:14:05 -070077 Builder addLambdaRequest();
Toshio Koide569ca702014-10-23 11:37:44 -070078
79 /**
Sho SHIMIZUc25a0082015-10-27 17:06:29 -070080 * Adds lambda request.
81 *
82 * @param lambda lambda to be requested
83 * @return self
84 */
85 @Beta
86 Builder addLambdaRequest(LambdaResource lambda);
87
88 /**
Sho SHIMIZU6603a852015-10-27 16:04:57 -070089 * Adds MPLS request.
90 *
91 * @return self
Sho SHIMIZU81cdc392015-10-27 15:18:49 -070092 * @deprecated in Emu Release
Sho SHIMIZU6603a852015-10-27 16:04:57 -070093 */
Sho SHIMIZU81cdc392015-10-27 15:18:49 -070094 @Deprecated
Sho SHIMIZU6603a852015-10-27 16:04:57 -070095 Builder addMplsRequest();
Michele Santuari4b6019e2014-12-19 11:31:45 +010096
97 /**
Sho SHIMIZU81cdc392015-10-27 15:18:49 -070098 * Adds MPLS request.
99 *
100 * @param label MPLS label to be requested
101 * @return self
102 */
103 @Beta
104 Builder addMplsRequest(MplsLabel label);
105
106 /**
107 * Adds MPLS request against the specified links.
108 *
109 * @param labels MPLS labels to be requested against links
110 * @return self
111 */
112 @Beta
113 Builder addMplsRequest(Map<Link, MplsLabel> labels);
114
115 /**
Toshio Koide569ca702014-10-23 11:37:44 -0700116 * Adds bandwidth request with bandwidth value.
117 *
118 * @param bandwidth bandwidth value to be requested
119 * @return self
120 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -0700121 Builder addBandwidthRequest(double bandwidth);
Toshio Koide569ca702014-10-23 11:37:44 -0700122
123 /**
Thomas Vachuskaedc944c2014-11-04 15:42:25 -0800124 * Adds the resources required for a constraint.
125 *
126 * @param constraint the constraint
127 * @return self
128 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -0700129 Builder addConstraint(Constraint constraint);
Thomas Vachuskaedc944c2014-11-04 15:42:25 -0800130
131 /**
Toshio Koide569ca702014-10-23 11:37:44 -0700132 * Returns link resource request.
133 *
134 * @return link resource request
135 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -0700136 LinkResourceRequest build();
Toshio Koide569ca702014-10-23 11:37:44 -0700137 }
Toshio Koide485b4782014-10-20 19:34:21 -0700138}