ConfigFlowRuleProgrammable
- FlowRuleProgrammable implementation which acts as it has accepted any FlowRule request.
-- To be used for a device which exist in-line transparently (e.g., Amplifier ONOS-6067)
Change-Id: Ief09297eb900b804b1c8eb4d6705bbad85a552ad
diff --git a/core/api/src/main/java/org/onosproject/net/config/NetworkConfigRegistryAdapter.java b/core/api/src/main/java/org/onosproject/net/config/NetworkConfigRegistryAdapter.java
new file mode 100644
index 0000000..9b9c74d
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/config/NetworkConfigRegistryAdapter.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.net.config;
+
+import java.util.Set;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Test adapter for network configuration service registry.
+ */
+public class NetworkConfigRegistryAdapter extends NetworkConfigServiceAdapter implements NetworkConfigRegistry {
+
+ public void registerConfigFactory(ConfigFactory configFactory) {
+ }
+
+ public void unregisterConfigFactory(ConfigFactory configFactory) {
+ }
+
+ public Set<ConfigFactory> getConfigFactories() {
+ return ImmutableSet.of();
+ }
+
+ public <S, C extends Config<S>> Set<ConfigFactory<S, C>> getConfigFactories(Class<S> subjectClass) {
+ return ImmutableSet.of();
+ }
+
+ public <S, C extends Config<S>> ConfigFactory<S, C> getConfigFactory(Class<C> configClass) {
+ return null;
+ }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/config/NetworkConfigServiceAdapter.java b/core/api/src/main/java/org/onosproject/net/config/NetworkConfigServiceAdapter.java
new file mode 100644
index 0000000..1bad3a9
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/config/NetworkConfigServiceAdapter.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2015-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.net.config;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.collect.ImmutableSet;
+
+import java.util.Set;
+
+/**
+ * Test adapter for network configuration service.
+ */
+public class NetworkConfigServiceAdapter implements NetworkConfigService {
+ @Override
+ public Set<Class> getSubjectClasses() {
+ return ImmutableSet.of();
+ }
+
+ @Override
+ public SubjectFactory getSubjectFactory(String subjectClassKey) {
+ return null;
+ }
+
+ @Override
+ public SubjectFactory getSubjectFactory(Class subjectClass) {
+ return null;
+ }
+
+ @Override
+ public Class<? extends Config> getConfigClass(String subjectClassKey, String configKey) {
+ return null;
+ }
+
+ @Override
+ public <S> Set<S> getSubjects(Class<S> subjectClass) {
+ return ImmutableSet.of();
+ }
+
+ @Override
+ public <S, C extends Config<S>> Set<S> getSubjects(Class<S> subjectClass, Class<C> configClass) {
+ return ImmutableSet.of();
+ }
+
+ @Override
+ public <S> Set<? extends Config<S>> getConfigs(S subject) {
+ return ImmutableSet.of();
+ }
+
+ @Override
+ public <S, C extends Config<S>> C getConfig(S subject, Class<C> configClass) {
+ return null;
+ }
+
+ @Override
+ public <S, C extends Config<S>> C addConfig(S subject, Class<C> configClass) {
+ return null;
+ }
+
+ @Override
+ public <S, C extends Config<S>> C applyConfig(S subject, Class<C> configClass, JsonNode json) {
+ return null;
+ }
+
+ @Override
+ public <S, C extends Config<S>> C applyConfig(String subjectClassKey, S subject, String configKey, JsonNode json) {
+ return null;
+ }
+
+ @Override
+ public <S, C extends Config<S>> void removeConfig(S subject, Class<C> configClass) {
+
+ }
+
+ @Override
+ public <S> void removeConfig(String subjectClassKey, S subject, String configKey) {
+ }
+
+ @Override
+ public void addListener(NetworkConfigListener listener) {
+ }
+
+ @Override
+ public void removeListener(NetworkConfigListener listener) {
+ }
+
+ @Override
+ public <S> void removeConfig(S subject) {
+ }
+
+ @Override
+ public <S> void removeConfig() {
+ }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowEntry.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowEntry.java
index 943ad84..fadc3a2 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowEntry.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowEntry.java
@@ -118,6 +118,17 @@
}
/**
+ * Creates a flow entry based on specified flow rule and state.
+ *
+ * @param rule to use as base
+ * @param state of the flow entry
+ */
+ public DefaultFlowEntry(FlowRule rule, FlowEntryState state) {
+ this(rule, state, 0, 0, 0);
+ }
+
+
+ /**
* Creates a flow entry of flow table specified with the flow rule, state,
* live type and statistic information.
*