Package org.onosproject.net.resource
Interface ResourceQueryService
- 
- All Known Subinterfaces:
- ResourceService
 
 public interface ResourceQueryServiceService for retrieving resource information.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<Resource>getAvailableResources(DiscreteResourceId parent)Returns resources that point available child resources under the specified resource.<T> java.util.Set<Resource>getAvailableResources(DiscreteResourceId parent, java.lang.Class<T> cls)Returns available resources which are child resources of the specified parent and whose type is the specified type.<T> java.util.Set<T>getAvailableResourceValues(DiscreteResourceId parent, java.lang.Class<T> cls)Returns available resource values which are the values of the child resource of the specified parent and whose type is the specified type.java.util.Set<Resource>getRegisteredResources(DiscreteResourceId parent)Returns resources registered under the specified resource.<T> java.util.Collection<ResourceAllocation>getResourceAllocations(DiscreteResourceId parent, java.lang.Class<T> cls)Returns allocated resources being as children of the specified parent and being the specified resource type.java.util.Collection<ResourceAllocation>getResourceAllocations(ResourceConsumer consumer)Returns resources allocated to the specified consumer.java.util.List<ResourceAllocation>getResourceAllocations(ResourceId id)Returns resource allocations of the specified resource.booleanisAvailable(Resource resource)Returns the availability of the specified resource.
 
- 
- 
- 
Method Detail- 
getResourceAllocationsjava.util.List<ResourceAllocation> getResourceAllocations(ResourceId id) Returns resource allocations of the specified resource.- Parameters:
- id- ID of the resource to check the allocation
- Returns:
- list of allocation information. If the resource is not allocated, the return value is an empty list.
 
 - 
getResourceAllocations<T> java.util.Collection<ResourceAllocation> getResourceAllocations(DiscreteResourceId parent, java.lang.Class<T> cls) Returns allocated resources being as children of the specified parent and being the specified resource type.- Type Parameters:
- T- type of the resource
- Parameters:
- parent- parent resource ID
- cls- class to specify a type of resource
- Returns:
- non-empty collection of resource allocations if resources are allocated with the subject and type, empty collection if no resource is allocated with the subject and type
 
 - 
getResourceAllocationsjava.util.Collection<ResourceAllocation> getResourceAllocations(ResourceConsumer consumer) Returns resources allocated to the specified consumer.- Parameters:
- consumer- consumer whose allocated resources are to be returned
- Returns:
- resources allocated to the consumer
 
 - 
getAvailableResourcesjava.util.Set<Resource> getAvailableResources(DiscreteResourceId parent) Returns resources that point available child resources under the specified resource.- Parameters:
- parent- parent resource ID
- Returns:
- available resources under the specified resource
 
 - 
getAvailableResources<T> java.util.Set<Resource> getAvailableResources(DiscreteResourceId parent, java.lang.Class<T> cls) Returns available resources which are child resources of the specified parent and whose type is the specified type.- Type Parameters:
- T- type of the resource
- Parameters:
- parent- parent resource ID
- cls- class to specify a type of resource
- Returns:
- available resources of the specified type under the specified parent resource
 
 - 
getAvailableResourceValues<T> java.util.Set<T> getAvailableResourceValues(DiscreteResourceId parent, java.lang.Class<T> cls) Returns available resource values which are the values of the child resource of the specified parent and whose type is the specified type.- Type Parameters:
- T- type of the resource
- Parameters:
- parent- parent resource ID
- cls- class to specify a type of resource
- Returns:
- available resource value of the specified type under the specified parent resource
 
 - 
getRegisteredResourcesjava.util.Set<Resource> getRegisteredResources(DiscreteResourceId parent) Returns resources registered under the specified resource.- Parameters:
- parent- parent resource ID
- Returns:
- registered resources under the specified resource
 
 - 
isAvailableboolean isAvailable(Resource resource) Returns the availability of the specified resource.- Parameters:
- resource- resource to check the availability
- Returns:
- true if available, otherwise false
 
 
- 
 
-