Define ID representation for Intent, IFlow and MatchAction
- Defines BatchOperationTargetId abstract class.
- The above class is the base class of IntentId, FlowId, and MatchActionId.
-- Intent objects use IntentId class for its ID.
-- IFlow objects use FlowId class for its ID.
-- MatchAction objects use MatchActionId class for its ID.
- BatchOperation classes requires the BatchOperationTargetId as the target object's ID.
- This work is a part of ONOS-1758.
Change-Id: I71bb4e6acd3836d1ced3beb6fb331bca451abdc3
diff --git a/src/main/java/net/onrc/onos/core/newintent/IntentRuntimeModule.java b/src/main/java/net/onrc/onos/core/newintent/IntentRuntimeModule.java
index 6a2cf8c..8410400 100644
--- a/src/main/java/net/onrc/onos/core/newintent/IntentRuntimeModule.java
+++ b/src/main/java/net/onrc/onos/core/newintent/IntentRuntimeModule.java
@@ -8,6 +8,7 @@
import net.onrc.onos.api.flowmanager.IFlow;
import net.onrc.onos.api.intent.IIntentRuntimeService;
import net.onrc.onos.api.intent.Intent;
+import net.onrc.onos.api.intent.IntentId;
/**
* Implementation of Intent-Runtime Service.
@@ -25,21 +26,21 @@
}
@Override
- public boolean removeIntent(String id) {
+ public boolean removeIntent(IntentId id) {
BatchOperation<Intent> ops = new BatchOperation<Intent>();
ops.addRemoveOperation(id);
return executeBatch(ops);
}
@Override
- public boolean updateIntent(String id, Intent intent) {
+ public boolean updateIntent(IntentId id, Intent intent) {
BatchOperation<Intent> ops = new BatchOperation<Intent>();
ops.addUpdateOperation(id, intent);
return executeBatch(ops);
}
@Override
- public Intent getIntent(String id) {
+ public Intent getIntent(IntentId id) {
// TODO Auto-generated method stub
// - retrieves intents from global distributed maps
return null;