summaryrefslogtreecommitdiffstats
path: root/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/factory/base/BasicHopRequestFactory.java
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2016-12-01 18:15:52 +0100
committerJan Srnicek <jsrnicek@cisco.com>2016-12-01 18:16:47 +0100
commit32aa07e5517fba7f78ae79d2ba83b56f72a53293 (patch)
tree26256f30f2dc5c3521403ef3fcd2e038b2f9bca6 /routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/factory/base/BasicHopRequestFactory.java
parent9c9935c83ce9869ca36cbde7865423ef02f19db8 (diff)
HONEYCOMB-58 - Routing Plugin Structure
Read/Write support for ipv4/6 static routes. Restriction due to vpp implementation described in readme. Change-Id: I328f406a9b7cb8781f8becf98eca293cebe66859 Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/factory/base/BasicHopRequestFactory.java')
-rw-r--r--routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/factory/base/BasicHopRequestFactory.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/factory/base/BasicHopRequestFactory.java b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/factory/base/BasicHopRequestFactory.java
new file mode 100644
index 000000000..abaf0fa84
--- /dev/null
+++ b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/factory/base/BasicHopRequestFactory.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * 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 io.fd.hc2vpp.routing.write.factory.base;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.hc2vpp.v3po.vppclassifier.VppClassifierContextManager;
+import javax.annotation.Nonnull;
+
+/**
+ * Extension to {@code ClassifierContextHolder} to hold also {@code NamingContext}
+ */
+public abstract class BasicHopRequestFactory extends ClassifierContextHolder {
+
+ private final NamingContext interfaceNamingContext;
+ private final NamingContext routingProtocolContext;
+
+ protected BasicHopRequestFactory(
+ @Nonnull final VppClassifierContextManager classifierContextManager,
+ @Nonnull final NamingContext interfaceContext,
+ @Nonnull final NamingContext routingProtocolContext) {
+ super(classifierContextManager);
+ this.interfaceNamingContext = checkNotNull(interfaceContext, "Interface context cannot be null");
+ this.routingProtocolContext = checkNotNull(routingProtocolContext, "Routing protocol context cannot be null");
+ }
+
+ protected NamingContext getInterfaceNamingContext() {
+ return interfaceNamingContext;
+ }
+
+ protected NamingContext getRoutingProtocolContext() {
+ return routingProtocolContext;
+ }
+}