mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-21 20:31:00 +02:00
update and get available link resource consindering existing linkAllocations
Change-Id: Iee93253d253ff38d23630a2c5ac9c0a14329d92f
This commit is contained in:
parent
112c703dc5
commit
00c94f5533
@ -86,7 +86,7 @@ public interface LinkResourceService {
|
||||
* @param allocations allocations to be included as available
|
||||
* @return available resources for the target link
|
||||
*/
|
||||
ResourceRequest getAvailableResources(Link link,
|
||||
Iterable<ResourceRequest> getAvailableResources(Link link,
|
||||
LinkResourceAllocations allocations);
|
||||
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ public class IntentTestsMocks {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceRequest getAvailableResources(Link link, LinkResourceAllocations allocations) {
|
||||
public Iterable<ResourceRequest> getAvailableResources(Link link, LinkResourceAllocations allocations) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -156,8 +156,8 @@ public class LinkResourceManager implements LinkResourceService {
|
||||
@Override
|
||||
public LinkResourceAllocations updateResources(LinkResourceRequest req,
|
||||
LinkResourceAllocations oldAllocations) {
|
||||
// TODO
|
||||
return null;
|
||||
releaseResources(oldAllocations);
|
||||
return requestResources(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -196,10 +196,13 @@ public class LinkResourceManager implements LinkResourceService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceRequest getAvailableResources(Link link,
|
||||
public Iterable<ResourceRequest> getAvailableResources(Link link,
|
||||
LinkResourceAllocations allocations) {
|
||||
// TODO
|
||||
return null;
|
||||
Set<ResourceRequest> result = new HashSet<>();
|
||||
Set<ResourceAllocation> allocatedRes = allocations.getResourceAllocation(link);
|
||||
result = (Set<ResourceRequest>) getAvailableResources(link);
|
||||
result.addAll(allocatedRes);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user