3e656d6a1f7be392681157392fe658244d58a9d4
[honeycomb.git] / lisp / lisp2vpp / src / main / java / io / fd / honeycomb / lisp / translate / write / factory / AbstractLispWriterFactoryBase.java
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  *
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:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package io.fd.honeycomb.lisp.translate.write.factory;
18
19 import static com.google.common.base.Preconditions.checkNotNull;
20
21 import io.fd.honeycomb.lisp.context.util.EidMappingContext;
22 import io.fd.honeycomb.translate.vpp.util.NamingContext;
23 import javax.annotation.Nonnull;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev160520.Lisp;
25 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
26 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
27
28
29 /**
30  * Basic attributes for lisp writer factories
31  */
32 abstract class AbstractLispWriterFactoryBase {
33
34     protected final InstanceIdentifier<Lisp> lispInstanceIdentifier;
35     protected final FutureJVppCore vppApi;
36     protected NamingContext interfaceContext;
37     protected NamingContext locatorSetContext;
38     protected EidMappingContext localMappingContext;
39     protected EidMappingContext remoteMappingContext;
40
41     protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
42                                             @Nonnull final FutureJVppCore vppApi,
43                                             NamingContext interfaceContext) {
44         this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
45         this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
46         this.interfaceContext = interfaceContext;
47     }
48
49     protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
50                                             @Nonnull final FutureJVppCore vppApi,
51                                             NamingContext interfaceContext,
52                                             NamingContext locatorSetContext) {
53         this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
54         this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
55         this.interfaceContext = interfaceContext;
56         this.locatorSetContext = locatorSetContext;
57     }
58
59     protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
60                                             @Nonnull final FutureJVppCore vppApi,
61                                             EidMappingContext localMappingContext,
62                                             EidMappingContext remoteMappingContext) {
63         this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
64         this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
65         this.localMappingContext = localMappingContext;
66         this.remoteMappingContext = remoteMappingContext;
67     }
68
69     protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
70                                             @Nonnull final FutureJVppCore vppApi,
71                                             NamingContext interfaceContext,
72                                             NamingContext locatorSetContext,
73                                             EidMappingContext localMappingContext,
74                                             EidMappingContext remoteMappingContext) {
75         this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
76         this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
77         this.interfaceContext = interfaceContext;
78         this.locatorSetContext = locatorSetContext;
79         this.localMappingContext = localMappingContext;
80         this.remoteMappingContext = remoteMappingContext;
81     }
82
83     protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
84                                             @Nonnull final FutureJVppCore vppApi,
85                                             NamingContext interfaceContext,
86                                             EidMappingContext localMappingContext,
87                                             EidMappingContext remoteMappingContext) {
88         this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
89         this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
90         this.interfaceContext = interfaceContext;
91         this.localMappingContext = localMappingContext;
92         this.remoteMappingContext = remoteMappingContext;
93     }
94 }