blob: 5ae5187d8caebbc730cebb0d05063e9675cbfe72 [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'Connor55153ce2014-10-23 13:44:05 -070033 /**
34 * Returns the resources allocated for an Intent.
35 *
36 * @param intentId the target Intent's id
37 * @return allocated resources for Intent
38 */
Toshio Koide86160f52014-10-23 14:59:07 -070039 LinkResourceAllocations getAllocations(IntentId intentId);
Brian O'Connore7e4bd52014-10-23 13:36:23 -070040
Toshio Koidec9051db2014-10-20 15:18:37 -070041 /**
42 * Returns all allocated resources to given link.
43 *
44 * @param link a target link
Toshio Koide485b4782014-10-20 19:34:21 -070045 * @return allocated resources
Toshio Koidec9051db2014-10-20 15:18:37 -070046 */
Toshio Koide485b4782014-10-20 19:34:21 -070047 Iterable<LinkResourceAllocations> getAllocations(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070048
49 /**
Toshio Koide485b4782014-10-20 19:34:21 -070050 * Returns all IDs of intents using the given link.
Toshio Koidec9051db2014-10-20 15:18:37 -070051 *
Toshio Koide485b4782014-10-20 19:34:21 -070052 * @param link a target link
53 * @return IDs of intents using the link
Toshio Koidec9051db2014-10-20 15:18:37 -070054 */
Toshio Koide485b4782014-10-20 19:34:21 -070055 Iterable<IntentId> getIntents(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070056
57 /**
58 * Returns available resources for given link.
Toshio Koide485b4782014-10-20 19:34:21 -070059 *
Toshio Koidec9051db2014-10-20 15:18:37 -070060 * @param link a target link
61 * @return available resources for the target link
62 */
Toshio Koide485b4782014-10-20 19:34:21 -070063 ResourceRequest getAvailableResources(Link link);
Toshio Koidec9051db2014-10-20 15:18:37 -070064}