2 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package io.fd.hc2vpp.routing.write.factory.base;
19 import static com.google.common.base.Preconditions.checkNotNull;
21 import io.fd.hc2vpp.common.translate.util.NamingContext;
22 import io.fd.hc2vpp.v3po.vppclassifier.VppClassifierContextManager;
23 import javax.annotation.Nonnull;
26 * Extension to {@code ClassifierContextHolder} to hold also {@code NamingContext}
28 public abstract class BasicHopRequestFactory extends ClassifierContextHolder {
30 private final NamingContext interfaceNamingContext;
31 private final NamingContext routingProtocolContext;
33 protected BasicHopRequestFactory(
34 @Nonnull final VppClassifierContextManager classifierContextManager,
35 @Nonnull final NamingContext interfaceContext,
36 @Nonnull final NamingContext routingProtocolContext) {
37 super(classifierContextManager);
38 this.interfaceNamingContext = checkNotNull(interfaceContext, "Interface context cannot be null");
39 this.routingProtocolContext = checkNotNull(routingProtocolContext, "Routing protocol context cannot be null");
42 protected NamingContext getInterfaceNamingContext() {
43 return interfaceNamingContext;
46 protected NamingContext getRoutingProtocolContext() {
47 return routingProtocolContext;