8023a92e41c91f684610a60b22843d4427f12bb8
[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.Set;
20
21 import org.onosproject.net.Link;
22 import org.onosproject.net.intent.Constraint;
23 import org.onosproject.net.intent.IntentId;
24 import org.onosproject.net.resource.ResourceRequest;
25
26 /**
27  * Representation of a request for link resource.
28  */
29 public interface LinkResourceRequest extends ResourceRequest {
30
31     /**
32      * Returns the {@link IntentId} associated with the request.
33      *
34      * @return the {@link IntentId} associated with the request
35      */
36     IntentId intentId();
37
38     /**
39      * Returns the set of target links.
40      *
41      * @return the set of target links
42      */
43     Collection<Link> links();
44
45     /**
46      * Returns the set of resource requests.
47      *
48      * @return the set of resource requests
49      */
50     Set<ResourceRequest> resources();
51
52     /**
53      * Builder of link resource request.
54      */
55     interface Builder {
56          /**
57          * Adds lambda request.
58          *
59          * @return self
60          */
61         Builder addLambdaRequest();
62
63         /**
64         * Adds MPLS request.
65         *
66         * @return self
67         */
68        Builder addMplsRequest();
69
70         /**
71          * Adds bandwidth request with bandwidth value.
72          *
73          * @param bandwidth bandwidth value to be requested
74          * @return self
75          */
76         Builder addBandwidthRequest(double bandwidth);
77
78         /**
79          * Adds the resources required for a constraint.
80          *
81          * @param constraint the constraint
82          * @return self
83          */
84         Builder addConstraint(Constraint constraint);
85
86         /**
87          * Returns link resource request.
88          *
89          * @return link resource request
90          */
91         LinkResourceRequest build();
92     }
93 }