Use ResourceId when unregistering resources instead of Resource
Change-Id: Ib3d1c611ad9eb4491693ea10ee50ea0123f20ee2
diff --git a/core/api/src/main/java/org/onosproject/net/newresource/ResourceAdminService.java b/core/api/src/main/java/org/onosproject/net/newresource/ResourceAdminService.java
index d482983..23f79e6 100644
--- a/core/api/src/main/java/org/onosproject/net/newresource/ResourceAdminService.java
+++ b/core/api/src/main/java/org/onosproject/net/newresource/ResourceAdminService.java
@@ -48,22 +48,21 @@
/**
* Unregisters the specified resources.
*
- * @param resources resources to be unregistered
+ * @param ids IDs of resources to be unregistered
* @return true if unregistration is successfully done, false otherwise. Unregistration
* succeeds when each resource is not registered or unallocated.
*/
- // TODO: might need to change the first argument type to ResourceId
- default boolean unregisterResources(Resource... resources) {
- return unregisterResources(ImmutableList.copyOf(resources));
+ default boolean unregisterResources(ResourceId... ids) {
+ return unregisterResources(ImmutableList.copyOf(ids));
}
/**
* Unregisters the specified resources.
*
- * @param resources resources to be unregistered
+ * @param ids IDs of resources to be unregistered
* @return true if unregistration is successfully done, false otherwise. Unregistration
* succeeds when each resource is not registered or unallocated.
*/
// TODO: might need to change the first argument type to ResourceId
- boolean unregisterResources(List<Resource> resources);
+ boolean unregisterResources(List<ResourceId> ids);
}
diff --git a/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java b/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java
index 0e3eee8..aee72f1 100644
--- a/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java
+++ b/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java
@@ -45,10 +45,10 @@
* or none of the given resources is unregistered. The whole unregistration fails when any one of the
* resource can't be unregistered.
*
- * @param resources resources to be unregistered
+ * @param ids resources to be unregistered
* @return true if the registration succeeds, false otherwise
*/
- boolean unregister(List<Resource> resources);
+ boolean unregister(List<ResourceId> ids);
/**
* Allocates the specified resources to the specified consumer in transactional way.