37622e793b6e04a76349cd90548b218ce5e7f477
[onosfw.git] /
1 /*
2  * Copyright 2014-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  */
16 package org.onosproject.net.resource.link;
17
18 import java.util.Collection;
19 import java.util.Map;
20 import java.util.Set;
21
22 import com.google.common.annotations.Beta;
23 import org.onosproject.net.Link;
24 import org.onosproject.net.intent.Constraint;
25 import org.onosproject.net.intent.IntentId;
26 import org.onosproject.net.resource.ResourceRequest;
27
28 /**
29  * Representation of a request for link resource.
30  */
31 public interface LinkResourceRequest extends ResourceRequest {
32
33     /**
34      * Returns the {@link IntentId} associated with the request.
35      *
36      * @return the {@link IntentId} associated with the request
37      */
38     IntentId intentId();
39
40     /**
41      * Returns the set of target links.
42      *
43      * @return the set of target links
44      */
45     Collection<Link> links();
46
47     /**
48      * Returns the set of resource requests.
49      *
50      * @return the set of resource requests
51      */
52     Set<ResourceRequest> resources();
53
54     /**
55      * Returns the set of resource request against the specified link.
56      *
57      * @param link link whose associated resource request is to be returned
58      * @return set of resource request against the specified link
59      */
60     @Beta
61     Set<ResourceRequest> resources(Link link);
62
63     /**
64      * Builder of link resource request.
65      */
66     interface Builder {
67         /**
68          * Adds lambda request.
69          *
70          * @return self
71          * @deprecated in Emu Release
72          */
73         @Deprecated
74         Builder addLambdaRequest();
75
76         /**
77          * Adds lambda request.
78          *
79          * @param lambda lambda to be requested
80          * @return self
81          */
82         @Beta
83         Builder addLambdaRequest(LambdaResource lambda);
84
85         /**
86          * Adds MPLS request.
87          *
88          * @return self
89          * @deprecated in Emu Release
90          */
91         @Deprecated
92         Builder addMplsRequest();
93
94         /**
95          * Adds MPLS request.
96          *
97          * @param label MPLS label to be requested
98          * @return self
99          */
100         @Beta
101         Builder addMplsRequest(MplsLabel label);
102
103         /**
104          * Adds MPLS request against the specified links.
105          *
106          * @param labels MPLS labels to be requested against links
107          * @return self
108          */
109         @Beta
110         Builder addMplsRequest(Map<Link, MplsLabel> labels);
111
112         /**
113          * Adds bandwidth request with bandwidth value.
114          *
115          * @param bandwidth bandwidth value to be requested
116          * @return self
117          */
118         Builder addBandwidthRequest(double bandwidth);
119
120         /**
121          * Adds the resources required for a constraint.
122          *
123          * @param constraint the constraint
124          * @return self
125          */
126         Builder addConstraint(Constraint constraint);
127
128         /**
129          * Returns link resource request.
130          *
131          * @return link resource request
132          */
133         LinkResourceRequest build();
134     }
135 }