blob: 973fa971e12ccbaa5902ae4de0abfd6a2261c174 [file] [log] [blame]
Toshio Koidec9051db2014-10-20 15:18:37 -07001package org.onlab.onos.net.resource;
2
Toshio Koidec9051db2014-10-20 15:18:37 -07003import org.onlab.onos.net.Link;
4import org.onlab.onos.net.intent.IntentId;
Toshio Koidec9051db2014-10-20 15:18:37 -07005
6/**
7 * Service for providing link resource allocation.
8 */
9public interface LinkResourceService {
10
11 /**
Toshio Koide485b4782014-10-20 19:34:21 -070012 * Requests resources.
Toshio Koidec9051db2014-10-20 15:18:37 -070013 *
Toshio Koide485b4782014-10-20 19:34:21 -070014 * @param req resources to be allocated
15 * @return allocated resources
Toshio Koidec9051db2014-10-20 15:18:37 -070016 */
Toshio Koide485b4782014-10-20 19:34:21 -070017 LinkResourceAllocations requestResources(LinkResourceRequest req);
Toshio Koidec9051db2014-10-20 15:18:37 -070018
19 /**
Toshio Koide485b4782014-10-20 19:34:21 -070020 * Releases resources.
Toshio Koidec9051db2014-10-20 15:18:37 -070021 *
Toshio Koide485b4782014-10-20 19:34:21 -070022 * @param allocations resources to be released
Toshio Koidec9051db2014-10-20 15:18:37 -070023 */
Toshio Koide485b4782014-10-20 19:34:21 -070024 void releaseResources(LinkResourceAllocations allocations);
Toshio Koidec9051db2014-10-20 15:18:37 -070025
26 /**
Toshio Koide485b4782014-10-20 19:34:21 -070027 * Returns all allocated resources.
Toshio Koidec9051db2014-10-20 15:18:37 -070028 *
Toshio Koide485b4782014-10-20 19:34:21 -070029 * @return allocated resources
Toshio Koidec9051db2014-10-20 15:18:37 -070030 */
Toshio Koide485b4782014-10-20 19:34:21 -070031 Iterable<LinkResourceAllocations> getAllocations();
Toshio Koidec9051db2014-10-20 15:18:37 -070032
Brian O'Connore7e4bd52014-10-23 13:36:23 -070033 LinkResourceAllocations getAllocation(IntentId intentId);
34
Toshio Koidec9051db2014-10-20 15:18:37 -070035 /**
36 * Returns all allocated resources to given link.
37 *
38 * @param link a target link
Toshio Koide485b4782014-10-20 19:34:21 -070039 * @return allocated resources
Toshio Koidec9051db2014-10-20 15:18:37 -070040 */
Toshio Koide485b4782014-10-20 19:34:21 -070041 Iterable<LinkResourceAllocations> getAllocations(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070042
43 /**
Toshio Koide485b4782014-10-20 19:34:21 -070044 * Returns all IDs of intents using the given link.
Toshio Koidec9051db2014-10-20 15:18:37 -070045 *
Toshio Koide485b4782014-10-20 19:34:21 -070046 * @param link a target link
47 * @return IDs of intents using the link
Toshio Koidec9051db2014-10-20 15:18:37 -070048 */
Toshio Koide485b4782014-10-20 19:34:21 -070049 Iterable<IntentId> getIntents(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070050
51 /**
52 * Returns available resources for given link.
Toshio Koide485b4782014-10-20 19:34:21 -070053 *
Toshio Koidec9051db2014-10-20 15:18:37 -070054 * @param link a target link
55 * @return available resources for the target link
56 */
Toshio Koide485b4782014-10-20 19:34:21 -070057 ResourceRequest getAvailableResources(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070058}