blob: 2d709cb98c564a21b2b54bdc6283ab102e963538 [file] [log] [blame]
package org.onlab.onos.net.resource;
import org.onlab.onos.net.Link;
import org.onlab.onos.net.intent.IntentId;
/**
* Service for providing link resource allocation.
*/
public interface LinkResourceService {
/**
* Requests resources.
*
* @param req resources to be allocated
* @return allocated resources
*/
LinkResourceAllocations requestResources(LinkResourceRequest req);
/**
* Releases resources.
*
* @param allocations resources to be released
*/
void releaseResources(LinkResourceAllocations allocations);
/**
* Updates previously made allocations with a new resource request.
*
* @param req updated resource request
* @param oldAllocations old resource allocations
* @return new resource allocations
*/
LinkResourceAllocations updateResources(LinkResourceRequest req,
LinkResourceAllocations oldAllocations);
/**
* Returns all allocated resources.
*
* @return allocated resources
*/
Iterable<LinkResourceAllocations> getAllocations();
/**
* Returns all allocated resources to given link.
*
* @param link a target link
* @return allocated resources
*/
Iterable<LinkResourceAllocations> getAllocations(Link link);
/**
* Returns the resources allocated for an Intent.
*
* @param intentId the target Intent's id
* @return allocated resources for Intent
*/
LinkResourceAllocations getAllocations(IntentId intentId);
/**
* Returns available resources for given link.
*
* @param link a target link
* @return available resources for the target link
*/
Iterable<ResourceRequest> getAvailableResources(Link link);
/**
* Returns available resources for given link.
*
* @param link a target link
* @param allocations allocations to be included as available
* @return available resources for the target link
*/
ResourceRequest getAvailableResources(Link link,
LinkResourceAllocations allocations);
}