ONOS-1767 SM-ONOS implementation
22a363e ONOS-17767 SM-ONOS impl
Change-Id: Ifca8129f2266bada68af735cf81a1d39f1ec8506
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java
index d974009..4c828e7 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java
@@ -25,7 +25,6 @@
import org.onosproject.event.AbstractListenerManager;
import org.onosproject.core.CoreService;
import org.onosproject.core.IdGenerator;
-import org.onosproject.core.Permission;
import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.FlowRuleOperations;
import org.onosproject.net.flow.FlowRuleOperationsContext;
@@ -67,6 +66,8 @@
import static org.onosproject.net.intent.impl.phase.IntentProcessPhase.newInitialPhase;
import static org.onosproject.security.AppGuard.checkPermission;
import static org.slf4j.LoggerFactory.getLogger;
+import static org.onosproject.security.AppPermission.Type.*;
+
/**
* An implementation of intent service.
@@ -138,7 +139,7 @@
@Override
public void submit(Intent intent) {
- checkPermission(Permission.INTENT_WRITE);
+ checkPermission(INTENT_WRITE);
checkNotNull(intent, INTENT_NULL);
IntentData data = new IntentData(intent, IntentState.INSTALL_REQ, null);
store.addPending(data);
@@ -146,7 +147,7 @@
@Override
public void withdraw(Intent intent) {
- checkPermission(Permission.INTENT_WRITE);
+ checkPermission(INTENT_WRITE);
checkNotNull(intent, INTENT_NULL);
IntentData data = new IntentData(intent, IntentState.WITHDRAW_REQ, null);
store.addPending(data);
@@ -154,7 +155,7 @@
@Override
public void purge(Intent intent) {
- checkPermission(Permission.INTENT_WRITE);
+ checkPermission(INTENT_WRITE);
checkNotNull(intent, INTENT_NULL);
IntentData data = new IntentData(intent, IntentState.PURGE_REQ, null);
store.addPending(data);
@@ -162,45 +163,45 @@
@Override
public Intent getIntent(Key key) {
- checkPermission(Permission.INTENT_READ);
+ checkPermission(INTENT_READ);
return store.getIntent(key);
}
@Override
public Iterable<Intent> getIntents() {
- checkPermission(Permission.INTENT_READ);
+ checkPermission(INTENT_READ);
return store.getIntents();
}
@Override
public Iterable<IntentData> getIntentData() {
- checkPermission(Permission.INTENT_READ);
+ checkPermission(INTENT_READ);
return store.getIntentData(false, 0);
}
@Override
public long getIntentCount() {
- checkPermission(Permission.INTENT_READ);
+ checkPermission(INTENT_READ);
return store.getIntentCount();
}
@Override
public IntentState getIntentState(Key intentKey) {
- checkPermission(Permission.INTENT_READ);
+ checkPermission(INTENT_READ);
checkNotNull(intentKey, INTENT_ID_NULL);
return store.getIntentState(intentKey);
}
@Override
public List<Intent> getInstallableIntents(Key intentKey) {
- checkPermission(Permission.INTENT_READ);
+ checkPermission(INTENT_READ);
checkNotNull(intentKey, INTENT_ID_NULL);
return store.getInstallableIntents(intentKey);
}
@Override
public boolean isLocal(Key intentKey) {
- checkPermission(Permission.INTENT_READ);
+ checkPermission(INTENT_READ);
return store.isMaster(intentKey);
}
@@ -221,7 +222,7 @@
@Override
public Iterable<Intent> getPending() {
- checkPermission(Permission.INTENT_READ);
+ checkPermission(INTENT_READ);
return store.getPending();
}