blob: 1ea5723e5718799eaa9eddce80a3a45e90009117 [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
33 /**
34 * Returns all allocated resources to given link.
35 *
36 * @param link a target link
Toshio Koide485b4782014-10-20 19:34:21 -070037 * @return allocated resources
Toshio Koidec9051db2014-10-20 15:18:37 -070038 */
Toshio Koide485b4782014-10-20 19:34:21 -070039 Iterable<LinkResourceAllocations> getAllocations(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070040
41 /**
Toshio Koide485b4782014-10-20 19:34:21 -070042 * Returns all IDs of intents using the given link.
Toshio Koidec9051db2014-10-20 15:18:37 -070043 *
Toshio Koide485b4782014-10-20 19:34:21 -070044 * @param link a target link
45 * @return IDs of intents using the link
Toshio Koidec9051db2014-10-20 15:18:37 -070046 */
Toshio Koide485b4782014-10-20 19:34:21 -070047 Iterable<IntentId> getIntents(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070048
49 /**
50 * Returns available resources for given link.
Toshio Koide485b4782014-10-20 19:34:21 -070051 *
Toshio Koidec9051db2014-10-20 15:18:37 -070052 * @param link a target link
53 * @return available resources for the target link
54 */
Toshio Koide485b4782014-10-20 19:34:21 -070055 ResourceRequest getAvailableResources(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070056}