summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManagerTest.java (renamed from vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/cache/DumpCacheManagerTest.java)37
-rw-r--r--ioam/api/asciidoc/Readme.adoc3
-rw-r--r--ioam/api/pom.xml38
-rw-r--r--ioam/api/src/main/yang/ioam-sb-trace.yang184
-rw-r--r--ioam/asciidoc/Readme.adoc11
-rw-r--r--ioam/impl/asciidoc/Readme.adoc3
-rw-r--r--ioam/impl/pom.xml123
-rwxr-xr-xioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/VppIoamModule.java63
-rwxr-xr-xioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/config/IoamTraceWriterCustomizer.java134
-rwxr-xr-xioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/config/VppIoamWriterFactory.java49
-rwxr-xr-xioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/util/FutureJVppIoamCustomizer.java45
-rwxr-xr-xioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/util/JVppIoamProvider.java62
-rw-r--r--ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java90
-rw-r--r--ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/config/IoamTraceWriterCustomizerTest.java186
-rw-r--r--ioam/ioam_trace_postman_collection.json34
-rw-r--r--ioam/pom.xml56
-rw-r--r--lisp/api/asciidoc/Readme.adoc3
-rwxr-xr-xlisp/api/pom.xml56
-rw-r--r--lisp/api/src/main/yang/adjacencies-identification-context.yang65
-rw-r--r--lisp/api/src/main/yang/eid-mapping-context.yang44
-rwxr-xr-xlisp/api/src/main/yang/ietf-lisp-address-types.yang677
-rwxr-xr-xlisp/api/src/main/yang/lisp.yang353
-rwxr-xr-xlisp/asciidoc/Readme.adoc3
-rw-r--r--lisp/lisp2vpp/asciidoc/Readme.adoc3
-rwxr-xr-xlisp/lisp2vpp/pom.xml118
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/LispModule.java87
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/cfgattrs/LispConfiguration.java59
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/AdjacenciesMappingContext.java174
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/ContextsReaderFactory.java46
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/ContextsReaderFactoryProvider.java36
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/EidMappingContext.java227
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/AdjacencyCustomizer.java192
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/BridgeDomainSubtableCustomizer.java104
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java147
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java82
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LispStateCustomizer.java100
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LocalMappingCustomizer.java181
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LocatorSetCustomizer.java136
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/MapResolverCustomizer.java125
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/PitrCfgCustomizer.java83
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/RemoteMappingCustomizer.java301
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/VniTableCustomizer.java125
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/VrfSubtableCustomizer.java98
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java47
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/MappingsDumpParams.java191
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/SubtableDumpParams.java75
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/AbstractLispReaderFactoryBase.java101
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/EidTableReaderFactory.java183
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/LispStateReaderFactory.java83
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/LocatorSetsReaderFactory.java71
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/MapResolversReaderFactory.java58
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/LocatorReader.java46
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/LocatorSetReader.java41
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/MappingProducer.java72
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/MappingReader.java90
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/SubtableReader.java57
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/util/EidMetadataProvider.java68
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/util/EidTranslator.java343
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/AdjacencyCustomizer.java183
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/BridgeDomainSubtableCustomizer.java97
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/InterfaceCustomizer.java122
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/ItrRemoteLocatorSetCustomizer.java82
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LispCustomizer.java97
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LocalMappingCustomizer.java141
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LocatorSetCustomizer.java107
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/MapResolverCustomizer.java99
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/PitrCfgCustomizer.java104
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/RemoteMappingCustomizer.java236
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/VniTableCustomizer.java83
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/VrfSubtableCustomizer.java82
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/AbstractLispWriterFactoryBase.java94
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/LispWriterFactory.java82
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/LocatorSetsWriterFactory.java64
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/MapResolversWriterFactory.java55
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/VniTableWriterFactory.java158
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/trait/SubtableWriter.java82
-rw-r--r--lisp/lisp2vpp/src/main/resources/honeycomb-minimal-resources/config/lisp.json2
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java101
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/context/util/AdjacenciesMappingContextTest.java184
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/context/util/EidMappingContextTest.java108
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/AdjacencyData.java59
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/AdjacencyCustomizerTest.java145
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/BridgeDomainSubtableCustomizerTest.java118
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizerTest.java118
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/ItrRemoteLocatorSetCustomizerTest.java164
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LispStateCustomizerTest.java68
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LocalMappingCustomizerTest.java144
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LocatorSetCustomizerTest.java96
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/MapResolverCustomizerTest.java102
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/PitrCfgCustomizerTest.java77
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/RemoteMappingCustomizerTest.java241
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/VniTableCustomizerTest.java121
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/VrfSubtableCustomizerTest.java121
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/MappingProducerTest.java186
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/MappingReaderTest.java95
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/SubtableReaderTestCase.java97
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/util/EidTranslatorTest.java60
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/AdjacencyCustomizerTest.java243
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/BridgeDomainCustomizerTest.java108
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/InterfaceCustomizerTest.java160
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/ItrRemoteLocatorSetCustomizerTest.java146
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/LispCustomizerTest.java111
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/LocalMappingCustomizerTest.java163
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/LocatorSetCustomizerTest.java148
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/MapResolverCustomizerTest.java103
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/PitrCfgCustomizerTest.java117
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/RemoteMappingCustomizerTest.java155
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/VniTableCustomizerTest.java103
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/VrfSubtableCustomizerTest.java105
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/trait/SubtableWriterTestCase.java59
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/util/AdjacencyMappingContextTestHelper.java126
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/util/EidMappingContextHelper.java116
-rw-r--r--lisp/lisp2vpp/src/test/resources/adjacencies-identification-context.json29
-rw-r--r--lisp/lisp_postman_collection.json955
-rwxr-xr-xlisp/pom.xml58
-rw-r--r--nat/asciidoc/Readme.adoc12
-rw-r--r--nat/nat-api/asciidoc/Readme.adoc11
-rw-r--r--nat/nat-api/pom.xml61
-rw-r--r--nat/nat-api/src/main/yang/ietf-nat.yang1074
-rw-r--r--nat/nat-api/src/main/yang/interface-nat.yang44
-rw-r--r--nat/nat-api/src/main/yang/nat-context.yang64
-rw-r--r--nat/nat2vpp/asciidoc/Readme.adoc3
-rw-r--r--nat/nat2vpp/pom.xml126
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/NatModule.java72
-rwxr-xr-xnat/nat2vpp/src/main/java/io/fd/honeycomb/nat/jvpp/JVppSnatProvider.java60
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/read/ExternalIpPoolCustomizer.java150
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/read/MappingEntryCustomizer.java171
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/read/NatInstanceCustomizer.java114
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/read/NatReaderFactory.java90
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/read/ifc/AbstractInterfaceNatCustomizer.java75
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/read/ifc/IfcNatReaderFactory.java96
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/read/ifc/InterfaceInboundNatCustomizer.java95
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/read/ifc/InterfaceOutboundNatCustomizer.java86
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/util/MappingEntryContext.java210
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/write/ExternalIpPoolCustomizer.java92
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/write/MappingEntryCustomizer.java182
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/write/NatInstaceCustomizer.java53
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/write/NatWriterFactory.java73
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/write/ifc/AbstractInterfaceNatCustomizer.java105
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/write/ifc/IfcNatWriterFactory.java62
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/write/ifc/InterfaceInboundNatCustomizer.java44
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/honeycomb/nat/write/ifc/InterfaceOutboundNatCustomizer.java44
-rw-r--r--nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/NatModuleTest.java123
-rw-r--r--nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/read/ifc/InterfaceInboundNatCustomizerTest.java107
-rw-r--r--nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/read/ifc/InterfaceOutboundNatCustomizerTest.java94
-rw-r--r--nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/util/MappingEntryContextTest.java198
-rw-r--r--nat/nat2vpp/src/test/resources/nat.json3
-rw-r--r--nat/pom.xml56
-rw-r--r--nat/postman_rest_collection.json222
-rw-r--r--nsh/api/asciidoc/Readme.adoc3
-rw-r--r--nsh/api/pom.xml59
-rw-r--r--nsh/api/src/main/yang/vpp-nsh.yang303
-rw-r--r--nsh/asciidoc/Readme.adoc14
-rw-r--r--nsh/impl/asciidoc/Readme.adoc3
-rw-r--r--nsh/impl/pom.xml130
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/VppNshModule.java73
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/config/NshEntryWriterCustomizer.java151
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/config/NshMapWriterCustomizer.java138
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/config/VppNshWriterFactory.java81
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/oper/NshEntryReaderCustomizer.java214
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/oper/NshMapReaderCustomizer.java205
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/oper/VppNshReaderFactory.java78
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/util/FutureJVppNshCustomizer.java44
-rwxr-xr-xnsh/impl/src/main/java/io/fd/honeycomb/vppnsh/impl/util/JVppNshProvider.java60
-rw-r--r--nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/VppNshModuleTest.java111
-rw-r--r--nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshEntryWriterCustomizerTest.java185
-rw-r--r--nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshMapWriterCustomizerTest.java181
-rw-r--r--nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshEntryReaderCustomizerTest.java154
-rw-r--r--nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshMapReaderCustomizerTest.java146
-rw-r--r--nsh/nsh_postman_collection.json343
-rw-r--r--nsh/pom.xml56
-rw-r--r--packaging/deb/.gitignore5
-rwxr-xr-xpackaging/deb/common/debuild.sh8
-rwxr-xr-xpackaging/deb/common/prepare.sh45
-rw-r--r--packaging/deb/trusty/debian/compat1
-rw-r--r--packaging/deb/trusty/debian/control14
-rw-r--r--packaging/deb/trusty/debian/copyright23
-rwxr-xr-xpackaging/deb/trusty/debian/rules32
-rw-r--r--packaging/deb/trusty/debian/source/format1
-rwxr-xr-xpackaging/deb/trusty/debuild.sh7
-rw-r--r--packaging/deb/trusty/honeycomb.conf8
-rw-r--r--packaging/deb/xenial/debian/control14
-rwxr-xr-xpackaging/deb/xenial/debian/rules32
-rwxr-xr-xpackaging/deb/xenial/debuild.sh8
-rw-r--r--packaging/deb/xenial/honeycomb.service10
-rw-r--r--packaging/rpm/.gitignore6
-rw-r--r--packaging/rpm/honeycomb.service10
-rw-r--r--packaging/rpm/honeycomb.spec66
-rwxr-xr-xpackaging/rpm/release2
-rwxr-xr-xpackaging/rpm/rpmbuild.sh13
-rwxr-xr-xpackaging/rpm/version2
-rw-r--r--pom.xml8
-rw-r--r--release-notes/pom.xml8
-rw-r--r--release-notes/src/main/asciidoc/devel_guide/devel_guide.adoc3
-rw-r--r--release-notes/src/main/asciidoc/devel_guide/devel_plugin_vpp_tutorial.adoc617
-rw-r--r--release-notes/src/main/asciidoc/install_guide/install_from_available_archives.adoc14
-rw-r--r--release-notes/src/main/asciidoc/install_guide/install_from_available_binary_packages.adoc66
-rw-r--r--release-notes/src/main/asciidoc/install_guide/install_guide.adoc23
-rw-r--r--release-notes/src/main/asciidoc/install_guide/install_manual_build.adoc206
-rw-r--r--release-notes/src/main/asciidoc/release_notes.adoc16
-rw-r--r--release-notes/src/main/asciidoc/user_guide/user_guide.adoc54
-rw-r--r--release-notes/src/main/asciidoc/user_guide/user_honeycomb_and_ODL.adoc76
-rw-r--r--release-notes/src/main/asciidoc/user_guide/user_running_honeycomb.adoc119
-rw-r--r--release-notes/src/main/asciidoc/user_guide/user_troubleshooting.adoc20
-rw-r--r--routing/asciidoc/Readme.adoc3
-rw-r--r--routing/pom.xml60
-rw-r--r--routing/routing-api/asciidoc/Readme.adoc8
-rw-r--r--routing/routing-api/pom.xml70
-rw-r--r--routing/routing-api/src/main/yang/ietf-ipv4-unicast-routing.yang421
-rw-r--r--routing/routing-api/src/main/yang/ietf-ipv6-unicast-routing.yang822
-rw-r--r--routing/routing-api/src/main/yang/ietf-routing.yang1030
-rw-r--r--routing/routing-api/src/main/yang/vpp-routing.yang59
-rw-r--r--v3po/api/asciidoc/Readme.adoc3
-rw-r--r--v3po/api/pom.xml58
-rw-r--r--v3po/api/src/main/yang/dot1q-types.yang237
-rw-r--r--v3po/api/src/main/yang/ietf-access-control-list.yang208
-rw-r--r--v3po/api/src/main/yang/ietf-acl-context.yang67
-rw-r--r--v3po/api/src/main/yang/ietf-ip.yang742
-rw-r--r--v3po/api/src/main/yang/ietf-packet-fields.yang180
-rw-r--r--v3po/api/src/main/yang/pbb-types.yang81
-rw-r--r--v3po/api/src/main/yang/v3po-context.yang29
-rw-r--r--v3po/api/src/main/yang/v3po.yang716
-rw-r--r--v3po/api/src/main/yang/vpp-acl.yang160
-rw-r--r--v3po/api/src/main/yang/vpp-classifier-context.yang68
-rw-r--r--v3po/api/src/main/yang/vpp-classifier.yang215
-rw-r--r--v3po/api/src/main/yang/vpp-pbb.yang32
-rw-r--r--v3po/api/src/main/yang/vpp-vlan.yang443
-rw-r--r--v3po/asciidoc/Readme.adoc7
-rw-r--r--v3po/pom.xml56
-rw-r--r--v3po/postman_rest_collection.json2065
-rw-r--r--v3po/v3po2vpp/asciidoc/Readme.adoc103
-rw-r--r--v3po/v3po2vpp/pom.xml122
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/AclWriterFactory.java58
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/DisabledInterfacesManager.java106
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/EgressIetfAClWriterProvider.java39
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/IngressIetfAClWriterProvider.java39
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesStateReaderFactory.java187
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesWriterFactory.java245
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceAugmentationWriterFactory.java158
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceStateAugmentationReaderFactory.java118
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java92
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierHoneycombWriterFactory.java66
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierReaderFactory.java60
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppHoneycombWriterFactory.java81
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java90
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/cfgattrs/V3poConfiguration.java24
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/EthernetCustomizer.java58
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/GreCustomizer.java166
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/InterconnectionWriteUtils.java159
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/InterfaceCustomizer.java121
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/L2Customizer.java89
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/LoopbackCustomizer.java112
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ProxyArpCustomizer.java108
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizer.java136
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/RoutingCustomizer.java122
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizer.java193
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceL2Customizer.java100
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizer.java182
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/VhostUserCustomizer.java157
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanCustomizer.java192
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizer.java194
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/IetfAclWriter.java106
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AbstractIetfAclWriter.java251
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceEthWriter.java85
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceIp4Writer.java94
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceIp6Writer.java99
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceIpAndEthWriter.java129
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceWriter.java54
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AclTableContextManager.java53
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AclTableContextManagerImpl.java68
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AclTranslator.java74
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/IetfAclWriter.java47
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/Ip4AclTranslator.java149
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/Ip6AclTranslator.java182
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/L2AclTranslator.java90
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/PortPair.java126
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/egress/EgressIetfAclWriter.java120
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/egress/IetfAclCustomizer.java85
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/egress/SubInterfaceIetfAclCustomizer.java105
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclCustomizer.java83
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclWriter.java73
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizer.java89
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IngressIetfAclWriter.java118
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizer.java93
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizer.java108
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizer.java151
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4Customizer.java56
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizer.java126
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4Writer.java108
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv6Customizer.java55
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/SubInterfaceIpv4AddressCustomizer.java131
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/subnet/validation/SubnetValidationException.java50
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/subnet/validation/SubnetValidator.java80
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/pbb/PbbRewriteCustomizer.java130
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/EthernetCustomizer.java108
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/GreCustomizer.java157
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterconnectionReadUtils.java125
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceCustomizer.java232
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceDataTranslator.java287
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/L2Customizer.java116
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/ProxyArpCustomizer.java79
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/RewriteCustomizer.java147
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizer.java264
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceL2Customizer.java93
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/TapCustomizer.java143
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/VhostUserCustomizer.java154
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanCustomizer.java162
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanGpeCustomizer.java168
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/acl/ingress/AclCustomizer.java118
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/acl/ingress/AclReader.java60
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/acl/ingress/SubInterfaceAclCustomizer.java120
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4AddressCustomizer.java166
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4Customizer.java59
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4NeighbourCustomizer.java73
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4Reader.java84
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv6Customizer.java66
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizer.java143
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/dump/params/AddressDumpParams.java44
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfacesstate/pbb/PbbRewriteStateCustomizer.java57
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducer.java163
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vpp/ArpTerminationTableEntryCustomizer.java118
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vpp/BridgeDomainCustomizer.java137
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizer.java129
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionReader.java207
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionWriter.java165
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableReader.java171
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableWriter.java149
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppClassifierContextManager.java106
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppClassifierContextManagerImpl.java181
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppNodeReader.java45
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppNodeWriter.java79
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppstate/BridgeDomainCustomizer.java181
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppstate/L2FibEntryCustomizer.java165
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizer.java82
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/vpp/util/SubInterfaceUtils.java52
-rw-r--r--v3po/v3po2vpp/src/main/resources/honeycomb-minimal-resources/config/v3po.json2
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/DisabledInterfacesManagerTest.java109
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/V3poModuleTest.java96
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/AclCustomizerTest.java156
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/GreCustomizerTest.java197
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/InterfaceCustomizerTest.java116
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/InterfaceTypeTestUtils.java40
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/L2CustomizerTest.java150
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/LoopbackCustomizerTest.java105
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ProxyArpCustomizerTest.java97
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizerTest.java198
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RoutingCustomizerTest.java97
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizerTest.java258
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceL2CustomizerTest.java109
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java129
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VhostUserCustomizerTest.java205
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanCustomizerTest.java227
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java218
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/AclWriterTest.java103
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceEthWriterTest.java94
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceIp4WriterTest.java189
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceIp6WriterTest.java201
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceIpAndEthWriterTest.java123
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AceIpWriterTestUtils.java34
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/AclTableContextManagerImplTest.java62
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/common/PortPairTest.java114
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/egress/EgressIetfAclWriterTest.java151
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/egress/IetfAclCustomizerTest.java114
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/egress/SubInterfaceIetfAclCustomizerTest.java130
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java205
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizerTest.java140
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizerTest.java154
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java338
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java120
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/SubInterfaceIpv4AddressCustomizerTest.java144
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/subnet/validation/SubnetValidatorTest.java88
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/pbb/PbbRewriteCustomizerTest.java312
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/EthernetCustomizerTest.java90
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/GreCustomizerTest.java131
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceCustomizerTest.java201
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceDataTranslatorTest.java55
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/L2CustomizerTest.java145
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/RewriteCustomizerTest.java114
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java129
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceL2CustomizerTest.java80
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/TapCustomizerTest.java98
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VhostUserCustomizerTest.java115
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanCustomizerTest.java133
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanGpeCustomizerTest.java278
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/acl/ingress/AclCustomizerTest.java99
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/acl/ingress/SubInterfaceAclCustomizerTest.java108
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4AddressCustomizerTest.java284
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4CustomizerTest.java44
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java247
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/pbb/PbbRewriteStateCustomizerTest.java35
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducerTest.java112
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/ArpTerminationTableEntryCustomizerTest.java171
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/BridgeDomainCustomizerTest.java276
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java190
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionReaderTest.java116
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionWriterTest.java179
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableReaderTest.java126
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableWriterTest.java181
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppClassifierContextManagerImplTest.java163
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/BridgeDomainCustomizerTest.java47
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/L2FibEntryCustomizerTest.java124
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java60
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java326
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/vpp/util/SubinterfaceUtilsTest.java32
-rw-r--r--vpp-common/asciidoc/Readme.adoc3
-rw-r--r--vpp-common/naming-context-api/asciidoc/Readme.adoc3
-rw-r--r--vpp-common/naming-context-api/pom.xml31
-rw-r--r--vpp-common/naming-context-api/src/main/yang/naming-context.yang44
-rw-r--r--vpp-common/naming-context-impl/asciidoc/Readme.adoc3
-rw-r--r--vpp-common/naming-context-impl/pom.xml50
-rw-r--r--vpp-common/naming-context-impl/src/main/java/io/fd/honeycomb/vpp/context/ContextsReaderFactory.java45
-rw-r--r--vpp-common/pom.xml61
-rw-r--r--vpp-common/vpp-common-integration/asciidoc/Readme.adoc3
-rw-r--r--vpp-common/vpp-common-integration/pom.xml116
-rw-r--r--vpp-common/vpp-common-integration/src/main/java/io/fd/honeycomb/vpp/common/integration/ContextsReaderFactoryProvider.java40
-rw-r--r--vpp-common/vpp-common-integration/src/main/java/io/fd/honeycomb/vpp/common/integration/JVppCoreProvider.java61
-rw-r--r--vpp-common/vpp-common-integration/src/main/java/io/fd/honeycomb/vpp/common/integration/JVppRegistryProvider.java72
-rw-r--r--vpp-common/vpp-common-integration/src/main/java/io/fd/honeycomb/vpp/common/integration/VppCommonModule.java44
-rw-r--r--vpp-common/vpp-common-integration/src/main/java/io/fd/honeycomb/vpp/common/integration/VppConfigAttributes.java28
-rw-r--r--vpp-common/vpp-common-integration/src/main/resources/honeycomb-minimal-resources/config/jvpp.json3
-rw-r--r--vpp-common/vpp-common-integration/src/test/java/io/fd/honeycomb/vpp/common/integration/VppCommonModuleTest.java53
-rw-r--r--vpp-common/vpp-common-integration/src/test/resources/jvpp.json3
-rw-r--r--vpp-common/vpp-impl-parent/asciidoc/Readme.adoc3
-rw-r--r--vpp-common/vpp-impl-parent/pom.xml56
-rw-r--r--vpp-common/vpp-translate-test/asciidoc/Readme.adoc3
-rw-r--r--vpp-common/vpp-translate-test/pom.xml74
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/honeycomb/vpp/test/read/JvppDumpExecutorTest.java91
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/honeycomb/vpp/test/read/ListReaderCustomizerTest.java60
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/honeycomb/vpp/test/read/ReaderCustomizerTest.java106
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/honeycomb/vpp/test/util/FutureProducer.java63
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/honeycomb/vpp/test/util/InterfaceDumpHelper.java45
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/honeycomb/vpp/test/util/NamingContextHelper.java119
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/honeycomb/vpp/test/write/WriterCustomizerTest.java63
-rw-r--r--vpp-common/vpp-translate-utils/asciidoc/Readme.adoc3
-rw-r--r--vpp-common/vpp-translate-utils/pom.xml97
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/AbstractInterfaceTypeCustomizer.java100
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/AddressTranslator.java85
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/ByteDataTranslator.java79
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/FutureJVppCustomizer.java44
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/Ipv4AddressRange.java121
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/Ipv4Translator.java137
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/Ipv6Translator.java158
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/JvppReplyConsumer.java194
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/MacTranslator.java110
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/NamingContext.java179
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/ReadTimeoutException.java33
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/TagRewriteOperation.java88
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/VppStatusListener.java46
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/vpp/util/WriteTimeoutException.java33
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/AddressTranslatorTest.java36
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/ByteDataTranslatorTest.java52
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/Ipv4AddressRangeTest.java57
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/Ipv4TranslatorTest.java49
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/Ipv6TranslatorTest.java56
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/JvppReplyConsumerTest.java76
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/MacTranslatorTest.java89
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/VppStatusListenerTest.java37
-rw-r--r--vpp-integration/asciidoc/Readme.adoc3
-rw-r--r--vpp-integration/minimal-distribution/asciidoc/Readme.adoc3
-rw-r--r--vpp-integration/minimal-distribution/pom.xml107
-rw-r--r--vpp-integration/pom.xml56
461 files changed, 43 insertions, 55475 deletions
diff --git a/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/cache/DumpCacheManagerTest.java b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManagerTest.java
index 81a47e8..3639439 100644
--- a/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/vpp/util/cache/DumpCacheManagerTest.java
+++ b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManagerTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package io.fd.honeycomb.translate.vpp.util.cache;
+package io.fd.honeycomb.translate.util.read.cache;
import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
import static org.junit.Assert.assertEquals;
@@ -23,13 +23,9 @@ import static org.mockito.Mockito.when;
import com.google.common.base.Optional;
import io.fd.honeycomb.translate.ModificationCache;
import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.util.read.cache.CacheKeyFactory;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.honeycomb.translate.util.read.cache.EntityDumpPostProcessingFunction;
-import io.fd.honeycomb.translate.util.read.cache.IdentifierCacheKeyFactory;
-import io.fd.vpp.jvpp.core.dto.IpDetails;
-import io.fd.vpp.jvpp.core.dto.IpDetailsReplyDump;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -149,4 +145,29 @@ public class DumpCacheManagerTest {
return modified;
};
}
+
+ private static final class IpDetailsReplyDump {
+ List<IpDetails> ipDetails = new ArrayList<>();
+
+ @Override
+ public boolean equals(final Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final IpDetailsReplyDump that = (IpDetailsReplyDump) o;
+ return Objects.equals(ipDetails, that.ipDetails);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(ipDetails);
+ }
+ }
+
+ private static final class IpDetails {
+ int swIfIndex;
+ }
} \ No newline at end of file
diff --git a/ioam/api/asciidoc/Readme.adoc b/ioam/api/asciidoc/Readme.adoc
deleted file mode 100644
index fe70e0a..0000000
--- a/ioam/api/asciidoc/Readme.adoc
+++ /dev/null
@@ -1,3 +0,0 @@
-= vppioam-api
-
-Overview of vppioam-api
diff --git a/ioam/api/pom.xml b/ioam/api/pom.xml
deleted file mode 100644
index ebdadea..0000000
--- a/ioam/api/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>io.fd.honeycomb.common</groupId>
- <artifactId>api-parent</artifactId>
- <version>1.16.12-SNAPSHOT</version>
- <relativePath>../../common/api-parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>io.fd.honeycomb.vppioam</groupId>
- <artifactId>vppioam-api</artifactId>
- <name>${project.artifactId}</name>
- <version>1.16.12-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-interfaces</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/ioam/api/src/main/yang/ioam-sb-trace.yang b/ioam/api/src/main/yang/ioam-sb-trace.yang
deleted file mode 100644
index 731fda9..0000000
--- a/ioam/api/src/main/yang/ioam-sb-trace.yang
+++ /dev/null
@@ -1,184 +0,0 @@
-module ioam-sb-trace {
- yang-version 1;
- namespace "urn:cisco:params:xml:ns:yang:ioam-sb-trace";
- prefix ioam-sb-trace;
-
- import ietf-interfaces { prefix ietf-if; }
-
- organization "Cisco Systems, Inc.";
-
- contact
- "Author: Srihari Raghavan
- srihari@cisco.com";
-
- description
- "This YANG module defines a component that describing the
- configuration of in-band OAM device configuration for
- trace elements.
- ";
-
- revision 2016-05-12 {
- description
- "Base model for in-band OAM trace device configuration.";
- reference
- "";
- }
-
- container ioam-trace-config {
- description
- "Device specific configuration for in-band OAM trace.";
-
- list trace-config {
- key "trace-config-name";
- ordered-by system;
- description
- "Set of ioam trace configurations that group parameters
- required to enable iOAM6 tracing at a service node";
-
- leaf trace-config-name {
- type string {
- length "0..255";
- }
- mandatory true;
- description
- "Unique identifier for each node tracing configuration";
- }
-
- leaf acl-name {
- type string;
- description
- "The ACL name associated to classify and apply this
- trace config";
- }
-
- leaf trace-type {
- type uint8 {
- range "3|7|9|17|25|31";
- }
-
- mandatory true;
- description
- "Trace type that defines the trace element variant. Moving
- from LSB to MSB, each bit represents node_id, ingress_if_id,
- egress_if_id, timestamp, app_data and others are undefined.
- Currently, the supported values are 0x03, 0x07, 0x09,
- 0x11, 0x19 and 0x1f.";
- }
-
- leaf trace-num-elt {
- type uint8;
-
- mandatory true;
- description
- "Number of trace elements to be inserted in the tracing
- options.";
- }
-
- leaf trace-tsp {
- type enumeration {
- enum seconds {
- value 0;
- description "Timestamp in seconds.";
- }
- enum milliseconds {
- value 1;
- description "Timestamp in milli seconds.";
- }
- enum microseconds {
- value 2;
- description "Timestamp in micro seconds.";
- }
- enum nanoseconds {
- value 3;
- description "Timestamp in nano seconds.";
- }
- }
-
- mandatory true;
- description
- "This field depicts the delay domain of the trace path,
- whether it is in seconds, milliseconds, microseconds
- or nanoseconds.";
- }
-
- leaf trace-op {
- type enumeration {
- enum add {
- value 0;
- description "Add new and fill trace information.";
- }
- enum update {
- value 1;
- description "Update existing trace information.";
- }
- enum remove {
- value 2;
- description "Decap or remove existing trace information.";
- }
- }
-
- mandatory true;
- description
- "The type of trace element operation that the service node
- handling this profile should do. The options are to add the
- trace elements, update the trace elements or to remove the
- trace elements.";
- }
-
- leaf trace-app-data {
- type uint32;
- description
- "Application specific data to be added by the node";
- }
-
- leaf node-id {
- type uint32;
- mandatory true;
- description
- "iOAM Service Node id assigned to this node";
- }
-
- list node-interfaces {
- key "index";
- ordered-by system;
- description
- "List of node's interfaces on which the trace configuration
- need to be applied. Typically this is to all interfaces
- but can be filtered.";
-
- leaf index {
- type uint32;
- mandatory true;
- description
- "Index for the interfaces list";
- }
-
- leaf intf-name {
- type ietf-if:interface-ref;
- mandatory true;
- description
- "Instance of ietf-interfaces:interface-ref";
- }
- }
-
- /*** links to ioam-sb-data-export ***/
- leaf data-export-profile-name {
- type string;
- description
- "The data export profile name with server information to
- send data to.";
- }
-
- /*** Transport encap profiles. Not used currently ***/
- leaf transport-encap-profile-name {
- type string;
- description
- "The transport encap profile name with sub configurations for
- handling transport encap.";
- }
-/*** list: end ***/
- }
-/*** container: end ***/
- }
-/*** module: end ***/
-}
diff --git a/ioam/asciidoc/Readme.adoc b/ioam/asciidoc/Readme.adoc
deleted file mode 100644
index c0e30bd..0000000
--- a/ioam/asciidoc/Readme.adoc
+++ /dev/null
@@ -1,11 +0,0 @@
-= ioam
-
-This is a Honeycomb plugin providing mapping code between HC and iOAM Plugin APIs.
-
-== Usage
-
-Refer to ioam_postman_collection.json for sample requests.
-
-In order to make HC iOAM plugin work, need to start vpp and load ioam plugin first.
-
-At this point in time, iOAM trace plugin configurations are supported.
diff --git a/ioam/impl/asciidoc/Readme.adoc b/ioam/impl/asciidoc/Readme.adoc
deleted file mode 100644
index 6660fc4..0000000
--- a/ioam/impl/asciidoc/Readme.adoc
+++ /dev/null
@@ -1,3 +0,0 @@
-= vppioam-impl
-
-Overview of vppioam-impl
diff --git a/ioam/impl/pom.xml b/ioam/impl/pom.xml
deleted file mode 100644
index dd106d0..0000000
--- a/ioam/impl/pom.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>io.fd.honeycomb.common</groupId>
- <artifactId>impl-parent</artifactId>
- <version>1.16.12-SNAPSHOT</version>
- <relativePath>../../common/impl-parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>io.fd.honeycomb.vppioam</groupId>
- <artifactId>vppioam-impl</artifactId>
- <name>${project.artifactId}</name>
- <version>1.16.12-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <properties>
- <ioam.version>1.0-SNAPSHOT</ioam.version>
- <jvpp.version>16.12-SNAPSHOT</jvpp.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>vppioam-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- </dependency>
- <dependency>
- <groupId>net.jmob</groupId>
- <artifactId>guice.conf</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-multibindings</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-testlib</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>io.fd.honeycomb</groupId>
- <artifactId>translate-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb</groupId>
- <artifactId>translate-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb</groupId>
- <artifactId>notification-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb</groupId>
- <artifactId>cfg-init</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.vpp</groupId>
- <artifactId>jvpp-registry</artifactId>
- <version>${jvpp.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.vpp</groupId>
- <artifactId>jvpp-ioam-trace</artifactId>
- <version>${ioam.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb.vpp</groupId>
- <artifactId>vpp-translate-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb.vpp</groupId>
- <artifactId>vpp-translate-test</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb</groupId>
- <artifactId>minimal-distribution</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/VppIoamModule.java b/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/VppIoamModule.java
deleted file mode 100755
index 34975d7..0000000
--- a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/VppIoamModule.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.honeycomb.vppioam.impl;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.inject.AbstractModule;
-import com.google.inject.Singleton;
-import com.google.inject.multibindings.Multibinder;
-import com.google.inject.name.Names;
-import com.google.inject.Provider;
-import io.fd.honeycomb.data.init.DataTreeInitializer;
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import io.fd.honeycomb.vppioam.impl.config.VppIoamWriterFactory;
-import io.fd.honeycomb.vppioam.impl.util.JVppIoamProvider;
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace;
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtraceFacade;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Glue code necessary for Honeycomb distribution to pick up the plugin classes
- */
-public final class VppIoamModule extends AbstractModule {
-
- private static final Logger LOG = LoggerFactory.getLogger(VppIoamModule.class);
- private final Class<? extends Provider<FutureJVppIoamtraceFacade>> jvppIoamProviderClass;
-
- public VppIoamModule() {
- this(JVppIoamProvider.class);
- }
-
- @VisibleForTesting
- VppIoamModule(Class<? extends Provider<FutureJVppIoamtraceFacade>> jvppIoamProvider) {
- this.jvppIoamProviderClass = jvppIoamProvider;
- }
-
- @Override
- protected void configure() {
- LOG.debug("Installing iOAM module");
-
- // Bind to Plugin's JVPP.
- bind(FutureJVppIoamtrace.class).toProvider(jvppIoamProviderClass).in(Singleton.class);
-
- // Below are classes picked up by HC framework
- Multibinder.newSetBinder(binder(), WriterFactory.class).addBinding().to(VppIoamWriterFactory.class);
-
- LOG.debug("Module iOAM successfully configured");
- }
-}
diff --git a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/config/IoamTraceWriterCustomizer.java b/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/config/IoamTraceWriterCustomizer.java
deleted file mode 100755
index 8a45e87..0000000
--- a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/config/IoamTraceWriterCustomizer.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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.honeycomb.vppioam.impl.config;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.honeycomb.vppioam.impl.util.FutureJVppIoamCustomizer;
-
-import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileAdd;
-import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileAddReply;
-import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileDel;
-import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileDelReply;
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace;
-
-import java.util.concurrent.CompletionStage;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.IoamTraceConfig;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig.TraceOp;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.trace.config.NodeInterfaces;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfigKey;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.trace.config.NodeInterfaces;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Writer customizer responsible for Ioam Trace create/delete.
- */
-public class IoamTraceWriterCustomizer extends FutureJVppIoamCustomizer
- implements ListWriterCustomizer<TraceConfig, TraceConfigKey>, ByteDataTranslator, JvppReplyConsumer {
-
- private static final Logger LOG = LoggerFactory.getLogger(IoamTraceWriterCustomizer.class);
-
- public IoamTraceWriterCustomizer(@Nonnull final FutureJVppIoamtrace futureJVppIoam) {
- super(futureJVppIoam);
- }
-
- @Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<TraceConfig> id,
- @Nonnull final TraceConfig dataCurr,
- @Nonnull final WriteContext writeContext)
- throws WriteFailedException {
-
- try {
- addTraceConfig(dataCurr, writeContext, id);
- } catch (Exception exCreate) {
- LOG.error("Add Trace Configuration failed", exCreate);
- throw new WriteFailedException.CreateFailedException(id, dataCurr, exCreate);
- }
-
- LOG.debug("Trace config added iid={}, added {}", id, dataCurr);
- }
-
- @Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<TraceConfig> id,
- @Nonnull final TraceConfig dataBefore,
- @Nonnull final TraceConfig dataAfter,
- @Nonnull final WriteContext ctx) throws WriteFailedException {
- try {
- deleteTraceConfig(dataBefore, id);
- addTraceConfig(dataAfter, ctx, id);
- } catch (Exception exUpdate) {
- LOG.error("Update Trace Configuration failed", exUpdate);
- throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter, exUpdate);
- }
-
- LOG.debug("Trace config updated {}", dataAfter);
- }
-
- @Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<TraceConfig> id,
- @Nonnull final TraceConfig dataBefore,
- @Nonnull final WriteContext ctx) throws WriteFailedException {
- try {
- deleteTraceConfig(dataBefore, id);
- } catch (Exception exDelete) {
- LOG.error("Delete Trace Configuration failed", exDelete);
- throw new WriteFailedException.DeleteFailedException(id, exDelete);
- }
-
- LOG.debug("Trace config deleted:iid={} dataBefore={}", id, dataBefore);
- }
-
- public TraceProfileAddReply addTraceConfig(TraceConfig traceConfig,
- WriteContext ctx,
- final InstanceIdentifier<TraceConfig> id) throws Exception {
-
- TraceProfileAdd traceProfileAdd = new TraceProfileAdd();
- traceProfileAdd.traceType = (byte) traceConfig.getTraceType().byteValue(); //trace type
- traceProfileAdd.numElts = (byte) traceConfig.getTraceNumElt().byteValue(); //num of elts
- traceProfileAdd.traceTsp = (byte) traceConfig.getTraceTsp().getIntValue(); // tsp
- traceProfileAdd.appData = (int) traceConfig.getTraceAppData().intValue(); // appdata
- traceProfileAdd.nodeId = (int) traceConfig.getNodeId().intValue(); // nodeid
-
- /* Write to VPP */
- final TraceProfileAddReply reply = getReplyForWrite((getFutureJVppIoam().
- traceProfileAdd(traceProfileAdd).
- toCompletableFuture()), id);
- return reply;
- }
-
- public TraceProfileDelReply deleteTraceConfig(TraceConfig dataBefore,
- final InstanceIdentifier<TraceConfig> id) throws Exception {
- TraceProfileDel del = new TraceProfileDel();
-
- /* Write to VPP */
- TraceProfileDelReply reply = getReplyForWrite((getFutureJVppIoam().
- traceProfileDel(del).toCompletableFuture()), id);
-
- return reply;
- }
-}
diff --git a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/config/VppIoamWriterFactory.java b/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/config/VppIoamWriterFactory.java
deleted file mode 100755
index 40311cd..0000000
--- a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/config/VppIoamWriterFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.honeycomb.vppioam.impl.config;
-
-import com.google.common.collect.Sets;
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import io.fd.honeycomb.translate.impl.write.GenericListWriter;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.IoamTraceConfig;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace;
-
-public class VppIoamWriterFactory implements WriterFactory {
-
- @Nonnull
- private final FutureJVppIoamtrace jvppIoam;
-
- @Inject
- public VppIoamWriterFactory(@Nonnull final FutureJVppIoamtrace jvppIoam) {
- this.jvppIoam = jvppIoam;
- }
-
- @Override
- public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) {
- // TraceConfig
- final InstanceIdentifier<TraceConfig> trId =
- InstanceIdentifier.create(IoamTraceConfig.class).child(TraceConfig.class);
- registry.add(new GenericListWriter<>(trId, new IoamTraceWriterCustomizer(jvppIoam)));
- }
-}
diff --git a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/util/FutureJVppIoamCustomizer.java b/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/util/FutureJVppIoamCustomizer.java
deleted file mode 100755
index b60581a..0000000
--- a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/util/FutureJVppIoamCustomizer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.honeycomb.vppioam.impl.util;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Preconditions;
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace;
-import javax.annotation.Nonnull;
-
-/**
- * Abstract utility to hold the IoamApi reference.
- */
-@Beta
-public abstract class FutureJVppIoamCustomizer {
-
- private final FutureJVppIoamtrace futureJVppIoam;
-
- public FutureJVppIoamCustomizer(@Nonnull final FutureJVppIoamtrace futureJVppIoam) {
- this.futureJVppIoam = Preconditions.checkNotNull(futureJVppIoam,
- "futureJVppIoam should not be null");
- }
-
- /**
- * Get IoamApi reference
- *
- * @return IoamApi reference
- */
- public FutureJVppIoamtrace getFutureJVppIoam() {
- return futureJVppIoam;
- }
-}
diff --git a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/util/JVppIoamProvider.java b/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/util/JVppIoamProvider.java
deleted file mode 100755
index d952664..0000000
--- a/ioam/impl/src/main/java/io/fd/honeycomb/vppioam/impl/util/JVppIoamProvider.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco and 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.honeycomb.vppioam.impl.util;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import io.fd.honeycomb.infra.distro.ProviderTrait;
-import java.io.IOException;
-import io.fd.vpp.jvpp.JVppRegistry;
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace;
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtraceFacade;
-import io.fd.vpp.jvpp.ioamtrace.JVppIoamtraceImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Provides future API for jvpp-ioam plugin. Must be a singleton due to shutdown hook usage.
- * Registers shutdown hook to free plugin's resources on shutdown.
- */
-public final class JVppIoamProvider extends ProviderTrait<FutureJVppIoamtraceFacade> {
-
- private static final Logger LOG = LoggerFactory.getLogger(JVppIoamProvider.class);
-
- @Inject
- private JVppRegistry registry;
-
- @Override
- protected FutureJVppIoamtraceFacade create() {
- try {
- final JVppIoamtraceImpl jVppIoamTr = new JVppIoamtraceImpl();
- // Free jvpp-ioam plugin's resources on shutdown
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run() {
- LOG.info("Unloading jvpp-ioam plugin");
- jVppIoamTr.close();
- LOG.info("Successfully unloaded jvpp-ioam plugin");
- }
- });
-
- LOG.debug("Successfully loaded jvpp-ioam plugin");
- return new FutureJVppIoamtraceFacade(registry, jVppIoamTr);
- } catch (IOException e) {
- throw new IllegalStateException("Unable to open VPP management connection", e);
- }
- }
-}
-
diff --git a/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java b/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java
deleted file mode 100644
index d9176d3..0000000
--- a/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.honeycomb.vppioam.impl;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.Matchers.empty;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.MockitoAnnotations.initMocks;
-
-import com.google.inject.Guice;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.name.Named;
-import com.google.inject.testing.fieldbinder.Bind;
-import com.google.inject.testing.fieldbinder.BoundFieldModule;
-import io.fd.honeycomb.translate.impl.write.registry.FlatWriterRegistryBuilder;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import java.util.HashSet;
-import java.util.Set;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtraceFacade;
-import io.fd.vpp.jvpp.JVppRegistry;
-
-
-public class VppIoamModuleTest {
-
- @Named("honeycomb-context")
- @Bind
- @Mock
- private DataBroker honeycombContext;
-
- @Named("honeycomb-initializer")
- @Bind
- @Mock
- private DataBroker honeycombInitializer;
-
- @Bind
- @Mock
- private JVppRegistry registry;
-
- @Inject
- private Set<WriterFactory> writerFactories = new HashSet<>();
-
- @Before
- public void setUp() throws Exception {
-
- initMocks(this);
-
- Guice.createInjector(new VppIoamModule(MockJVppIoamProvider.class), BoundFieldModule.of(this)).injectMembers(this);
- }
-
- @Test
- public void testWriterFactories() throws Exception {
- assertThat(writerFactories, is(not(empty())));
-
- final FlatWriterRegistryBuilder registryBuilder = new FlatWriterRegistryBuilder();
- writerFactories.forEach(factory -> factory.init(registryBuilder));
- assertNotNull(registryBuilder.build());
- }
-
- private static final class MockJVppIoamProvider implements Provider<FutureJVppIoamtraceFacade> {
-
- @Override
- public FutureJVppIoamtraceFacade get() {
- return mock(FutureJVppIoamtraceFacade.class);
- }
- }
-}
-
diff --git a/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/config/IoamTraceWriterCustomizerTest.java b/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/config/IoamTraceWriterCustomizerTest.java
deleted file mode 100644
index 8c182dd..0000000
--- a/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/config/IoamTraceWriterCustomizerTest.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * 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.honeycomb.vppioam.impl.config;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileAdd;
-import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileAddReply;
-import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileDel;
-import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileDelReply;
-import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.VppCallbackException;
-
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.IoamTraceConfig;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig.TraceTsp;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfigBuilder;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig.TraceOp;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.trace.config.NodeInterfaces;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfigKey;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.trace.config.NodeInterfaces;
-
-
-public class IoamTraceWriterCustomizerTest extends WriterCustomizerTest {
-
- private static final String TRACE_NAME = "trace_test";
-
- @Mock
- protected FutureJVppIoamtrace jvppIoam;
-
- private IoamTraceWriterCustomizer customizer;
-
- @Override
- public void setUp() throws Exception {
- customizer = new IoamTraceWriterCustomizer(jvppIoam);
- }
-
- private static TraceConfig generateTraceConfig(final String name) {
- final TraceConfigBuilder builder = new TraceConfigBuilder();
- builder.setTraceConfigName(name);
- builder.setKey(new TraceConfigKey(name));
- builder.setAclName(name);
- builder.setTraceType(new Short("31"));
- builder.setTraceNumElt(new Short("4"));
- builder.setTraceTsp(TraceTsp.Milliseconds);
- builder.setTraceOp(TraceOp.Add);
- builder.setTraceAppData(new Long("123"));
- builder.setNodeId(new Long("1"));
-
- return builder.build();
- }
-
- private static InstanceIdentifier<TraceConfig> getTraceConfigId(final String name) {
- return InstanceIdentifier.create(IoamTraceConfig.class)
- .child(TraceConfig.class, new TraceConfigKey(name));
- }
-
- private void whenTraceAddThenSuccess() {
- final TraceProfileAddReply reply = new TraceProfileAddReply();
- reply.context = 1;
- doReturn(future(reply)).when(jvppIoam).traceProfileAdd(any(TraceProfileAdd.class));
- }
-
- private void whenTraceAddThenFailure() {
- doReturn(failedFuture()).when(jvppIoam).traceProfileAdd(any(TraceProfileAdd.class));
- }
-
- private void whenTraceDelThenSuccess() {
- final TraceProfileDelReply reply = new TraceProfileDelReply();
- reply.context = 1;
- doReturn(future(reply)).when(jvppIoam).traceProfileDel(any(TraceProfileDel.class));
- }
-
- private void whenTraceDelThenFailure() {
- doReturn(failedFuture()).when(jvppIoam).traceProfileDel(any(TraceProfileDel.class));
- }
-
- private static TraceProfileAdd generateTraceProfileAdd() {
- final TraceProfileAdd request = new TraceProfileAdd();
- request.traceType = 0x1f;
- request.numElts = 4;
- request.nodeId = 1;
- request.traceTsp = 1;
- request.appData = 123;
-
- return request;
- }
-
- private static TraceProfileDel generateTraceProfileDel() {
- final TraceProfileDel request = new TraceProfileDel();
-
- return request;
- }
-
- @Test
- public void testCreate() throws Exception {
- final TraceConfig traceConfig = generateTraceConfig(TRACE_NAME);
- final InstanceIdentifier<TraceConfig> id = getTraceConfigId(TRACE_NAME);
-
- whenTraceAddThenSuccess();
-
- customizer.writeCurrentAttributes(id, traceConfig, writeContext);
-
- verify(jvppIoam).traceProfileAdd(generateTraceProfileAdd());
- }
-
- @Test
- public void testCreateFailed() throws Exception {
- final TraceConfig traceConfig = generateTraceConfig(TRACE_NAME);
- final InstanceIdentifier<TraceConfig> id = getTraceConfigId(TRACE_NAME);
-
- whenTraceAddThenFailure();
-
- try {
- customizer.writeCurrentAttributes(id, traceConfig, writeContext);
- } catch (WriteFailedException e) {
- //assertTrue(e.getCause() instanceof VppBaseCallException);
- verify(jvppIoam).traceProfileAdd(generateTraceProfileAdd());
-
- return;
- }
- fail("WriteFailedException.CreateFailedException was expected");
- }
-
- @Test
- public void testDelete() throws Exception {
-
- final TraceConfig traceConfig = generateTraceConfig(TRACE_NAME);
- final InstanceIdentifier<TraceConfig> id = getTraceConfigId(TRACE_NAME);
-
- whenTraceDelThenSuccess();
-
- customizer.deleteCurrentAttributes(id, traceConfig, writeContext);
-
- verify(jvppIoam).traceProfileDel(generateTraceProfileDel());
- }
-
- @Test
- public void testDeleteFailed() throws Exception {
-
- final TraceConfig traceConfig = generateTraceConfig(TRACE_NAME);
- final InstanceIdentifier<TraceConfig> id = getTraceConfigId(TRACE_NAME);
-
- whenTraceDelThenFailure();
-
- try {
- customizer.deleteCurrentAttributes(id, traceConfig, writeContext);
- } catch (WriteFailedException e) {
- //assertTrue(e.getCause() instanceof VppBaseCallException);
- verify(jvppIoam).traceProfileDel(generateTraceProfileDel());
-
- return;
- }
- fail("WriteFailedException.DeleteFailedException was expected");
-
- customizer.deleteCurrentAttributes(id, traceConfig, writeContext);
- }
-}
diff --git a/ioam/ioam_trace_postman_collection.json b/ioam/ioam_trace_postman_collection.json
deleted file mode 100644
index d524813..0000000
--- a/ioam/ioam_trace_postman_collection.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "id": "7d81e8b0-274e-1f22-de94-d40cb78a389d",
- "name": "Honeycomb RESTCONF calls for iOAM Trace",
- "description": "To enable iOAM trace on VPP management nodes.",
- "order": [
- "f5a5aaea-2d61-a57f-191a-7cc81286f605"
- ],
- "folders": [],
- "timestamp": 1478073563257,
- "owner": 0,
- "public": false,
- "requests": [
- {
- "id": "f5a5aaea-2d61-a57f-191a-7cc81286f605",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8181/restconf/config/ioam-sb-trace:ioam-trace-config/",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1478077673476,
- "name": "iaom trace",
- "description": "",
- "collectionId": "7d81e8b0-274e-1f22-de94-d40cb78a389d",
- "responses": [],
- "rawModeData": "{\n\"trace-config\":{\n \"trace-config-name\":\"trace\",\n \"acl-name\":\"testAcl\",\n \"trace-type\":31,\n \"trace-num-elt\":3,\n \"trace-tsp\":\"milliseconds\",\n \"trace-op\":\"add\",\n \"trace-app-data\":1234,\n \"data-export-profile-name\":\"dataProfileName\",\n \"transport-encap-profile-name\":\"transProfileName\",\n \"node-id\":1,\n \"node-interfaces\":[\n {\n \"index\":5,\n \"intf-name\":\"GigabitEthernetb/0/0\"\n }\n ]\n }\n}\n"
- }
- ]
-} \ No newline at end of file
diff --git a/ioam/pom.xml b/ioam/pom.xml
deleted file mode 100644
index 2708114..0000000
--- a/ioam/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <parent>
- <groupId>io.fd.honeycomb.common</groupId>
- <artifactId>honeycomb-parent</artifactId>
- <version>1.16.12-SNAPSHOT</version>
- <relativePath>../common/honeycomb-parent</relativePath>
- </parent>
-
- <groupId>io.fd.honeycomb.ioam</groupId>
- <artifactId>vppioam-aggregator</artifactId>
- <version>1.16.12-SNAPSHOT</version>
- <name>${project.artifactId}</name>
- <packaging>pom</packaging>
- <modelVersion>4.0.0</modelVersion>
- <description>Aggregator for Honeycomb iOAM plugin</description>
-
- <modules>
- <module>api</module>
- <module>impl</module>
- </modules>
- <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/lisp/api/asciidoc/Readme.adoc b/lisp/api/asciidoc/Readme.adoc
deleted file mode 100644
index 191cab3..0000000
--- a/lisp/api/asciidoc/Readme.adoc
+++ /dev/null
@@ -1,3 +0,0 @@
-= lisp-api
-
-Overview of lisp-api \ No newline at end of file
diff --git a/lisp/api/pom.xml b/lisp/api/pom.xml
deleted file mode 100755
index b16aaea..0000000
--- a/lisp/api/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2015 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.
--->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>io.fd.honeycomb.common</groupId>
- <artifactId>api-parent</artifactId>
- <version>1.16.12-SNAPSHOT</version>
- <relativePath>../../common/api-parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>io.fd.honeycomb.lisp</groupId>
- <artifactId>lisp-api</artifactId>
- <name>${project.artifactId}</name>
- <version>1.16.12-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <properties>
- <project.translate.groupId>io.fd.honeycomb</project.translate.groupId>
- <naming.context.version>1.16.12-SNAPSHOT</naming.context.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-interfaces</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>yang-ext</artifactId>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb.vpp</groupId>
- <artifactId>naming-context-api</artifactId>
- <version>${naming.context.version}</version>
- </dependency>
- </dependencies>
-</project> \ No newline at end of file
diff --git a/lisp/api/src/main/yang/adjacencies-identification-context.yang b/lisp/api/src/main/yang/adjacencies-identification-context.yang
deleted file mode 100644
index ae05f83..0000000
--- a/lisp/api/src/main/yang/adjacencies-identification-context.yang
+++ /dev/null
@@ -1,65 +0,0 @@
-module adjacencies-identification-context {
- yang-version 1;
- namespace "urn:honeycomb:params:xml:ns:yang:adjacencies:identification:context";
- prefix "adjacencies-identification-context";
-
- description
- "This module contains mappings between adjacency identificator and actual unique combination of
- remote and local eid in vpp";
-
- revision "2016-08-01" {
- description
- "Initial revision.";
- }
-
- import lisp {prefix "lisp";}
- import ietf-lisp-address-types {prefix "lisp-types";}
- import yang-ext {prefix "ext";}
- import naming-context { prefix "nc";}
-
- grouping adjacencies-identification-context-attributes{
-
- container adjacencies-identification-contexts {
-
- list adjacencies-identification {
-
- key "name";
-
- leaf name {
- type string;
- }
-
- container mappings{
- list mapping {
-
- key "id";
-
- leaf id {
- type string;
- description "Id that uniquely identifies adjacency";
- }
-
- container eid-identificator-pair{
- leaf local-eid-id {
- type lisp:mapping-id;
- description "Local EID identifier";
- mandatory true;
- }
-
- leaf remote-eid-id {
- type lisp:mapping-id;
- description "Remote EID identifier";
- mandatory true;
- }
- }
- }
- }
- }
- }
- }
-
- augment /nc:contexts {
- ext:augment-identifier "adjacencies-identification-ctx-augmentation";
- uses adjacencies-identification-context-attributes;
- }
-} \ No newline at end of file
diff --git a/lisp/api/src/main/yang/eid-mapping-context.yang b/lisp/api/src/main/yang/eid-mapping-context.yang
deleted file mode 100644
index 3fb6d89..0000000
--- a/lisp/api/src/main/yang/eid-mapping-context.yang
+++ /dev/null
@@ -1,44 +0,0 @@
-module eid-mapping-context {
- yang-version 1;
- namespace "urn:honeycomb:params:xml:ns:yang:eid:mapping:context";
- prefix "eid-mapping-context";
-
- description
- "This module contains mappings stored for local-mappings id to actual eid";
-
- revision "2016-08-01" {
- description
- "Initial revision.";
- }
-
- import lisp {prefix "lisp";}
- import ietf-lisp-address-types {prefix "lisp-types";}
-
- container contexts {
- list eid-mapping-context {
-
- key "name";
-
- leaf name {
- type string;
- }
-
- container mappings{
- list mapping {
-
- key "id";
-
- leaf id {
- type lisp:mapping-id;
- description "Id that uniquely identifies a mapping";
- }
-
- container eid {
- uses lisp-types:lisp-address;
- description "EID address";
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/lisp/api/src/main/yang/ietf-lisp-address-types.yang b/lisp/api/src/main/yang/ietf-lisp-address-types.yang
deleted file mode 100755
index 2a3a1d3..0000000
--- a/lisp/api/src/main/yang/ietf-lisp-address-types.yang
+++ /dev/null
@@ -1,677 +0,0 @@
-module ietf-lisp-address-types {
- namespace "urn:ietf:params:xml:ns:yang:ietf-lisp-address-types";
- prefix laddr;
- import ietf-inet-types {
- prefix inet;
- revision-date 2013-07-15;
- }
- import ietf-yang-types {
- prefix yang;
- revision-date 2013-07-15;
- }
- organization
- "IETF LISP (Locator/ID Separation Protocol) Working Group";
- contact
- "lisp@ietf.org";
- description
- "This YANG module defines the LISP Canonical Address Formats
- (LCAF) for LISP. The module can be extended by vendors to
- define vendor-specific parameters.
-
- Copyright (c) 2014 IETF Trust and the persons identified as
- authors of the code. All rights reserved.
-
- Redistribution and use in source and binary forms, with or
- without modification, is permitted pursuant to, and subject
- to the license terms contained in, the Simplified BSD License
- set forth in Section 4.c of the IETF Trust's Legal Provisions
- Relating to IETF Documents
- (http://trustee.ietf.org/license-info).
-
- This version of this YANG module is part of RFC 6338; see
- the RFC itself for full legal notices.
-
- ";
- revision 2015-11-05 {
- description
- "Initial revision.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10";
- }
- identity lisp-address-family {
- description
- "Base identity from which identities describing LISP address
- families are derived.";
- }
- identity no-address-afi {
- base lisp-address-family;
- description
- "IANA Reserved.";
- }
- identity ipv4-afi {
- base lisp-address-family;
- description
- "IANA IPv4 address family.";
- }
- identity ipv4-prefix-afi {
- base lisp-address-family;
- description
- "IANA IPv4 address family prefix.";
- }
- identity ipv6-afi {
- base lisp-address-family;
- description
- "IANA IPv6 address family.";
- }
- identity ipv6-prefix-afi {
- base lisp-address-family;
- description
- "IANA IPv6 address family prefix.";
- }
- identity mac-afi {
- base lisp-address-family;
- description
- "IANA MAC address family.";
- }
- identity distinguished-name-afi {
- base lisp-address-family;
- description
- "IANA Distinguished Name address family.";
- }
- identity as-number-afi {
- base lisp-address-family;
- description
- "IANA AS Number address family.";
- }
- identity lcaf {
- base lisp-address-family;
- description
- "IANA LISP Canonical Address Format address family.";
- }
- identity null-address-lcaf {
- base lcaf;
- description
- "Null body LCAF type.";
- }
- identity afi-list-lcaf {
- base lcaf;
- description
- "AFI-List LCAF type.";
- }
- identity instance-id-lcaf {
- base lcaf;
- description
- "Instance-ID LCAF type.";
- }
- identity as-number-lcaf {
- base lcaf;
- description
- "AS Number LCAF type.";
- }
- identity application-data-lcaf {
- base lcaf;
- description
- "Application Data LCAF type.";
- }
- identity geo-coordinates-lcaf {
- base lcaf;
- description
- "Geo-coordinates LCAF type.";
- }
- identity opaque-key-lcaf {
- base lcaf;
- description
- "Opaque Key LCAF type.";
- }
- identity nat-traversal-lcaf {
- base lcaf;
- description
- "NAT-Traversal LCAF type.";
- }
- identity nonce-locator-lcaf {
- base lcaf;
- description
- "Nonce-Locator LCAF type.";
- }
- identity multicast-info-lcaf {
- base lcaf;
- description
- "Multicast Info LCAF type.";
- }
- identity explicit-locator-path-lcaf {
- base lcaf;
- description
- "Explicit Locator Path LCAF type.";
- }
- identity security-key-lcaf {
- base lcaf;
- description
- "Security Key LCAF type.";
- }
- identity source-dest-key-lcaf {
- base lcaf;
- description
- "Source/Dest LCAF type.";
- }
- identity replication-list-lcaf {
- base lcaf;
- description
- "Replication-List LCAF type.";
- }
- identity json-data-model-lcaf {
- base lcaf;
- description
- "JSON Data Model LCAF type.";
- }
- identity key-value-address-lcaf {
- base lcaf;
- description
- "Key/Value Address LCAF type.";
- }
- identity encapsulation-format-lcaf {
- base lcaf;
- description
- "Encapsulation Format LCAF type.";
- }
- identity service-path-lcaf {
- base lcaf;
- description
- "Service Path LCAF type.";
- }
- typedef instance-id-type {
- type uint32 {
- range "0..16777215";
- }
- description
- "Defines the range of values for an Instance ID.";
- }
- typedef service-path-id-type {
- type uint32 {
- range "0..16777215";
- }
- description
- "Defines the range of values for a Service Path ID.";
- }
- typedef distinguished-name-type {
- type string;
- description
- "Distinguished Name address.";
- reference
- "http://www.iana.org/assignments/address-family-numbers/
- address-family-numbers.xhtml";
- }
- typedef simple-address {
- type union {
- type inet:ip-address;
- type inet:ip-prefix;
- type yang:mac-address;
- type distinguished-name-type;
- type inet:as-number;
- }
- description
- "Union of address types that can be part of LCAFs.";
- }
-
- typedef lisp-address-family-ref {
- type identityref {
- base lisp-address-family;
- }
- description
- "LISP address family reference.";
- }
- typedef lcaf-ref {
- type identityref {
- base lcaf;
- }
- description
- "LCAF types reference.";
- }
-
- grouping lisp-address {
- description
- "Generic LISP address.";
- leaf address-type {
- type lisp-address-family-ref;
- mandatory true;
- description
- "Type of the LISP address.";
- }
- leaf virtual-network-id {
- type instance-id-type;
- description
- "Virtual Network Identifier (instance-id) of the address.";
- }
- choice address {
- description
- "Various LISP address types, including IP, MAC, and LCAF.";
-
- leaf no-address {
- when "../address-type = 'laddr:no-addr-afi'" {
- description
- "When AFI is 0.";
- }
- type empty;
- description
- "No address.";
- }
- leaf ipv4 {
- when "../address-type = 'laddr:ipv4-afi'" {
- description
- "When AFI is IPv4.";
- }
- type inet:ipv4-address;
- description
- "IPv4 address.";
- }
- leaf ipv4-prefix {
- when "../address-type = 'laddr:ipv4-prefix-afi'" {
- description
- "When AFI is IPv4.";
- }
- type inet:ipv4-prefix;
- description
- "IPv4 prefix.";
- }
- leaf ipv6 {
- when "../address-type = 'laddr:ipv6-afi'" {
- description
- "When AFI is IPv6.";
- }
- type inet:ipv6-address;
- description
- "IPv6 address.";
- }
- leaf ipv6-prefix {
- when "../address-type = 'laddr:ipv6-prefix-afi'" {
- description
- "When AFI is IPv6.";
- }
- type inet:ipv6-prefix;
- description
- "IPv6 address.";
- }
- leaf mac {
- when "../address-type = 'laddr:mac-afi'" {
- description
- "When AFI is MAC.";
- }
- type yang:mac-address;
- description
- "MAC address.";
- }
- leaf distinguished-name {
- when "../address-type = 'laddr:distinguished-name-afi'" {
- description
- "When AFI is distinguished-name.";
- }
- type distinguished-name-type;
- description
- "Distinguished Name address.";
- }
- leaf as-number {
- when "../address-type = 'laddr:as-number-afi'" {
- description
- "When AFI is as-number.";
- }
- type inet:as-number;
- description
- "AS Number.";
- }
- container null-address {
- when "../address-type = 'laddr:null-address-lcaf'" {
- description
- "When LCAF type is null.";
- }
- description
- "Null body LCAF type";
- leaf address {
- type empty;
- description
- "AFI address.";
- }
- }
- container afi-list {
- when "../address-type = 'laddr:afi-list-lcaf'" {
- description
- "When LCAF type is AFI-List.";
- }
- description
- "AFI-List LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.16.1";
- leaf-list address-list {
- type simple-address;
- description
- "List of AFI addresses.";
- }
- }
- container instance-id {
- when "../address-type = 'laddr:instance-id-lcaf'" {
- description
- "When LCAF type is Instance-ID";
- }
- description
- "Instance ID LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.2";
- leaf iid {
- type instance-id-type;
- description
- "Instance ID value.";
- }
- leaf mask-length {
- type uint8;
- description
- "Mask length.";
- }
- leaf address {
- type simple-address;
- description
- "AFI address.";
- }
- }
- container as-number-lcaf {
- when "../address-type = 'laddr:as-number-lcaf'" {
- description
- "When LCAF type is AS-Number.";
- }
- description
- "AS Number LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.3";
- leaf as {
- type inet:as-number;
- description
- "AS number.";
- }
- leaf address {
- type simple-address;
- description
- "AFI address.";
- }
- }
- container application-data {
- when "../address-type = 'laddr:application-data-lcaf'" {
- description
- "When LCAF type is Application Data.";
- }
- description
- "Application Data LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.4";
- leaf address {
- type simple-address;
- description
- "AFI address.";
- }
- leaf protocol {
- type uint8;
- description
- "Protocol number.";
- }
- leaf ip-tos {
- type int32;
- description
- "Type of service field.";
- }
- leaf local-port-low {
- type inet:port-number;
- description
- "Low end of local port range.";
- }
- leaf local-port-high {
- type inet:port-number;
- description
- "High end of local port range.";
- }
- leaf remote-port-low {
- type inet:port-number;
- description
- "Low end of remote port range.";
- }
- leaf remote-port-high {
- type inet:port-number;
- description
- "High end of remote port range.";
- }
- }
- container geo-coordinates {
- when "../address-type = 'laddr:geo-coordinates-lcaf'" {
- description
- "When LCAF type is Geo-coordinates.";
- }
- description
- "Geo-coordinates LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.5";
- leaf latitude {
- type bits {
- bit N {
- description
- "Latitude bit.";
- }
- }
- description
- "Bit that selects between North and South latitude.";
- }
- leaf latitude-degrees {
- type uint8 {
- range "0 .. 90";
- }
- description
- "Degrees of latitude.";
- }
- leaf latitude-minutes {
- type uint8 {
- range "0..59";
- }
- description
- "Minutes of latitude.";
- }
- leaf latitude-seconds {
- type uint8 {
- range "0..59";
- }
- description
- "Seconds of latitude.";
- }
- leaf longitude {
- type bits {
- bit E {
- description
- "Longitude bit.";
- }
- }
- description
- "Bit that selects between East and West longitude.";
- }
- leaf longitude-degrees {
- type uint16 {
- range "0 .. 180";
- }
- description
- "Degrees of longitude.";
- }
- leaf longitude-minutes {
- type uint8 {
- range "0..59";
- }
- description
- "Minutes of longitude.";
- }
- leaf longitude-seconds {
- type uint8 {
- range "0..59";
- }
- description
- "Seconds of longitude.";
- }
- leaf altitude {
- type int32;
- description
- "Height relative to sea level in meters.";
- }
- leaf address {
- type simple-address;
- description
- "AFI address.";
- }
- }
- container nat-traversal {
- when "../address-type = 'laddr:nat-traversal-lcaf'" {
- description
- "When LCAF type is NAT-Traversal.";
- }
- description
- "NAT-Traversal LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.6";
- leaf ms-udp-port {
- type uint16;
- description
- "Map-Server UDP port (set to 4342).";
- }
- leaf etr-udp-port {
- type uint16;
- description
- "ETR UDP port.";
- }
- leaf global-etr-rloc {
- type simple-address;
- description
- "Global ETR RLOC address.";
- }
- leaf ms-rloc {
- type simple-address;
- description
- "Map-Server RLOC address.";
- }
- leaf private-etr-rloc {
- type simple-address;
- description
- "Private ETR RLOC address.";
- }
- leaf-list rtr-rlocs {
- type simple-address;
- description
- "List of RTR RLOC addresses.";
- }
- }
- container explicit-locator-path {
- when "../address-type = 'laddr:explicit-locator-path-lcaf'" {
- description
- "When LCAF type type is Explicit Locator Path.";
- }
- description
- "Explicit Locator Path LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.9";
- list hop {
- key "hop-id";
- ordered-by user;
- description
- "List of locator hops forming the explicit path.";
- leaf hop-id {
- type string {
- length "1..64";
- }
- description
- "Unique identifier for the hop.";
- }
- leaf address {
- type simple-address;
- description
- "AFI address.";
- }
- leaf lrs-bits {
- type bits{
- bit lookup {
- description
- "Lookup bit.";
- }
- bit rloc-probe {
- description
- "RLOC-probe bit.";
- }
- bit strict {
- description
- "Strict bit.";
- }
- }
- description
- "Flag bits per hop.";
- }
- }
- }
- container source-dest-key {
- when "../address-type = 'laddr:source-dest-key-lcaf'" {
- description
- "When LCAF type type is Source/Dest.";
- }
- description
- "Source/Dest LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.11";
- leaf source {
- type simple-address;
- description
- "Source address.";
- }
- leaf dest {
- type simple-address;
- description
- "Destination address.";
- }
- }
- container key-value-address {
- when "../address-type = 'laddr:key-value-address-lcaf'" {
- description
- "When LCAF type type is Key/Value Address.";
- }
- description
- "Key/Value Address LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
- #section-4.11";
- leaf key {
- type simple-address;
- description
- "Address as Key.";
- }
- leaf value {
- type simple-address;
- description
- "Address as Value.";
- }
- }
- container service-path {
- when "../address-type = 'laddr:service-path-lcaf'" {
- description
- "When LCAF type service path identifier.";
- }
- description
- "Service Path LCAF type.";
- reference
- "http://tools.ietf.org/html/draft-ermagan-lisp-nsh-00";
- leaf service-path-id {
- type service-path-id-type;
- description
- "Service path identifier for the path for NSH header";
- }
- leaf service-index {
- type uint8;
- description
- "Service path index for NSH header";
- }
- }
- }
- }
-}
diff --git a/lisp/api/src/main/yang/lisp.yang b/lisp/api/src/main/yang/lisp.yang
deleted file mode 100755
index f104bd8..0000000
--- a/lisp/api/src/main/yang/lisp.yang
+++ /dev/null
@@ -1,353 +0,0 @@
-//TODO mandatory statements
-module lisp {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:lisp";
- prefix "lisp";
- import ietf-interfaces {
- prefix "if";
- }
- import ietf-inet-types {
- prefix "inet";
- }
- import ietf-lisp-address-types {
- prefix "lisp-types";
- }
- organization
- "FD.io Overlay Forwarding Engine (ONE) project";
- contact
- "Florin Coras <fcoras@cisco.com>
- Vina Ermagan <vermagan@cisco.com>
- ONE list <one@lists.fd.io>";
-
- description
- "This YANG module defines the generic configuration and
- operational data for LISP in VPP";
-
- revision 2016-12-14 {
- description
- "This revision adds support for L2 features, by adding vrf-subtable/bridge-domain-subtable
- containers under vni-table. Both contains mandatory reference to index(vrf-subtable)
- or name(bridge-domain-subtable) of respective kind of table.";
-
- reference
- "https://tools.ietf.org/html/rfc6830";
- }
-
- revision "2016-05-20" {
- description
- "Initial revision of LISP model";
- reference
- "https://tools.ietf.org/html/rfc6830";
- }
-
- typedef locator-set-ref {
- type leafref {
- path "/lisp/lisp-feature-data/locator-sets/locator-set/name";
- }
- description "Locator-set reference";
- }
-
- typedef mapping-id {
- type string;
- description "Mapping ID";
- }
-
- typedef map-reply-action {
- type enumeration {
- enum no-action {
- value 0;
- description
- "Mapping is kept alive and no encapsulation occurs.";
- }
- enum natively-forward {
- value 1;
- description
- "Matching packets are not encapsulated or dropped but
- natively forwarded.";
- }
- enum send-map-request {
- value 2;
- description
- "Matching packets invoke Map-Requests.";
- }
- enum drop {
- value 3;
- description
- "Matching packets are dropped.";
- }
- }
- description
- "Defines the lisp map-cache ACT type";
- reference
- "https://tools.ietf.org/html/rfc6830#section-6.1.4";
- }
- grouping locator-properties-grouping {
- description
- "Properties of a RLOC";
- leaf priority {
- type uint8;
- description
- "Locator priority.";
- }
- leaf weight {
- type uint8;
- description
- "Locator weight.";
- }
- }
-
- grouping locator-sets-grouping {
- // NOTE: to be used only for local locators
- // lisp_add_del_locator_set locator-set <ls_name> [del]
- // lisp_add_del_locator locator-set <ls_name> iface <iface_name>
- // p <val> w <val> [del]
- container locator-sets {
- list locator-set {
- key "name";
- leaf name {
- type string;
- description "Locator-set name";
- }
- list interface {
- key "interface-ref";
- leaf interface-ref {
- type if:interface-ref;
- description "Interface reference";
- }
- uses locator-properties-grouping;
- description "List of interfaces part of the locator-set";
- }
- description "Locator-set";
- }
- description "Locator-sets";
- }
- description "Grouping for locator-sets";
- }
-
- grouping adjacencies-grouping {
- container adjacencies {
- list adjacency {
- key "id";
- leaf id {
- type string;
- description "Adjacency id";
- }
- container local-eid {
- uses lisp-types:lisp-address;
- description "Local EID that must have a local mapping";
- }
- container remote-eid {
- uses lisp-types:lisp-address;
- description "Remote EID that must have a remote mapping";
- }
- description "List of adjacencies";
- }
- description "Adjacencies programmed into the data plane";
- }
- description "Adjacencies grouping";
- }
-
- grouping dp-subtable-grouping {
- // Once both vni and table-id are set:
- // lisp_eid_table_add_del_map <vni> <dp_table>
- container local-mappings {
- list local-mapping {
- key "id";
- leaf id {
- type mapping-id;
- description "Id that uniquely identifies a mapping";
- }
- container eid {
- uses lisp-types:lisp-address;
- description "EID address";
- }
- leaf locator-set {
- type locator-set-ref;
- description "Locator-set";
- }
- description "Local mapping";
- }
- description "Local EID to locator-set mappings";
- }
- // lisp_add_del_local_eid eid <ip-address/mask> locator-set
- // <ls-name> [del]
- // lisp_add_del_remote_mapping vni <vni> eid <eid> seid
- // <seid> [action <action>] rloc
- // <ip-addr> [rloc <ip-addr> ..]
- // NOTE: 1.lisp_add_del_remote_mapping seid is used to build
- // src/dst mappings. Rlocs have p/w in them
- container remote-mappings {
- list remote-mapping {
- key "id";
- leaf id {
- type mapping-id;
- description "Id that uniquely identifies a mapping";
- }
- container eid {
- description "Remote EID address";
- uses lisp-types:lisp-address;
- }
- leaf ttl {
- type uint32;
- description "Mapping validity period.";
- }
- leaf authoritative {
- type bits {
- bit A {
- description "Authoritative bit.";
- }
- }
- description
- "Bit that indicates if mapping comes from an
- authoritative source.";
- }
- choice locator-list {
- description
- "list of locators are either negative, or positive.";
- case negative-mapping {
- //NOTE - Wrapped in container to prevent leaf map-reply-action enforcing impresence of rlocs
- container map-reply{
- leaf map-reply-action {
- type map-reply-action;
- description
- "Forwarding action for a negative mapping.";
- }
- }
- }
- case positive-mapping {
- // NOTE if container is not needed to encapsulate
- // locator list, remove it
- container rlocs {
- list locator {
- key "address";
- leaf address {
- type inet:ip-address;
- description "Locator address";
- }
- uses locator-properties-grouping;
- description "Remote locator";
- }
- description
- "List of locators for a positive mapping.";
- }
- }
- }
- uses adjacencies-grouping;
- description "List of remote mappings";
- }
- description "Map-cache/remote mappings cache";
- }
- description "Data path subtable (VRF/bridge domain) grouping";
- }
-
- grouping eid-table-grouping {
- container eid-table {
- list vni-table {
- key "virtual-network-identifier";
- leaf virtual-network-identifier {
- type uint32;
- description "vni";
- }
- container vrf-subtable {
- presence "Enable L3 mapping";
- leaf table-id {
- type uint32;
- description "table-id";
- mandatory true;
- }
-
- uses dp-subtable-grouping;
- description "VRF subtable";
- }
- container bridge-domain-subtable {
- presence "Enable L2 mapping";
- leaf bridge-domain-ref {
- type string;
- description "Name reference to existing bridge domain";
- mandatory true;
- }
-
- uses dp-subtable-grouping;
- description "Bridge domain subtable";
- }
- description "VNI tables";
- }
- description "EID table";
- }
- description "EID table grouping";
- }
- grouping map-resolvers-grouping {
- container map-resolvers {
- // lisp_add_del_map_resolver <ip>
- list map-resolver {
- key ip-address;
- leaf ip-address {
- type inet:ip-address;
- description "Map-resolver IP address";
- }
- description "List of map-resolvers";
- }
- description "Map-resolvers configured";
- }
- description "Map-Resolver grouping";
- }
- grouping pitr-cfg-grouping {
- // lisp_pitr_set_locator_set <ip>
- container pitr-cfg {
- leaf locator-set {
- type locator-set-ref;
- description "Locator-set reference";
- }
- description "Proxy-ITR configuration";
- }
- description "PITR configuration grouping";
- }
-
- grouping itr-remote-locator-sets-grouping{
- container itr-remote-locator-set{
- // lisp_add_del_map_request_itr_rlocs add/del <ls_name>
- // lisp_get_map_request_itr_rlocs
- leaf remote-locator-set-name{
- type locator-set-ref;
- description "Locators to be used in map-requests";
- }
- }
- }
-
- grouping lisp-feature-data-grouping{
- //aggregation of all lisp data, restricted by Lisp beeing enabled
-
- container lisp-feature-data{
- when "../lisp:enable = 'true'";
-
- uses locator-sets-grouping;
- uses eid-table-grouping;
- uses map-resolvers-grouping;
- uses pitr-cfg-grouping;
- uses itr-remote-locator-sets-grouping;
- }
- }
-
- // ref https://wiki.fd.io/view/ONE/Command-line_Interface_CLI_Guide
- container lisp {
-
- // lisp_enable_disable / lisp_enable_disable_status_dump
- leaf enable {
- type boolean;
- description "Enable/disable LISP feature";
- }
- uses lisp-feature-data-grouping;
- description "LISP configuration";
- }
-
- container lisp-state {
-
- // lisp_enable_disable / lisp_enable_disable_status_dump
- leaf enable {
- type boolean;
- description "Enable/disable LISP feature";
- }
- uses lisp-feature-data-grouping;
- description "LISP state";
- }
-}
diff --git a/lisp/asciidoc/Readme.adoc b/lisp/asciidoc/Readme.adoc
deleted file mode 100755
index b3a01c6..0000000
--- a/lisp/asciidoc/Readme.adoc
+++ /dev/null
@@ -1,3 +0,0 @@
-= Honeycomb translation layer SPI implementation for VPP's LISP APIs
-
-Provides customizers translating lisp.yang model into VPP's LISP API calls \ No newline at end of file
diff --git a/lisp/lisp2vpp/asciidoc/Readme.adoc b/lisp/lisp2vpp/asciidoc/Readme.adoc
deleted file mode 100644
index 88c43fd..0000000
--- a/lisp/lisp2vpp/asciidoc/Readme.adoc
+++ /dev/null
@@ -1,3 +0,0 @@
-= lisp2vpp
-
-Overview of lisp2vpp \ No newline at end of file
diff --git a/lisp/lisp2vpp/pom.xml b/lisp/lisp2vpp/pom.xml
deleted file mode 100755
index b612acc..0000000
--- a/lisp/lisp2vpp/pom.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>io.fd.honeycomb.vpp</groupId>
- <artifactId>vpp-impl-parent</artifactId>
- <version>1.16.12-SNAPSHOT</version>
- <relativePath>../../vpp-common/vpp-impl-parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>io.fd.honeycomb.lisp</groupId>
- <artifactId>lisp2vpp</artifactId>
- <name>${project.artifactId}</name>
- <version>1.16.12-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <properties>
- <project.vpp.groupId>io.fd.honeycomb.vpp</project.vpp.groupId>
- <project.honeycomb.groupId>io.fd.honeycomb</project.honeycomb.groupId>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>${project.honeycomb.groupId}</groupId>
- <artifactId>translate-spi</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.vpp.groupId}</groupId>
- <artifactId>vpp-translate-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>lisp-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.honeycomb.groupId}</groupId>
- <artifactId>translate-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.honeycomb.groupId}</groupId>
- <artifactId>cfg-init</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.vpp</groupId>
- <artifactId>jvpp-core</artifactId>
- </dependency>
-
- <!-- DI -->
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- </dependency>
- <dependency>
- <groupId>net.jmob</groupId>
- <artifactId>guice.conf</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-multibindings</artifactId>
- </dependency>
-
- <!-- Testing Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-testlib</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb.vpp</groupId>
- <artifactId>vpp-translate-test</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.fd.honeycomb.infra</groupId>
- <artifactId>test-tools</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/LispModule.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/LispModule.java
deleted file mode 100644
index db5557f..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/LispModule.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.honeycomb.lisp;
-
-
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.LOCAL_MAPPING_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.LOCATOR_SET_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.LOCATOR_SET_CONTEXT_PREFIX;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.REMOTE_MAPPING_CONTEXT;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Singleton;
-import com.google.inject.multibindings.Multibinder;
-import com.google.inject.name.Names;
-import io.fd.honeycomb.lisp.cfgattrs.LispConfiguration;
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.ContextsReaderFactoryProvider;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.factory.LispStateReaderFactory;
-import io.fd.honeycomb.lisp.translate.write.factory.LispWriterFactory;
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import net.jmob.guice.conf.core.ConfigurationModule;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LispModule extends AbstractModule {
-
- private static final Logger LOG = LoggerFactory.getLogger(LispModule.class);
-
- @Override
- protected void configure() {
- LOG.info("Configuring module Lisp");
- install(ConfigurationModule.create());
- requestInjection(LispConfiguration.class);
-
- LOG.info("Binding Naming context[{}]", LOCATOR_SET_CONTEXT);
- bind(NamingContext.class)
- .annotatedWith(Names.named(LOCATOR_SET_CONTEXT))
- .toInstance(new NamingContext(LOCATOR_SET_CONTEXT_PREFIX, LOCATOR_SET_CONTEXT));
-
- LOG.info("Binding Eid context[{}]", LOCAL_MAPPING_CONTEXT);
- bind(EidMappingContext.class)
- .annotatedWith(Names.named(LOCAL_MAPPING_CONTEXT))
- .toInstance(new EidMappingContext(LOCAL_MAPPING_CONTEXT));
-
- LOG.info("Binding Eid context[{}]", REMOTE_MAPPING_CONTEXT);
- bind(EidMappingContext.class)
- .annotatedWith(Names.named(REMOTE_MAPPING_CONTEXT))
- .toInstance(new EidMappingContext(REMOTE_MAPPING_CONTEXT));
-
- LOG.info("Binding Adjacencies context");
- bind(AdjacenciesMappingContext.class)
- .annotatedWith(Names.named(LispConfiguration.ADJACENCIES_IDENTIFICATION_CONTEXT))
- .toInstance(new AdjacenciesMappingContext(LispConfiguration.ADJACENCIES_IDENTIFICATION_CONTEXT));
-
- LOG.info("Binding reader factories");
- final Multibinder<ReaderFactory> readerFactoryBinder = Multibinder.newSetBinder(binder(), ReaderFactory.class);
- readerFactoryBinder.addBinding().to(LispStateReaderFactory.class);
- LOG.info("Reader factories binded");
-
- LOG.info("Binding writer factories");
- final Multibinder<WriterFactory> writerFactoryBinder = Multibinder.newSetBinder(binder(), WriterFactory.class);
- writerFactoryBinder.addBinding().to(LispWriterFactory.class);
- LOG.info("Writer factories binded");
-
- final Multibinder<ReaderFactory> readerBinder = Multibinder.newSetBinder(binder(), ReaderFactory.class);
- readerBinder.addBinding().toProvider(ContextsReaderFactoryProvider.class).in(Singleton.class);
-
- LOG.info("Module Lisp successfully configured");
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/cfgattrs/LispConfiguration.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/cfgattrs/LispConfiguration.java
deleted file mode 100644
index 177f650..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/cfgattrs/LispConfiguration.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.honeycomb.lisp.cfgattrs;
-
-import net.jmob.guice.conf.core.BindConfig;
-import net.jmob.guice.conf.core.Syntax;
-
-/**
- * Class containing static configuration for Lisp module,<br>
- * either loaded from property file or statically typed.
- */
-@BindConfig(value = "lisp", syntax = Syntax.JSON)
-public class LispConfiguration {
-
- //TODO HONEYCOMB-176 - this constant should be part of V3po plugin
- /**
- * Interface index to name mapping.
- */
- public static final String INTERFACE_CONTEXT = "interface-context";
-
- /**
- * Locator set index to name mapping.
- */
- public static final String LOCATOR_SET_CONTEXT = "locator-set-context";
-
- /**
- * Local mappings's eid to name mapping.
- */
- public static final String LOCAL_MAPPING_CONTEXT = "local-mapping-context";
-
- /**
- * Remote mappings's eid to name mapping.
- */
- public static final String REMOTE_MAPPING_CONTEXT = "remote-mapping-context";
-
- /**
- * Unique prefix for naming context of locator sets.
- **/
- public static final String LOCATOR_SET_CONTEXT_PREFIX = "locator-set-";
-
- /**
- * Adjacency id to eid pair mapping
- * */
- public static final String ADJACENCIES_IDENTIFICATION_CONTEXT = "adjacencies-identification-context";
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/AdjacenciesMappingContext.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/AdjacenciesMappingContext.java
deleted file mode 100644
index 557dc27..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/AdjacenciesMappingContext.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * 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.honeycomb.lisp.context.util;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.util.RWUtils;
-import java.util.stream.Collector;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.AdjacenciesIdentificationContexts;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentification;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentificationKey;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.Mappings;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.Mapping;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.MappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.MappingKey;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPair;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPairBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-
-public class AdjacenciesMappingContext {
-
- private static final Collector<Mapping, ?, Mapping> SINGLE_ITEM_COLLECTOR = RWUtils.singleItemCollector();
-
- private final KeyedInstanceIdentifier<AdjacenciesIdentification, AdjacenciesIdentificationKey>
- namingContextIid;
-
- /**
- * Create new naming context
- *
- * @param instanceName name of this context instance. Will be used as list item identifier within context data tree
- */
- public AdjacenciesMappingContext(@Nonnull final String instanceName) {
- namingContextIid = InstanceIdentifier.create(AdjacenciesIdentificationContexts.class).child(
- AdjacenciesIdentification.class, new AdjacenciesIdentificationKey(instanceName));
- }
-
- /**
- * Retrieve name for mapping stored provided mappingContext instance.
- *
- * @param localEidId {@code MappingId} for local eid
- * @param remoteEidId {@code MappingId} for remote eid
- * @param mappingContext mapping context providing context data for current transaction
- * @return name mapped to provided index
- */
- @Nonnull
- public synchronized String getAdjacencyId(
- @Nonnull final String localEidId,
- @Nonnull final String remoteEidId,
- @Nonnull final MappingContext mappingContext) {
-
- final Optional<Mappings> read = mappingContext.read(namingContextIid.child(Mappings.class));
- checkState(read.isPresent(), "No adjacencies mappings stored");
-
- return read.get().getMapping().stream()
- .filter(mapping -> isSame(pairForCombination(localEidId, remoteEidId), mapping))
- .collect(SINGLE_ITEM_COLLECTOR).getId();
- }
-
- private boolean isSame(final EidIdentificatorPair currentPair, final Mapping mapping) {
- // EidIdentificatorPair is container so it needs to be compared like this
- final EidIdentificatorPair mappingPair = mapping.getEidIdentificatorPair();
- return currentPair.getLocalEidId().equals(mappingPair.getLocalEidId())
- && currentPair.getRemoteEidId().equals(mappingPair.getRemoteEidId());
- }
-
- private EidIdentificatorPair pairForCombination(final @Nonnull String localEidId,
- final @Nonnull String remoteEidId) {
- return new EidIdentificatorPairBuilder()
- .setLocalEidId(new MappingId(localEidId))
- .setRemoteEidId(new MappingId(remoteEidId))
- .build();
- }
-
- /**
- * Check whether mapping is present for index.
- *
- * @param localEidId {@code MappingId} for local eid
- * @param remoteEidId {@code MappingId} for remote eid
- * @param mappingContext mapping context providing context data for current transaction
- * @return true if present, false otherwise
- */
- public synchronized boolean containsId(
- @Nonnull final String localEidId,
- @Nonnull final String remoteEidId,
- @Nonnull final MappingContext mappingContext) {
- final Optional<Mappings> read = mappingContext.read(namingContextIid.child(Mappings.class));
-
- return read.isPresent() &&
- read.get().getMapping()
- .stream()
- .anyMatch(mapping -> isSame(pairForCombination(localEidId, remoteEidId), mapping));
- }
-
- /**
- * Add mapping to current context
- *
- * @param index index of a mapped item
- * @param localEidId {@code MappingId} for local eid
- * @param remoteEidId {@code MappingId} for remote eid
- * @param mappingContext mapping context providing context data for current transaction
- */
- public synchronized void addEidPair(
- @Nonnull final String index,
- @Nonnull final String localEidId,
- @Nonnull final String remoteEidId,
- final MappingContext mappingContext) {
-
- final KeyedInstanceIdentifier<Mapping, MappingKey> mappingIid = getMappingIid(index);
- mappingContext.put(mappingIid, new MappingBuilder().setId(index).setEidIdentificatorPair(
- pairForCombination(localEidId, remoteEidId)).build());
- }
-
- private KeyedInstanceIdentifier<Mapping, MappingKey> getMappingIid(final String index) {
- return namingContextIid.child(Mappings.class).child(Mapping.class, new MappingKey(index));
- }
-
-
- /**
- * Remove mapping from current context
- *
- * @param index identificator of a mapped item
- * @param mappingContext mapping context providing context data for current transaction
- */
- public synchronized void removeForIndex(@Nonnull final String index, final MappingContext mappingContext) {
- mappingContext.delete(getMappingIid(index));
- }
-
- /**
- * Returns index value associated with the given name.
- *
- * @param index index whitch should value sits on
- * @param mappingContext mapping context providing context data for current transaction
- * @return integer index value matching supplied name
- * @throws IllegalArgumentException if name was not found
- */
- public synchronized EidIdentificatorPair getEidPair(@Nonnull final String index,
- final MappingContext mappingContext) {
- final Optional<Mapping> read = mappingContext.read(getMappingIid(index));
- checkArgument(read.isPresent(), "No mapping stored for index: %s", index);
- return read.get().getEidIdentificatorPair();
- }
-
- /**
- * Check whether mapping is present for name.
- *
- * @param index index of a mapped item
- * @param mappingContext mapping context providing context data for current transaction
- * @return true if present, false otherwise
- */
- public synchronized boolean containsEidPairForIndex(@Nonnull final String index,
- @Nonnull final MappingContext mappingContext) {
- return mappingContext.read(getMappingIid(index)).isPresent();
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/ContextsReaderFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/ContextsReaderFactory.java
deleted file mode 100644
index 29a5e3f..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/ContextsReaderFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.honeycomb.lisp.context.util;
-
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
-import io.fd.honeycomb.translate.util.read.BindingBrokerReader;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.Contexts;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.ContextsBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * {@link ReaderFactory} initiating reader providing data from context data store for eid's.
- * Making them available over RESTCONF/NETCONF.
- */
-public class ContextsReaderFactory implements ReaderFactory {
-
- private final DataBroker contextBindingBrokerDependency;
-
- public ContextsReaderFactory(final DataBroker contextBindingBrokerDependency) {
- this.contextBindingBrokerDependency = contextBindingBrokerDependency;
- }
-
- @Override
- public void init(final ModifiableReaderRegistryBuilder registry) {
- registry.add(new BindingBrokerReader<>(InstanceIdentifier.create(Contexts.class),
- contextBindingBrokerDependency,
- LogicalDatastoreType.OPERATIONAL, ContextsBuilder.class));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/ContextsReaderFactoryProvider.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/ContextsReaderFactoryProvider.java
deleted file mode 100644
index d023b3e..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/ContextsReaderFactoryProvider.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.honeycomb.lisp.context.util;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.name.Named;
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-
-
-public class ContextsReaderFactoryProvider implements Provider<ReaderFactory> {
-
- @Inject
- @Named("honeycomb-context")
- private DataBroker contextDataBroker;
-
- @Override
- public ReaderFactory get() {
- return new ContextsReaderFactory(contextDataBroker);
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/EidMappingContext.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/EidMappingContext.java
deleted file mode 100644
index 8f5dab7..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/context/util/EidMappingContext.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * 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.honeycomb.lisp.context.util;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.util.RWUtils;
-import java.util.stream.Collector;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.Contexts;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.EidMappingContextKey;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.Mappings;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.Mapping;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.MappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.MappingKey;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.EidBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility class allowing {@link MappingId} to {@link Eid} mapping
- */
-public class EidMappingContext implements EidTranslator {
-
- private static final Logger LOG = LoggerFactory.getLogger(EidMappingContext.class);
- private static final Collector<Mapping, ?, Mapping> SINGLE_ITEM_COLLECTOR = RWUtils.singleItemCollector();
-
- private final KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.EidMappingContext, EidMappingContextKey>
- namingContextIid;
-
- /**
- * Create new naming context
- *
- * @param instanceName name of this context instance. Will be used as list item identifier within context data tree
- */
- public EidMappingContext(@Nonnull final String instanceName) {
- namingContextIid = InstanceIdentifier.create(Contexts.class).child(
- org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.EidMappingContext.class,
- new EidMappingContextKey(instanceName));
- }
-
- /**
- * Retrieve name for mapping stored provided mappingContext instance.
- *
- * @param remoteEid eid of a mapped item
- * @param mappingContext mapping context providing context data for current transaction
- * @return name mapped to provided index
- */
- @Nonnull
- public synchronized MappingId getId(
- @Nonnull final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid remoteEid,
- @Nonnull final MappingContext mappingContext) {
-
- final Optional<Mappings> read = mappingContext.read(namingContextIid.child(Mappings.class));
- checkState(read.isPresent(), "Mapping for eid: %s is not present. But should be", remoteEid);
-
- return read.get().getMapping()
- .stream()
- //cannot split to map + filtering,because its collecting mappings,not eid's
- .filter(mapping -> compareEids(mapping.getEid(), remoteEid))
- .collect(SINGLE_ITEM_COLLECTOR).getId();
- }
-
- /**
- * Retrieve name for mapping stored provided mappingContext instance.
- *
- * @param eid eid of a mapped item
- * @param mappingContext mapping context providing context data for current transaction
- * @return name mapped to provided index
- */
- @Nonnull
- public synchronized MappingId getId(
- @Nonnull final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid eid,
- @Nonnull final MappingContext mappingContext) {
-
- final Optional<Mappings> read = mappingContext.read(namingContextIid.child(Mappings.class));
- //don't create artificial name as naming context, to not create reference to some artificial(in vpp non-existing)eid
- checkState(read.isPresent(), "Mapping for eid: %s is not present. But should be", eid);
-
- return read.get().getMapping().stream()
- .filter(mapping -> compareEids(mapping.getEid(), eid))
- .collect(SINGLE_ITEM_COLLECTOR).getId();
- }
-
- /**
- * Check whether mapping is present for index.
- *
- * @param eid eid of a mapped item
- * @param mappingContext mapping context providing context data for current transaction
- * @return true if present, false otherwise
- */
- public synchronized boolean containsId(
- @Nonnull final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid eid,
- @Nonnull final MappingContext mappingContext) {
- final Optional<Mappings> read = mappingContext.read(namingContextIid.child(Mappings.class));
-
- return read.isPresent() &&
- read.get().getMapping()
- .stream()
- .anyMatch(mapping -> compareEids(mapping.getEid(), eid));
- }
-
- /**
- * Check whether mapping is present for index.
- *
- * @param eid eid of a mapped item
- * @param mappingContext mapping context providing context data for current transaction
- * @return true if present, false otherwise
- */
- public synchronized boolean containsId(
- @Nonnull final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid eid,
- @Nonnull final MappingContext mappingContext) {
- final Optional<Mappings> read = mappingContext.read(namingContextIid.child(Mappings.class));
-
- return read.isPresent() &&
- read.get().getMapping()
- .stream()
- .anyMatch(mapping -> compareEids(mapping.getEid(), eid));
- }
-
-
- /**
- * Add mapping to current context
- *
- * @param index index of a mapped item
- * @param eid eid data
- * @param mappingContext mapping context providing context data for current transaction
- */
- public synchronized void addEid(
- @Nonnull final MappingId index,
- @Nonnull final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid eid,
- final MappingContext mappingContext) {
-
- final KeyedInstanceIdentifier<Mapping, MappingKey> mappingIid = getMappingIid(index);
- mappingContext.put(mappingIid, new MappingBuilder().setId(index).setEid(copyEid(eid)).build());
- }
-
- /**
- * Add mapping to current context
- *
- * @param index index of a mapped item
- * @param eid eid data
- * @param mappingContext mapping context providing context data for current transaction
- */
- public synchronized void addEid(
- @Nonnull final MappingId index,
- @Nonnull final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid eid,
- final MappingContext mappingContext) {
-
- final KeyedInstanceIdentifier<Mapping, MappingKey> mappingIid = getMappingIid(index);
- mappingContext.put(mappingIid, new MappingBuilder().setId(index).setEid(copyEid(eid)).build());
- }
-
- private KeyedInstanceIdentifier<Mapping, MappingKey> getMappingIid(final MappingId index) {
- return namingContextIid.child(Mappings.class).child(Mapping.class, new MappingKey(index));
- }
-
- private Eid copyEid(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid eid) {
- return new EidBuilder().setAddress(eid.getAddress()).setAddressType(eid.getAddressType())
- .setVirtualNetworkId(eid.getVirtualNetworkId()).build();
- }
-
- private Eid copyEid(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid eid) {
- return new EidBuilder().setAddress(eid.getAddress()).setAddressType(eid.getAddressType())
- .setVirtualNetworkId(eid.getVirtualNetworkId()).build();
- }
-
- /**
- * Remove mapping from current context
- *
- * @param index identificator of a mapped item
- * @param mappingContext mapping context providing context data for current transaction
- */
- public synchronized void removeEid(@Nonnull final MappingId index, final MappingContext mappingContext) {
- mappingContext.delete(getMappingIid(index));
- }
-
- /**
- * Returns index value associated with the given name.
- *
- * @param index index whitch should value sits on
- * @param mappingContext mapping context providing context data for current transaction
- * @return integer index value matching supplied name
- * @throws IllegalArgumentException if name was not found
- */
- public synchronized Eid getEid(@Nonnull final MappingId index, final MappingContext mappingContext) {
- final Optional<Mapping> read = mappingContext.read(getMappingIid(index));
- checkArgument(read.isPresent(), "No mapping stored for index: %s", index);
- return read.get().getEid();
- }
-
- /**
- * Check whether mapping is present for name.
- *
- * @param index index of a mapped item
- * @param mappingContext mapping context providing context data for current transaction
- * @return true if present, false otherwise
- */
- public synchronized boolean containsEid(@Nonnull final MappingId index,
- @Nonnull final MappingContext mappingContext) {
- return mappingContext.read(getMappingIid(index)).isPresent();
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/AdjacencyCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/AdjacencyCustomizer.java
deleted file mode 100755
index d7003c8..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/AdjacencyCustomizer.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
-import io.fd.honeycomb.translate.util.RWUtils;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.core.dto.LispAdjacenciesGet;
-import io.fd.vpp.jvpp.core.dto.LispAdjacenciesGetReply;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import io.fd.vpp.jvpp.core.types.LispAdjacency;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPair;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPairBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.AdjacenciesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.Adjacency;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class AdjacencyCustomizer extends FutureJVppCustomizer
- implements ListReaderCustomizer<Adjacency, AdjacencyKey, AdjacencyBuilder>, JvppReplyConsumer, EidTranslator {
-
- private final DumpCacheManager<LispAdjacenciesGetReply, AdjacencyDumpParams> dumpCacheManager;
- private final AdjacenciesMappingContext adjacenciesMappingContext;
- private final EidPairProducer eidPairProducer;
-
-
- public AdjacencyCustomizer(@Nonnull final FutureJVppCore futureJvpp,
- @Nonnull final EidMappingContext localMappingContext,
- @Nonnull final EidMappingContext remoteMappingContext,
- @Nonnull final AdjacenciesMappingContext adjacenciesMappingContext) {
- super(futureJvpp);
- dumpCacheManager = new DumpCacheManager.DumpCacheManagerBuilder<LispAdjacenciesGetReply, AdjacencyDumpParams>()
- .withExecutor(createExecutor())
- .build();
-
- this.adjacenciesMappingContext =
- checkNotNull(adjacenciesMappingContext, "Adjacencies mapping context cannot be null");
- this.eidPairProducer = new EidPairProducer(localMappingContext, remoteMappingContext);
- }
-
- @Nonnull
- @Override
- public List<AdjacencyKey> getAllIds(@Nonnull final InstanceIdentifier<Adjacency> id,
- @Nonnull final ReadContext context) throws ReadFailedException {
-
- final int vni = id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier().intValue();
-
- final Optional<LispAdjacenciesGetReply> optionalDump =
- dumpCacheManager.getDump(id, context.getModificationCache(), new AdjacencyDumpParams(vni));
-
-
- if (optionalDump.isPresent()) {
- return Arrays.stream(optionalDump.get().adjacencies)
- .map(lispAdjacency -> eidPairProducer.createPair(lispAdjacency, vni, context.getMappingContext()))
- .map(pair -> adjacenciesMappingContext
- .getAdjacencyId(pair.getLocalEidId().getValue(), pair.getRemoteEidId().getValue(),
- context.getMappingContext()))
- .map(AdjacencyKey::new)
- .collect(Collectors.toList());
- }
-
- //does not throw exception to not disturb lisp state reading
- return Collections.emptyList();
- }
-
- @Override
- public void merge(@Nonnull final Builder<? extends DataObject> builder, @Nonnull final List<Adjacency> readData) {
- ((AdjacenciesBuilder) builder).setAdjacency(readData);
- }
-
- @Nonnull
- @Override
- public AdjacencyBuilder getBuilder(@Nonnull final InstanceIdentifier<Adjacency> id) {
- return new AdjacencyBuilder();
- }
-
- @Override
- public void readCurrentAttributes(@Nonnull final InstanceIdentifier<Adjacency> id,
- @Nonnull final AdjacencyBuilder builder, @Nonnull final ReadContext ctx)
- throws ReadFailedException {
-
- final int vni = id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier().intValue();
-
- final Optional<LispAdjacenciesGetReply> optionalDump = dumpCacheManager
- .getDump(id, ctx.getModificationCache(), new AdjacencyDumpParams(vni));
-
- if (!optionalDump.isPresent() || optionalDump.get().adjacencies.length == 0) {
- return;
- }
-
- final String currentAdjacencyId = id.firstKeyOf(Adjacency.class).getId();
- final EidIdentificatorPair currentAdjacencyIdentificationPair =
- adjacenciesMappingContext.getEidPair(currentAdjacencyId, ctx.getMappingContext());
-
- final LispAdjacency currentAdjacency = Arrays.stream(optionalDump.get().adjacencies)
- .filter(lispAdjacency -> Objects.equals(currentAdjacencyIdentificationPair,
- eidPairProducer.createPair(lispAdjacency, vni, ctx.getMappingContext())))
- .collect(RWUtils.singleItemCollector());
-
- builder.setId(currentAdjacencyId)
- .setKey(new AdjacencyKey(currentAdjacencyId))
- .setLocalEid(getArrayAsLocalEid(
- MappingsDumpParams.EidType.valueOf(currentAdjacency.eidType), currentAdjacency.leid, vni))
- .setRemoteEid(getArrayAsRemoteEid(
- MappingsDumpParams.EidType.valueOf(currentAdjacency.eidType), currentAdjacency.reid, vni));
- }
-
- private EntityDumpExecutor<LispAdjacenciesGetReply, AdjacencyDumpParams> createExecutor() {
- return (final InstanceIdentifier<?> identifier, final AdjacencyDumpParams params) -> {
- checkNotNull(params, "Dump parameters cannot be null");
-
- final LispAdjacenciesGet request = new LispAdjacenciesGet();
- request.vni = params.getVni();
-
- return getReplyForRead(getFutureJVpp().lispAdjacenciesGet(request).toCompletableFuture(), identifier);
- };
- }
-
- private class EidPairProducer implements EidTranslator {
-
- private final EidMappingContext localMappingContext;
- private final EidMappingContext remoteMappingContext;
-
- public EidPairProducer(final EidMappingContext localMappingContext,
- final EidMappingContext remoteMappingContext) {
- this.localMappingContext = checkNotNull(localMappingContext, "Local mapping context cannot be null");
- this.remoteMappingContext = checkNotNull(remoteMappingContext, "Remote mapping context cannot be null");
- }
-
- public EidIdentificatorPair createPair(final LispAdjacency data, final int vni,
- final MappingContext mappingContext) {
- return new EidIdentificatorPairBuilder()
- .setLocalEidId(new MappingId(localMappingContext.getId(getArrayAsEidLocal(
- MappingsDumpParams.EidType.valueOf(data.eidType), data.leid, vni), mappingContext)))
- .setRemoteEidId(new MappingId(remoteMappingContext.getId(getArrayAsEidLocal(
- MappingsDumpParams.EidType.valueOf(data.eidType), data.reid, vni), mappingContext)))
- .build();
- }
- }
-
- private static final class AdjacencyDumpParams {
-
- private final int vni;
-
- AdjacencyDumpParams(final int vni) {
- this.vni = vni;
- }
-
- public int getVni() {
- return this.vni;
- }
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/BridgeDomainSubtableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/BridgeDomainSubtableCustomizer.java
deleted file mode 100644
index 1d0d8a0..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/BridgeDomainSubtableCustomizer.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams;
-import io.fd.honeycomb.lisp.translate.read.trait.SubtableReader;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManagerBuilder;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetailsReplyDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtableBuilder;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BridgeDomainSubtableCustomizer extends FutureJVppCustomizer implements
- ReaderCustomizer<BridgeDomainSubtable, BridgeDomainSubtableBuilder>, SubtableReader {
-
- private static final Logger LOG = LoggerFactory.getLogger(BridgeDomainSubtableCustomizer.class);
-
- private final DumpCacheManager<LispEidTableMapDetailsReplyDump, SubtableDumpParams>
- dumpManager;
- private final NamingContext bridgeDomainContext;
-
- public BridgeDomainSubtableCustomizer(@Nonnull final FutureJVppCore futureJvppCore,
- @Nonnull final NamingContext bridgeDomainContext) {
- super(futureJvppCore);
- dumpManager =
- new DumpCacheManagerBuilder<LispEidTableMapDetailsReplyDump, SubtableDumpParams>()
- .withExecutor(createExecutor(futureJvppCore))
- .build();
- this.bridgeDomainContext = checkNotNull(bridgeDomainContext, "Bridge domain context cannot be null");
- }
-
- @Nonnull
- @Override
- public BridgeDomainSubtableBuilder getBuilder(@Nonnull final InstanceIdentifier<BridgeDomainSubtable> id) {
- return new BridgeDomainSubtableBuilder();
- }
-
- @Override
- public void readCurrentAttributes(@Nonnull final InstanceIdentifier<BridgeDomainSubtable> id,
- @Nonnull final BridgeDomainSubtableBuilder builder,
- @Nonnull final ReadContext ctx) throws ReadFailedException {
- final int vni = checkNotNull(id.firstKeyOf(VniTable.class), "Cannot find parent VNI Table")
- .getVirtualNetworkIdentifier().intValue();
- LOG.debug("Read attributes for id {}", id);
- //dumps only L2(bridge domains)
- final Optional<LispEidTableMapDetailsReplyDump> reply =
- dumpManager.getDump(id, ctx.getModificationCache(), L2_PARAMS);
-
- if (!reply.isPresent() || reply.get().lispEidTableMapDetails.isEmpty()) {
- return;
- }
-
- // Single item collector cant be used in this case,because bridge-domain-subtable is container
- // so read is invoked every time parent is defined
- final List<LispEidTableMapDetails>
- details = reply.get().lispEidTableMapDetails.stream().filter(a -> a.vni == vni)
- .collect(Collectors.toList());
- if (details.size() == 1) {
- final LispEidTableMapDetails detail = details.get(0);
- builder.setBridgeDomainRef(bridgeDomainContext.getName(detail.dpTable, ctx.getMappingContext()));
- LOG.debug("Attributes for {} successfully loaded", id);
- }
- }
-
- @Override
- public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder,
- @Nonnull final BridgeDomainSubtable readValue) {
- ((VniTableBuilder) parentBuilder).setBridgeDomainSubtable(readValue);
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java
deleted file mode 100755
index 7291afb..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizer.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.LocatorDumpParams;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.LocatorDumpParams.LocatorDumpParamsBuilder;
-import io.fd.honeycomb.lisp.translate.read.trait.LocatorReader;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
-import io.fd.honeycomb.translate.util.RWUtils;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetails;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetailsReplyDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.Interface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.InterfaceBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.InterfaceKey;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-/**
- * Customizer for reading {@code Interface}<br> Currently not supported by jvpp
- */
-public class InterfaceCustomizer
- extends FutureJVppCustomizer
- implements ListReaderCustomizer<Interface, InterfaceKey, InterfaceBuilder>, LocatorReader {
-
- private final NamingContext interfaceContext;
- private final NamingContext locatorSetContext;
- private final DumpCacheManager<LispLocatorDetailsReplyDump, LocatorDumpParams> dumpCacheManager;
-
- public InterfaceCustomizer(@Nonnull final FutureJVppCore futureJvpp, @Nonnull final NamingContext interfaceContext,
- @Nonnull final NamingContext locatorSetContext) {
- super(futureJvpp);
- this.interfaceContext = checkNotNull(interfaceContext, "Interface context cannot be null");
- this.locatorSetContext = checkNotNull(locatorSetContext, "Locator set context cannot be null");
- this.dumpCacheManager =
- new DumpCacheManager.DumpCacheManagerBuilder<LispLocatorDetailsReplyDump, LocatorDumpParams>()
- .withExecutor(createLocatorDumpExecutor(futureJvpp))
- .build();
- }
-
- @Override
- public InterfaceBuilder getBuilder(InstanceIdentifier<Interface> id) {
- return new InterfaceBuilder();
- }
-
- @Override
- public void readCurrentAttributes(InstanceIdentifier<Interface> id, InterfaceBuilder builder, ReadContext ctx)
- throws ReadFailedException {
-
- final String locatorSetName = id.firstKeyOf(LocatorSet.class).getName();
- final String referencedInterfaceName = id.firstKeyOf(Interface.class).getInterfaceRef();
-
- checkState(interfaceContext.containsIndex(referencedInterfaceName, ctx.getMappingContext()),
- "No interface mapping for name %s", referencedInterfaceName);
- checkState(locatorSetContext.containsIndex(locatorSetName, ctx.getMappingContext()),
- "No locator set mapping for name %s", locatorSetName);
-
- final int locatorSetIndexIndex = locatorSetContext.getIndex(locatorSetName, ctx.getMappingContext());
- final int referencedInterfaceIndex =
- interfaceContext.getIndex(referencedInterfaceName, ctx.getMappingContext());
-
- final LocatorDumpParams params =
- new LocatorDumpParamsBuilder().setLocatorSetIndex(locatorSetIndexIndex).build();
-
- final Optional<LispLocatorDetailsReplyDump> reply =
- dumpCacheManager.getDump(id, ctx.getModificationCache(), params);
-
- if (!reply.isPresent() || reply.get().lispLocatorDetails.isEmpty()) {
- return;
- }
-
- final LispLocatorDetails details = reply.get()
- .lispLocatorDetails
- .stream()
- .filter(a -> a.swIfIndex == referencedInterfaceIndex)
- .collect(RWUtils.singleItemCollector());
-
- final String interfaceRef = interfaceContext.getName(details.swIfIndex, ctx.getMappingContext());
-
- builder.setPriority(Byte.valueOf(details.priority).shortValue());
- builder.setWeight(Byte.valueOf(details.weight).shortValue());
- builder.setInterfaceRef(interfaceRef);
- builder.setKey(new InterfaceKey(interfaceRef));
- }
-
- @Override
- public List<InterfaceKey> getAllIds(InstanceIdentifier<Interface> id, ReadContext context)
- throws ReadFailedException {
-
- checkState(id.firstKeyOf(LocatorSet.class) != null, "Cannot find reference to parent locator set");
- final String name = id.firstKeyOf(LocatorSet.class).getName();
-
- checkState(locatorSetContext.containsIndex(name, context.getMappingContext()), "No mapping for %s", name);
- final LocatorDumpParams params = new LocatorDumpParamsBuilder()
- .setLocatorSetIndex(locatorSetContext.getIndex(name, context.getMappingContext())).build();
-
- final Optional<LispLocatorDetailsReplyDump> reply =
- dumpCacheManager.getDump(id, context.getModificationCache(), params);
-
- if (!reply.isPresent() || reply.get().lispLocatorDetails.isEmpty()) {
- return Collections.emptyList();
- }
-
- return reply.get()
- .lispLocatorDetails
- .stream()
- .map(a -> new InterfaceKey(interfaceContext.getName(a.swIfIndex, context.getMappingContext())))
- .collect(Collectors.toList());
- }
-
- @Override
- public void merge(Builder<? extends DataObject> builder, List<Interface> readData) {
- ((LocatorSetBuilder) builder).setInterface(readData);
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java
deleted file mode 100644
index 8e8fd58..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManagerBuilder;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.core.dto.LispGetMapRequestItrRlocs;
-import io.fd.vpp.jvpp.core.dto.LispGetMapRequestItrRlocsReply;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.itr.remote.locator.sets.grouping.ItrRemoteLocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.itr.remote.locator.sets.grouping.ItrRemoteLocatorSetBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureDataBuilder;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class ItrRemoteLocatorSetCustomizer extends FutureJVppCustomizer
- implements ReaderCustomizer<ItrRemoteLocatorSet, ItrRemoteLocatorSetBuilder>, ByteDataTranslator,
- JvppReplyConsumer {
-
- private final DumpCacheManager<LispGetMapRequestItrRlocsReply, Void> dumpCacheManager;
-
- public ItrRemoteLocatorSetCustomizer(@Nonnull final FutureJVppCore futureJVppCore) {
- super(futureJVppCore);
- dumpCacheManager = new DumpCacheManagerBuilder<LispGetMapRequestItrRlocsReply, Void>()
- .withExecutor(((identifier, params) -> getReplyForRead(
- futureJVppCore.lispGetMapRequestItrRlocs(new LispGetMapRequestItrRlocs()).toCompletableFuture(),
- identifier)))
- .build();
- }
-
- @Nonnull
- @Override
- public ItrRemoteLocatorSetBuilder getBuilder(@Nonnull final InstanceIdentifier<ItrRemoteLocatorSet> id) {
- return new ItrRemoteLocatorSetBuilder();
- }
-
- @Override
- public void readCurrentAttributes(@Nonnull final InstanceIdentifier<ItrRemoteLocatorSet> id,
- @Nonnull final ItrRemoteLocatorSetBuilder builder, @Nonnull final ReadContext ctx)
- throws ReadFailedException {
-
- final Optional<LispGetMapRequestItrRlocsReply> reply =
- dumpCacheManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
- if (!reply.isPresent() || reply.get().locatorSetName == null) {
- return;
- }
-
- builder.setRemoteLocatorSetName(toString(reply.get().locatorSetName));
- }
-
- @Override
- public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder,
- @Nonnull final ItrRemoteLocatorSet readValue) {
- ((LispFeatureDataBuilder) parentBuilder).setItrRemoteLocatorSet(readValue);
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LispStateCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LispStateCustomizer.java
deleted file mode 100755
index 77374f9..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LispStateCustomizer.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.Initialized;
-import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.ShowLispStatus;
-import io.fd.vpp.jvpp.core.dto.ShowLispStatusReply;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.Lisp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispStateBuilder;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Customizer that handles reads of {@code LispState}
- */
-public class LispStateCustomizer extends FutureJVppCustomizer
- implements InitializingReaderCustomizer<LispState, LispStateBuilder>, JvppReplyConsumer, ByteDataTranslator {
-
- private static final Logger LOG = LoggerFactory.getLogger(LispStateCustomizer.class);
-
- public LispStateCustomizer(FutureJVppCore futureJvpp) {
- super(futureJvpp);
- }
-
- @Override
- public LispStateBuilder getBuilder(InstanceIdentifier<LispState> id) {
- return new LispStateBuilder();
- }
-
- @Override
- public void readCurrentAttributes(InstanceIdentifier<LispState> id, LispStateBuilder builder, ReadContext ctx)
- throws ReadFailedException {
-
- ShowLispStatusReply reply;
- try {
- reply = getReply(getFutureJVpp().showLispStatus(new ShowLispStatus()).toCompletableFuture());
- } catch (TimeoutException | VppBaseCallException e) {
- throw new ReadFailedException(id, e);
- }
-
- builder.setEnable(byteToBoolean(reply.featureStatus));
- }
-
- @Override
- public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder, @Nonnull final LispState readValue) {
- LOG.warn("Merge is unsupported for data roots");
- }
-
- @Override
- public Initialized<Lisp> init(
- @Nonnull final InstanceIdentifier<LispState> id, @Nonnull final LispState readValue,
- @Nonnull final ReadContext ctx) {
- return Initialized.create(InstanceIdentifier.create(Lisp.class),
-
- // set everything from LispState to LispBuilder
- // this is necessary in cases, when HC connects to a running VPP with some LISP configuration. HC needs to
- // reconstruct configuration based on what's present in VPP in order to support subsequent configuration changes
- // without any issues
-
- // the other reason this should work is HC persistence, so that HC after restart only performs diff (only push
- // configuration that is not currently in VPP, but is persisted. If they are equal skip any VPP calls)
- // updates to VPP. If this is not fully implemented (depending on VPP implementation, restoration of persisted
- // configuration can fail)
- new LispBuilder()
- .setEnable(readValue.isEnable())
- .setLispFeatureData(readValue.getLispFeatureData())
- .build());
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LocalMappingCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LocalMappingCustomizer.java
deleted file mode 100755
index e989a39..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LocalMappingCustomizer.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.valueOf;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.FilterType;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.MappingsDumpParamsBuilder;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.QuantityType;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams;
-import io.fd.honeycomb.lisp.translate.read.trait.MappingReader;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
-import io.fd.honeycomb.translate.util.RWUtils;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.LocalMappingsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMappingKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Customizer for reading {@code LocalMapping}<br> Currently unsupported by jvpp
- */
-public class LocalMappingCustomizer
- extends FutureJVppCustomizer
- implements ListReaderCustomizer<LocalMapping, LocalMappingKey, LocalMappingBuilder>, EidTranslator,
- MappingReader {
-
- private static final Logger LOG = LoggerFactory.getLogger(LocalMappingCustomizer.class);
-
- private final DumpCacheManager<LispEidTableDetailsReplyDump, MappingsDumpParams> dumpManager;
- private final NamingContext locatorSetContext;
- private final EidMappingContext localMappingContext;
-
- public LocalMappingCustomizer(@Nonnull FutureJVppCore futureJvpp, @Nonnull NamingContext locatorSetContext,
- @Nonnull EidMappingContext localMappingsContext) {
- super(futureJvpp);
- this.locatorSetContext = checkNotNull(locatorSetContext, "Locator Set Mapping Context cannot be null");
- this.localMappingContext = checkNotNull(localMappingsContext, "Local mappings context cannot be null");
- this.dumpManager =
- new DumpCacheManager.DumpCacheManagerBuilder<LispEidTableDetailsReplyDump, MappingsDumpParams>()
- .withExecutor(createMappingDumpExecutor(futureJvpp))
- .build();
- }
-
- @Override
- public LocalMappingBuilder getBuilder(InstanceIdentifier<LocalMapping> id) {
- return new LocalMappingBuilder();
- }
-
- @Override
- public void readCurrentAttributes(InstanceIdentifier<LocalMapping> id, LocalMappingBuilder builder,
- ReadContext ctx) throws ReadFailedException {
- checkState(id.firstKeyOf(LocalMapping.class) != null, "No key present for id({})", id);
- checkState(id.firstKeyOf(VniTable.class) != null, "Parent VNI table not specified");
-
- //checks whether there is an existing mapping
- final MappingId mappingId = id.firstKeyOf(LocalMapping.class).getId();
- checkState(localMappingContext.containsEid(mappingId, ctx.getMappingContext()));
-
- final long vni = id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier();
-
- final String localMappingId = id.firstKeyOf(LocalMapping.class).getId().getValue();
- final Eid eid = localMappingContext.getEid(mappingId, ctx.getMappingContext());
-
- //Requesting for specific mapping dump,only from local mappings with specified eid/vni/eid type
- final MappingsDumpParams dumpParams = new MappingsDumpParams.MappingsDumpParamsBuilder()
- .setEidSet(QuantityType.SPECIFIC)
- .setVni(Long.valueOf(vni).intValue())
- .setEid(getEidAsByteArray(eid))
- .setEidType(getEidType(eid))
- .setPrefixLength(getPrefixLength(eid))
- .build();
-
- LOG.debug("Dumping data for LocalMappings(id={})", id);
- final Optional<LispEidTableDetailsReplyDump> replyOptional =
- dumpManager.getDump(id, ctx.getModificationCache(), dumpParams);
-
- if (!replyOptional.isPresent() || replyOptional.get().lispEidTableDetails.isEmpty()) {
- return;
- }
-
- LispEidTableDetails details = replyOptional.get().lispEidTableDetails.stream()
- .filter(subtableFilterForLocalMappings(id))
- .filter(detail -> compareAddresses(eid.getAddress(), getAddressFromDumpDetail(detail)))
- .collect(RWUtils.singleItemCollector());
-
- //in case of local mappings,locator_set_index stands for interface index
- checkState(locatorSetContext.containsName(details.locatorSetIndex, ctx.getMappingContext()),
- "No Locator Set name found for index %s", details.locatorSetIndex);
- builder.setLocatorSet(locatorSetContext.getName(details.locatorSetIndex, ctx.getMappingContext()));
- builder.setKey(new LocalMappingKey(new MappingId(id.firstKeyOf(LocalMapping.class).getId())));
- builder.setEid(getArrayAsEidLocal(valueOf(details.eidType), details.eid, details.vni));
- }
-
- private Address getAddressFromDumpDetail(final LispEidTableDetails detail) {
- return getArrayAsEidLocal(valueOf(detail.eidType), detail.eid, detail.vni).getAddress();
- }
-
- @Override
- public List<LocalMappingKey> getAllIds(InstanceIdentifier<LocalMapping> id, ReadContext context)
- throws ReadFailedException {
-
- checkState(id.firstKeyOf(VniTable.class) != null, "Parent VNI table not specified");
- final long vni = id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier();
-
- if (vni == 0) {
- // ignoring default vni mapping
- // its not relevant for us and we also don't store mapping for such eid's
- // such mapping is used to create helper local mappings to process remote ones
- return Collections.emptyList();
- }
-
- //request for all local mappings
- final MappingsDumpParams dumpParams = new MappingsDumpParamsBuilder()
- .setFilter(FilterType.LOCAL)
- .setEidSet(QuantityType.ALL)
- .build();
-
- LOG.debug("Dumping data for LocalMappings(id={})", id);
- final Optional<LispEidTableDetailsReplyDump> replyOptional =
- dumpManager.getDump(id, context.getModificationCache(), dumpParams);
-
- if (!replyOptional.isPresent() || replyOptional.get().lispEidTableDetails.isEmpty()) {
- return Collections.emptyList();
- }
-
-
- return replyOptional.get().lispEidTableDetails.stream()
- .filter(a -> a.vni == vni)
- .filter(subtableFilterForLocalMappings(id))
- .map(detail -> getArrayAsEidLocal(valueOf(detail.eidType), detail.eid, detail.vni))
- .map(localEid -> localMappingContext.getId(localEid, context.getMappingContext()))
- .map(MappingId::new)
- .map(LocalMappingKey::new)
- .collect(Collectors.toList());
- }
-
- @Override
- public void merge(Builder<? extends DataObject> builder, List<LocalMapping> readData) {
- ((LocalMappingsBuilder) builder).setLocalMapping(readData);
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LocatorSetCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LocatorSetCustomizer.java
deleted file mode 100755
index ff0855a..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/LocatorSetCustomizer.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.lisp.translate.read.trait.LocatorSetReader;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetails;
-import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetailsReplyDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.LocatorSetsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetKey;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LocatorSetCustomizer extends FutureJVppCustomizer
- implements ListReaderCustomizer<LocatorSet, LocatorSetKey, LocatorSetBuilder>, ByteDataTranslator,
- LocatorSetReader {
-
- private static final Logger LOG = LoggerFactory.getLogger(LocatorSetCustomizer.class);
-
- private final DumpCacheManager<LispLocatorSetDetailsReplyDump, Void> dumpManager;
- private final NamingContext locatorSetContext;
-
- public LocatorSetCustomizer(@Nonnull final FutureJVppCore futureJvpp,
- @Nonnull final NamingContext locatorSetContext) {
- super(futureJvpp);
- this.locatorSetContext = checkNotNull(locatorSetContext, "Locator Set mapping context cannot be null");
- this.dumpManager = new DumpCacheManager.DumpCacheManagerBuilder<LispLocatorSetDetailsReplyDump, Void>()
- .withExecutor(createExecutor(futureJvpp))
- .build();
- }
-
- @Override
- public LocatorSetBuilder getBuilder(InstanceIdentifier<LocatorSet> id) {
- return new LocatorSetBuilder();
- }
-
- @Override
- public void readCurrentAttributes(InstanceIdentifier<LocatorSet> id, LocatorSetBuilder builder, ReadContext ctx)
- throws ReadFailedException {
- LOG.debug("Reading attributes for Locator Set {}", id);
-
- final Optional<LispLocatorSetDetailsReplyDump> dumpOptional =
- dumpManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
-
- if (!dumpOptional.isPresent() || dumpOptional.get().lispLocatorSetDetails.isEmpty()) {
- return;
- }
-
- String keyName = id.firstKeyOf(LocatorSet.class).getName();
- LispLocatorSetDetailsReplyDump dump = dumpOptional.get();
-
- java.util.Optional<LispLocatorSetDetails> details = dump.lispLocatorSetDetails.stream()
- .filter(n -> keyName.equals(toString(n.lsName)))
- .findFirst();
-
- if (details.isPresent()) {
- final String name = toString(details.get().lsName);
-
- builder.setName(name);
- builder.setKey(new LocatorSetKey(name));
- } else {
- LOG.warn("Locator Set {} not found in dump", id);
- }
- }
-
- @Override
- public List<LocatorSetKey> getAllIds(InstanceIdentifier<LocatorSet> id, ReadContext context)
- throws ReadFailedException {
- LOG.debug("Dumping Locator Set {}", id);
-
- final Optional<LispLocatorSetDetailsReplyDump> dumpOptional =
- dumpManager.getDump(id, context.getModificationCache(), NO_PARAMS);
-
- if (!dumpOptional.isPresent() || dumpOptional.get().lispLocatorSetDetails.isEmpty()) {
- return Collections.emptyList();
- }
-
- return dumpOptional.get().lispLocatorSetDetails.stream()
- .map(set -> {
-
- final String locatorSetName = toString(set.lsName);
- //creates mapping for existing locator-set(if it is'nt already existing one)
- if (!locatorSetContext.containsIndex(locatorSetName, context.getMappingContext())) {
- locatorSetContext.addName(set.lsIndex, locatorSetName, context.getMappingContext());
- }
-
- LOG.trace("Locator Set with name: {}, VPP name: {} and index: {} found in VPP",
- locatorSetContext.getName(set.lsIndex, context.getMappingContext()),
- locatorSetName,
- set.lsIndex);
-
- return set;
- })
- .map(set -> new LocatorSetKey(toString(set.lsName)))
- .collect(Collectors.toList());
- }
-
- @Override
- public void merge(Builder<? extends DataObject> builder, List<LocatorSet> readData) {
- ((LocatorSetsBuilder) builder).setLocatorSet(readData);
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/MapResolverCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/MapResolverCustomizer.java
deleted file mode 100755
index fb44e13..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/MapResolverCustomizer.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
-import io.fd.honeycomb.translate.util.RWUtils;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.vpp.util.AddressTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.core.dto.LispMapResolverDetails;
-import io.fd.vpp.jvpp.core.dto.LispMapResolverDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispMapResolverDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.MapResolversBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolver;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolverBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolverKey;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MapResolverCustomizer extends FutureJVppCustomizer
- implements ListReaderCustomizer<MapResolver, MapResolverKey, MapResolverBuilder>, AddressTranslator,
- JvppReplyConsumer {
-
- private static final Logger LOG = LoggerFactory.getLogger(MapResolverCustomizer.class);
-
- private final DumpCacheManager<LispMapResolverDetailsReplyDump, Void> dumpManager;
-
- public MapResolverCustomizer(FutureJVppCore futureJvpp) {
- super(futureJvpp);
- this.dumpManager =
- new DumpCacheManager.DumpCacheManagerBuilder<LispMapResolverDetailsReplyDump, Void>()
- .withExecutor((identifier, params) -> getReplyForRead(
- futureJvpp.lispMapResolverDump(new LispMapResolverDump()).toCompletableFuture(),
- identifier))
- .build();
- }
-
- @Override
- public MapResolverBuilder getBuilder(InstanceIdentifier<MapResolver> id) {
- return new MapResolverBuilder();
- }
-
- @Override
- public void readCurrentAttributes(InstanceIdentifier<MapResolver> id, MapResolverBuilder builder, ReadContext ctx)
- throws ReadFailedException {
- LOG.debug("Reading attributes...");
-
- final Optional<LispMapResolverDetailsReplyDump> dumpOptional =
- dumpManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
-
- if (!dumpOptional.isPresent() || dumpOptional.get().lispMapResolverDetails.isEmpty()) {
- LOG.warn("No data dumped");
- return;
- }
-
- final MapResolverKey key = id.firstKeyOf(MapResolver.class);
- final LispMapResolverDetails mapResolverDetails =
- dumpOptional.get().lispMapResolverDetails.stream()
- .filter(a -> addressesEqual(key.getIpAddress(),
- arrayToIpAddressReversed(byteToBoolean(a.isIpv6), a.ipAddress)))
- .collect(RWUtils.singleItemCollector());
-
- builder.setKey(key);
- builder.setIpAddress(
- arrayToIpAddress(byteToBoolean(mapResolverDetails.isIpv6), mapResolverDetails.ipAddress));
- }
-
- // safest way to compare addresses - prevents returning false while using different types from hierarchy
- // Ex. Key for MapResolver contains Ipv4Address as value but we translate addresses from binary data to Ipv4AddressNoZone
- private boolean addressesEqual(final IpAddress left, final IpAddress right) {
- return Arrays.equals(left.getValue(), right.getValue());
- }
-
- @Override
- public List<MapResolverKey> getAllIds(InstanceIdentifier<MapResolver> id, ReadContext context)
- throws ReadFailedException {
- LOG.debug("Dumping MapResolver...");
-
- final Optional<LispMapResolverDetailsReplyDump> dumpOptional =
- dumpManager.getDump(id, context.getModificationCache(), NO_PARAMS);
-
- if (!dumpOptional.isPresent() || dumpOptional.get().lispMapResolverDetails.isEmpty()) {
- return Collections.emptyList();
- }
-
- return dumpOptional.get().lispMapResolverDetails.stream()
- .map(resolver -> new MapResolverKey(
- arrayToIpAddressReversed(byteToBoolean(resolver.isIpv6), resolver.ipAddress)))
- .collect(Collectors.toList());
- }
-
- @Override
- public void merge(Builder<? extends DataObject> builder, List<MapResolver> readData) {
- ((MapResolversBuilder) builder).setMapResolver(readData);
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/PitrCfgCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/PitrCfgCustomizer.java
deleted file mode 100755
index 7b049c0..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/PitrCfgCustomizer.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import java.util.concurrent.TimeoutException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.pitr.cfg.grouping.PitrCfg;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.pitr.cfg.grouping.PitrCfgBuilder;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.ShowLispPitr;
-import io.fd.vpp.jvpp.core.dto.ShowLispPitrReply;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Customizer for reading {@link PitrCfg}<br> Currently unsupported in jvpp
- */
-public class PitrCfgCustomizer extends FutureJVppCustomizer
- implements ReaderCustomizer<PitrCfg, PitrCfgBuilder>, ByteDataTranslator, JvppReplyConsumer {
-
- private static final Logger LOG = LoggerFactory.getLogger(PitrCfgCustomizer.class);
-
- public PitrCfgCustomizer(FutureJVppCore futureJvpp) {
- super(futureJvpp);
- }
-
- @Override
- public PitrCfgBuilder getBuilder(InstanceIdentifier<PitrCfg> id) {
- return new PitrCfgBuilder();
- }
-
- @Override
- public void readCurrentAttributes(InstanceIdentifier<PitrCfg> id, PitrCfgBuilder builder, ReadContext ctx)
- throws ReadFailedException {
- LOG.debug("Reading status for Lisp Pitr node {}", id);
-
- ShowLispPitrReply reply;
-
- try {
- reply = getPitrStatus();
- } catch (TimeoutException | VppBaseCallException e) {
- throw new ReadFailedException(id, e);
- }
-
- builder.setLocatorSet(toString(reply.locatorSetName));
- LOG.debug("Reading status for Lisp Pitr node {} successfull", id);
- }
-
- @Override
- public void merge(Builder<? extends DataObject> parentBuilder, PitrCfg readValue) {
- ((LispFeatureDataBuilder) parentBuilder).setPitrCfg(readValue);
- }
-
- public ShowLispPitrReply getPitrStatus() throws TimeoutException, VppBaseCallException {
- return getReply(getFutureJVpp().showLispPitr(new ShowLispPitr()).toCompletableFuture());
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/RemoteMappingCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/RemoteMappingCustomizer.java
deleted file mode 100755
index b0e9056..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/RemoteMappingCustomizer.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.valueOf;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.FilterType;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.MappingsDumpParamsBuilder;
-import static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MapReplyAction.NoAction;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableSet;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.LocatorDumpParams;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.LocatorDumpParams.LocatorDumpParamsBuilder;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.QuantityType;
-import io.fd.honeycomb.lisp.translate.read.trait.LocatorReader;
-import io.fd.honeycomb.lisp.translate.read.trait.MappingReader;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.ModificationCache;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
-import io.fd.honeycomb.translate.util.RWUtils;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.IdentifierCacheKeyFactory;
-import io.fd.honeycomb.translate.vpp.util.AddressTranslator;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetails;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetailsReplyDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MapReplyAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappingsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMappingKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.NegativeMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.PositiveMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.negative.mapping.MapReplyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.RlocsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.rlocs.Locator;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.rlocs.LocatorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.rlocs.LocatorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.LocatorSets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.Interface;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Customizer for reading {@code RemoteMapping}<br>
- */
-public class RemoteMappingCustomizer extends FutureJVppCustomizer
- implements ListReaderCustomizer<RemoteMapping, RemoteMappingKey, RemoteMappingBuilder>,
- EidTranslator, AddressTranslator, ByteDataTranslator, MappingReader, LocatorReader {
-
- private static final Logger LOG = LoggerFactory.getLogger(RemoteMappingCustomizer.class);
-
- private final DumpCacheManager<LispEidTableDetailsReplyDump, MappingsDumpParams> dumpManager;
- private final DumpCacheManager<LispLocatorDetailsReplyDump, LocatorDumpParams> locatorsDumpManager;
- private final NamingContext locatorSetContext;
- private final EidMappingContext remoteMappingContext;
-
- public RemoteMappingCustomizer(@Nonnull final FutureJVppCore futureJvpp,
- @Nonnull final NamingContext locatorSetContext,
- @Nonnull final EidMappingContext remoteMappingContext) {
- super(futureJvpp);
- this.locatorSetContext = checkNotNull(locatorSetContext, "Locator sets context not present");
- this.remoteMappingContext = checkNotNull(remoteMappingContext, "Remote mappings not present");
- // this one should have default scope == RemoteMapping
- this.dumpManager =
- new DumpCacheManager.DumpCacheManagerBuilder<LispEidTableDetailsReplyDump, MappingsDumpParams>()
- .withExecutor(createMappingDumpExecutor(futureJvpp))
- .build();
-
- // cache key needs to have locator set scope to not mix with cached data
- this.locatorsDumpManager =
- new DumpCacheManager.DumpCacheManagerBuilder<LispLocatorDetailsReplyDump, LocatorDumpParams>()
- .withExecutor(createLocatorDumpExecutor(futureJvpp))
- .withCacheKeyFactory(new IdentifierCacheKeyFactory(ImmutableSet.of(LocatorSet.class)))
- .build();
- }
-
-
- @Override
- public RemoteMappingBuilder getBuilder(InstanceIdentifier<RemoteMapping> id) {
- return new RemoteMappingBuilder();
- }
-
- private Eid copyEid(
- org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid eid) {
- return new EidBuilder().setAddress(eid.getAddress()).setAddressType(eid.getAddressType())
- .setVirtualNetworkId(eid.getVirtualNetworkId()).build();
- }
-
- @Override
- public void readCurrentAttributes(InstanceIdentifier<RemoteMapping> id, RemoteMappingBuilder builder,
- ReadContext ctx)
- throws ReadFailedException {
- checkState(id.firstKeyOf(RemoteMapping.class) != null, "No key present for id({})", id);
- checkState(id.firstKeyOf(VniTable.class) != null, "Parent VNI table not specified");
-
- final MappingId mappingId = id.firstKeyOf(RemoteMapping.class).getId();
- checkState(remoteMappingContext.containsEid(mappingId, ctx.getMappingContext()),
- "No mapping stored for id %s", mappingId);
-
- final long vni = id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier();
- final String remoteMappingId = id.firstKeyOf(RemoteMapping.class).getId().getValue();
- final Eid eid = copyEid(remoteMappingContext.getEid(mappingId, ctx.getMappingContext()));
- final MappingsDumpParams dumpParams = new MappingsDumpParamsBuilder()
- .setVni(Long.valueOf(vni).intValue())
- .setEidSet(QuantityType.SPECIFIC)
- .setEidType(getEidType(eid))
- .setEid(getEidAsByteArray(eid))
- .setPrefixLength(getPrefixLength(eid))
- .setFilter(FilterType.REMOTE)
- .build();
-
- LOG.debug("Dumping data for LocalMappings(id={})", id);
- final Optional<LispEidTableDetailsReplyDump> replyOptional =
- dumpManager.getDump(id, ctx.getModificationCache(), dumpParams);
-
- if (!replyOptional.isPresent() || replyOptional.get().lispEidTableDetails.isEmpty()) {
- return;
- }
-
- LOG.debug("Valid dump loaded");
-
- LispEidTableDetails details = replyOptional.get().lispEidTableDetails.stream()
- .filter(subtableFilterForRemoteMappings(id))
- .filter(a -> compareAddresses(eid.getAddress(),
- getArrayAsEidLocal(valueOf(a.eidType), a.eid, a.vni).getAddress()))
- .collect(
- RWUtils.singleItemCollector());
-
- builder.setEid(getArrayAsEidRemote(valueOf(details.eidType), details.eid, details.vni));
- builder.setKey(new RemoteMappingKey(new MappingId(id.firstKeyOf(RemoteMapping.class).getId())));
- builder.setTtl(resolveTtl(details.ttl));
- builder.setAuthoritative(
- new RemoteMapping.Authoritative(byteToBoolean(details.authoritative)));
- resolveMappings(id, builder, details, ctx.getModificationCache(), ctx.getMappingContext());
- }
-
- //compensate ~0 as default value of ttl
- private static long resolveTtl(final int ttlValue) {
- return ttlValue == -1
- ? Integer.MAX_VALUE
- : ttlValue;
- }
-
- @Override
- public List<RemoteMappingKey> getAllIds(InstanceIdentifier<RemoteMapping> id, ReadContext context)
- throws ReadFailedException {
-
- checkState(id.firstKeyOf(VniTable.class) != null, "Parent VNI table not specified");
- final int vni = id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier().intValue();
-
- if (vni == 0) {
- // ignoring default vni mapping
- // it's not relevant for us and we also don't store mapping for such eid's
- // such mapping is used to create helper local mappings to process remote ones
- return Collections.emptyList();
- }
-
- //requesting all remote with specific vni
- final MappingsDumpParams dumpParams = new MappingsDumpParamsBuilder()
- .setEidSet(QuantityType.ALL)
- .setFilter(FilterType.REMOTE)
- .build();
-
- LOG.debug("Dumping data for LocalMappings(id={})", id);
- final Optional<LispEidTableDetailsReplyDump> replyOptional =
- dumpManager.getDump(id, context.getModificationCache(), dumpParams);
-
- if (!replyOptional.isPresent() || replyOptional.get().lispEidTableDetails.isEmpty()) {
- return Collections.emptyList();
- }
-
- return replyOptional.get()
- .lispEidTableDetails
- .stream()
- .filter(a -> a.vni == vni)
- .filter(subtableFilterForRemoteMappings(id))
- .map(detail -> getArrayAsEidRemote(valueOf(detail.eidType), detail.eid, detail.vni))
- .map(remoteEid -> remoteMappingContext.getId(remoteEid, context.getMappingContext()))
- .map(MappingId::new)
- .map(RemoteMappingKey::new)
- .collect(Collectors.toList());
- }
-
- @Override
- public void merge(Builder<? extends DataObject> builder, List<RemoteMapping> readData) {
- ((RemoteMappingsBuilder) builder).setRemoteMapping(readData);
- }
-
- private void resolveMappings(final InstanceIdentifier id, final RemoteMappingBuilder builder,
- final LispEidTableDetails details,
- final ModificationCache cache,
- final MappingContext mappingContext) throws ReadFailedException {
-
- if (details.action != 0) {
- // in this case ,negative action was defined
- bindNegativeMapping(builder, MapReplyAction.forValue(details.action));
- } else {
- // in this case, there is no clear determination whether negative action with NO_ACTION(value == 0) was defined,
- // or if its default value and remote locators, are defined, so only chance to determine so, is to dump locators for this mapping
-
- // cache key needs to have locator set scope to not mix with cached data
- final Optional<LispLocatorDetailsReplyDump> reply;
-
- // this will serve to achieve that locators have locator set scope
- final InstanceIdentifier<Interface> locatorIfaceIdentifier = InstanceIdentifier.create(LocatorSets.class)
- .child(LocatorSet.class,
- new LocatorSetKey(locatorSetContext.getName(details.locatorSetIndex, mappingContext)))
- .child(Interface.class);
- try {
- reply = locatorsDumpManager.getDump(locatorIfaceIdentifier, cache,
- new LocatorDumpParamsBuilder().setLocatorSetIndex(details.locatorSetIndex).build());
- } catch (ReadFailedException e) {
- throw new ReadFailedException(id,
- new IllegalStateException("Unable to resolve Positive/Negative mapping for RemoteMapping",
- e.getCause()));
- }
-
- if (!reply.isPresent() || reply.get().lispLocatorDetails.isEmpty()) {
- // no remote locators exist, therefore there was NO_ACTION defined
- bindNegativeMapping(builder, NoAction);
- } else {
- // bind remote locators
- bindPositiveMapping(builder, reply.get());
- }
- }
- }
-
- private void bindNegativeMapping(final RemoteMappingBuilder builder,
- final MapReplyAction action) {
- builder.setLocatorList(
- new NegativeMappingBuilder().setMapReply(new MapReplyBuilder().setMapReplyAction(action).build())
- .build());
- }
-
- private void bindPositiveMapping(final RemoteMappingBuilder builder, final LispLocatorDetailsReplyDump reply) {
- builder.setLocatorList(
- new PositiveMappingBuilder()
- .setRlocs(
- new RlocsBuilder()
- .setLocator(reply
- .lispLocatorDetails
- .stream()
- .map(this::detailsToLocator)
- .collect(Collectors.toList()))
- .build()
- )
- .build()
- );
- }
-
- private Locator detailsToLocator(final LispLocatorDetails details) {
- final IpAddress address = arrayToIpAddressReversed(byteToBoolean(details.isIpv6), details.ipAddress);
- return new LocatorBuilder()
- .setAddress(address)
- .setKey(new LocatorKey(address))
- .setPriority((short) details.priority)
- .setWeight((short) details.weight)
- .build();
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/VniTableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/VniTableCustomizer.java
deleted file mode 100755
index 49047bc..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/VniTableCustomizer.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static com.google.common.base.Preconditions.checkState;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
-import io.fd.honeycomb.translate.util.RWUtils;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.core.dto.LispEidTableVniDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableVniDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispEidTableVniDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Handles the reads of {@link VniTable} nodes
- */
-public class VniTableCustomizer extends FutureJVppCustomizer
- implements ListReaderCustomizer<VniTable, VniTableKey, VniTableBuilder>, JvppReplyConsumer {
-
- private static final Logger LOG = LoggerFactory.getLogger(VniTableCustomizer.class);
-
- private final DumpCacheManager<LispEidTableVniDetailsReplyDump, Void> dumpManager;
-
- public VniTableCustomizer(@Nonnull final FutureJVppCore futureJvpp) {
- super(futureJvpp);
- this.dumpManager = new DumpCacheManager.DumpCacheManagerBuilder<LispEidTableVniDetailsReplyDump, Void>()
- .withExecutor(((identifier, params) -> getReplyForRead(
- futureJvpp.lispEidTableVniDump(new LispEidTableVniDump()).toCompletableFuture(), identifier)))
- .build();
- }
-
- private static VniTableKey detailsToKey(final LispEidTableVniDetails lispEidTableMapDetails) {
- return new VniTableKey(Integer.valueOf(lispEidTableMapDetails.vni).longValue());
-
- }
-
- @Override
- public void merge(@Nonnull final Builder<? extends DataObject> builder, @Nonnull final List<VniTable> readData) {
- ((EidTableBuilder) builder).setVniTable(readData);
- }
-
- @Nonnull
- @Override
- public VniTableBuilder getBuilder(@Nonnull final InstanceIdentifier<VniTable> id) {
- return new VniTableBuilder();
- }
-
- @Nonnull
- @Override
- public List<VniTableKey> getAllIds(@Nonnull final InstanceIdentifier<VniTable> id,
- @Nonnull final ReadContext context)
- throws ReadFailedException {
- LOG.trace("Reading all IDS...");
-
- final Optional<LispEidTableVniDetailsReplyDump> optionalReply =
- dumpManager.getDump(id, context.getModificationCache(), NO_PARAMS);
-
- if (!optionalReply.isPresent() || optionalReply.get().lispEidTableVniDetails.isEmpty()) {
- return Collections.emptyList();
- }
-
- return optionalReply.get().lispEidTableVniDetails.stream().map(VniTableCustomizer::detailsToKey)
- .collect(Collectors.toList());
- }
-
- @Override
- public void readCurrentAttributes(@Nonnull final InstanceIdentifier<VniTable> id,
- @Nonnull final VniTableBuilder builder, @Nonnull final ReadContext ctx)
- throws ReadFailedException {
-
- checkState(id.firstKeyOf(VniTable.class) != null, "No VNI present");
- VniTableKey key = new VniTableKey(id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier());
-
- final Optional<LispEidTableVniDetailsReplyDump> optionalReply =
- dumpManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
-
- if (!optionalReply.isPresent() || optionalReply.get().lispEidTableVniDetails.isEmpty()) {
- return;
- }
-
- //transforming right away to single detail(specific request should do the magic)
- final LispEidTableVniDetails details = optionalReply.get()
- .lispEidTableVniDetails
- .stream()
- .filter(a -> a.vni == key.getVirtualNetworkIdentifier().intValue())
- .collect(RWUtils.singleItemCollector());
-
- builder.setVirtualNetworkIdentifier((long) details.vni);
- builder.setKey(new VniTableKey(Long.valueOf(details.vni)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/VrfSubtableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/VrfSubtableCustomizer.java
deleted file mode 100644
index af48a65..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/VrfSubtableCustomizer.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams;
-import io.fd.honeycomb.lisp.translate.read.trait.SubtableReader;
-import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManagerBuilder;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetailsReplyDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtableBuilder;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class VrfSubtableCustomizer extends FutureJVppCustomizer
- implements ReaderCustomizer<VrfSubtable, VrfSubtableBuilder>, SubtableReader {
-
- private static final Logger LOG = LoggerFactory.getLogger(VrfSubtableCustomizer.class);
-
- private final DumpCacheManager<LispEidTableMapDetailsReplyDump, SubtableDumpParams> dumpManager;
-
- public VrfSubtableCustomizer(@Nonnull final FutureJVppCore futureJvpp) {
- super(futureJvpp);
- dumpManager = new DumpCacheManagerBuilder<LispEidTableMapDetailsReplyDump, SubtableDumpParams>()
- .withExecutor(createExecutor(futureJvpp))
- .build();
- }
-
- @Nonnull
- @Override
- public VrfSubtableBuilder getBuilder(@Nonnull final InstanceIdentifier<VrfSubtable> id) {
- return new VrfSubtableBuilder();
- }
-
- @Override
- public void readCurrentAttributes(@Nonnull final InstanceIdentifier<VrfSubtable> id,
- @Nonnull final VrfSubtableBuilder builder, @Nonnull final ReadContext ctx)
- throws ReadFailedException {
- LOG.debug("Read attributes for {}", id);
- final int vni = checkNotNull(id.firstKeyOf(VniTable.class), "Cannot find parent VNI Table")
- .getVirtualNetworkIdentifier().intValue();
-
- final Optional<LispEidTableMapDetailsReplyDump> reply = dumpManager.getDump(id, ctx.getModificationCache(), L3_PARAMS);
-
- if (!reply.isPresent() || reply.get().lispEidTableMapDetails.isEmpty()) {
- return;
- }
-
- // Single item collector cant be used in this case,because vrf-subtable is container
- // so read is invoked every time parent is defined
- final List<LispEidTableMapDetails> details =
- reply.get().lispEidTableMapDetails.stream().filter(a -> a.vni == vni)
- .collect(Collectors.toList());
- if (details.size() == 1) {
- final LispEidTableMapDetails detail = details.get(0);
- builder.setTableId(Integer.valueOf(detail.dpTable).longValue());
-
- LOG.debug("Attributes for {} successfully loaded", id);
- }
- }
-
- @Override
- public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder,
- @Nonnull final VrfSubtable readValue) {
- ((VniTableBuilder) parentBuilder).setVrfSubtable(readValue);
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java
deleted file mode 100644
index 7528d1d..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/LocatorDumpParams.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.dump.executor.params;
-
-/**
- * Params for dumping locators
- */
-public final class LocatorDumpParams {
-
- private final int locatorSetIndex;
-
- private LocatorDumpParams(LocatorDumpParamsBuilder builder) {
- this.locatorSetIndex = builder.locatorSetIndex;
- }
-
- public int getLocatorSetIndex() {
- return locatorSetIndex;
- }
-
- public static final class LocatorDumpParamsBuilder {
-
- private int locatorSetIndex;
-
- public LocatorDumpParamsBuilder setLocatorSetIndex(final int locatorSetIndex) {
- this.locatorSetIndex = locatorSetIndex;
- return this;
- }
-
- public LocatorDumpParams build() {
- return new LocatorDumpParams(this);
- }
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/MappingsDumpParams.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/MappingsDumpParams.java
deleted file mode 100755
index d1af212..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/MappingsDumpParams.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.dump.executor.params;
-
-import java.util.Arrays;
-
-/**
- * Parameters for executing dump of mappings
- */
-public final class MappingsDumpParams {
-
- private final byte eidSet;
- private final byte prefixLength;
- private final int vni;
- private final byte eidType;
- private final byte[] eid;
- private final byte filter;
-
- private MappingsDumpParams(MappingsDumpParamsBuilder builder) {
- this.eidSet = builder.eidSet;
- this.prefixLength = builder.prefixLength;
- this.vni = builder.vni;
- this.eidType = builder.eidType;
- this.eid = builder.eid;
- this.filter = builder.filter;
- }
-
-
- public byte getEidSet() {
- return eidSet;
- }
-
- public byte getPrefixLength() {
- return prefixLength;
- }
-
- public int getVni() {
- return vni;
- }
-
- public byte getEidType() {
- return eidType;
- }
-
- public byte[] getEid() {
- return eid;
- }
-
- public final byte getFilter() {
- return filter;
- }
-
- @Override
- public String toString() {
- return "MappingsDumpParams{" +
- "eidSet=" + eidSet +
- ", prefixLength=" + prefixLength +
- ", vni=" + vni +
- ", eidType=" + eidType +
- ", eid=" + Arrays.toString(eid) +
- ", filter=" + filter +
- '}';
- }
-
- /**
- * Type of requested mapping eid
- */
- public enum EidType {
- IPV4(0),
- IPV6(1),
- MAC(2);
-
- private final int value;
-
- private EidType(final int value) {
- this.value = value;
- }
-
- public static final EidType valueOf(int value) {
- switch (value) {
- case 0:
- return IPV4;
- case 1:
- return IPV6;
- case 2:
- return MAC;
- default:
- throw new IllegalArgumentException("Illegal value");
- }
- }
-
- public final int getValue() {
- return this.value;
- }
- }
-
- /**
- * Type of requested mapping
- */
- public enum FilterType {
- ALL(0),
- LOCAL(1),
- REMOTE(2);
-
- private final int value;
-
- private FilterType(final int value) {
- this.value = value;
- }
-
- public final int getValue() {
- return this.value;
- }
- }
-
- public enum QuantityType {
- ALL(0),
- SPECIFIC(1);
-
- private final int value;
-
- private QuantityType(final int value) {
- this.value = value;
- }
-
- public final int getValue() {
- return this.value;
- }
- }
-
- public static final class MappingsDumpParamsBuilder {
- private byte eidSet;
- private byte prefixLength;
- private int vni;
- private byte eidType;
- private byte[] eid;
- private byte filter;
-
- public static final MappingsDumpParamsBuilder newInstance() {
- return new MappingsDumpParamsBuilder();
- }
-
- public MappingsDumpParamsBuilder setEidSet(final QuantityType quantityType) {
- this.eidSet = (byte) quantityType.getValue();
- return this;
- }
-
- public MappingsDumpParamsBuilder setPrefixLength(final byte prefixLength) {
- this.prefixLength = prefixLength;
- return this;
- }
-
- public MappingsDumpParamsBuilder setVni(final int vni) {
- this.vni = vni;
- return this;
- }
-
- public MappingsDumpParamsBuilder setEidType(final EidType eidType) {
- this.eidType = (byte) eidType.getValue();
- return this;
- }
-
- public MappingsDumpParamsBuilder setEid(final byte[] eid) {
- this.eid = eid;
- return this;
- }
-
- public MappingsDumpParamsBuilder setFilter(final FilterType filterType) {
- this.filter = (byte) filterType.getValue();
- return this;
- }
-
- public MappingsDumpParams build() {
- return new MappingsDumpParams(this);
- }
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/SubtableDumpParams.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/SubtableDumpParams.java
deleted file mode 100644
index 678255c..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/params/SubtableDumpParams.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.dump.executor.params;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-
-/**
- * Parameters for dumping {@link VrfSubtable}/{@link BridgeDomainSubtable}
- */
-public final class SubtableDumpParams {
-
- private final byte isL2;
-
- private SubtableDumpParams(SubtableDumpParamsBuilder builder) {
- this.isL2 = builder.isL2;
- }
-
- public byte isL2() {
- return isL2;
- }
-
- @Override
- public String toString() {
- return "SubtableDumpParams{" +
- "isL2=" + isL2 +
- '}';
- }
-
- public enum MapLevel {
- L2(1),
- L3(0);
-
- private final int value;
-
- private MapLevel(final int value) {
- this.value = value;
- }
-
- public int getValue() {
- return value;
- }
- }
-
- public static final class SubtableDumpParamsBuilder {
-
- private byte isL2;
-
- public SubtableDumpParamsBuilder setL2(@Nonnull final MapLevel mapLevel) {
- isL2 = Integer.valueOf(checkNotNull(mapLevel, "Cannot set null map level").getValue()).byteValue();
- return this;
- }
-
- public SubtableDumpParams build() {
- return new SubtableDumpParams(this);
- }
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/AbstractLispReaderFactoryBase.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/AbstractLispReaderFactoryBase.java
deleted file mode 100644
index 8eb3d53..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/AbstractLispReaderFactoryBase.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.factory;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispState;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Basic attributes for lisp reader factories
- */
-abstract class AbstractLispReaderFactoryBase {
-
- protected final InstanceIdentifier<LispState> lispStateId;
- protected final FutureJVppCore vppApi;
- protected NamingContext interfaceContext;
- protected NamingContext locatorSetContext;
- protected NamingContext bridgeDomainContext;
- protected EidMappingContext localMappingContext;
- protected EidMappingContext remoteMappingContext;
-
- protected AbstractLispReaderFactoryBase(@Nonnull final InstanceIdentifier<LispState> lispStateId,
- @Nonnull final FutureJVppCore vppApi) {
- this.lispStateId = checkNotNull(lispStateId, "Lisp state identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP api refference is null");
- }
-
- protected AbstractLispReaderFactoryBase(@Nonnull final InstanceIdentifier<LispState> lispStateId,
- @Nonnull final FutureJVppCore vppApi,
- @Nonnull final NamingContext interfaceContext,
- @Nonnull final EidMappingContext localMappingContext,
- @Nonnull final EidMappingContext remoteMappingContext) {
- this.lispStateId = checkNotNull(lispStateId, "Lisp state identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP api reference is null");
- this.interfaceContext = checkNotNull(interfaceContext,
- "Interface naming context is null,for readers that don't need this dependency,use different constructor");
- this.localMappingContext = checkNotNull(localMappingContext,
- "Local mappings reference is null,for readers that don't need this dependency use different constructor");
- this.remoteMappingContext = checkNotNull(remoteMappingContext,
- "Remote mappings reference is null,for readers that don't need this dependency use different constructor");
- }
-
- protected AbstractLispReaderFactoryBase(@Nonnull final InstanceIdentifier<LispState> lispStateId,
- @Nonnull final FutureJVppCore vppApi,
- @Nonnull final NamingContext interfaceContext,
- @Nonnull final NamingContext locatorSetContext,
- @Nonnull final EidMappingContext localMappingContext,
- @Nonnull final EidMappingContext remoteMappingContext) {
- this.lispStateId = checkNotNull(lispStateId, "Lisp state identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP api reference is null");
- this.interfaceContext = checkNotNull(interfaceContext,
- "Interface naming context is null,for readers that don't need this dependency,use different constructor");
- this.locatorSetContext = checkNotNull(locatorSetContext,
- "Locator set naming context is null,for readers that don't need this dependency,use different constructor");
- this.localMappingContext = checkNotNull(localMappingContext,
- "Local mappings reference is null,for readers that don't need this dependency use different constructor");
- this.remoteMappingContext = checkNotNull(remoteMappingContext,
- "Remote mappings reference is null,for readers that don't need this dependency use different constructor");
- }
-
- protected AbstractLispReaderFactoryBase(@Nonnull final InstanceIdentifier<LispState> lispStateId,
- @Nonnull final FutureJVppCore vppApi,
- @Nonnull final NamingContext interfaceContext,
- @Nonnull final NamingContext locatorSetContext,
- @Nonnull final NamingContext bridgeDomainContext,
- @Nonnull final EidMappingContext localMappingContext,
- @Nonnull final EidMappingContext remoteMappingContext) {
- this.lispStateId = checkNotNull(lispStateId, "Lisp state identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP api reference is null");
- this.interfaceContext = checkNotNull(interfaceContext,
- "Interface naming context is null,for readers that don't need this dependency,use different constructor");
- this.locatorSetContext = checkNotNull(locatorSetContext,
- "Locator set naming context is null,for readers that don't need this dependency,use different constructor");
- this.bridgeDomainContext = checkNotNull(bridgeDomainContext,
- "Bridge domain naming context is null,for readers that don't need this dependency,use different constructor");
- this.localMappingContext = checkNotNull(localMappingContext,
- "Local mappings reference is null,for readers that don't need this dependency use different constructor");
- this.remoteMappingContext = checkNotNull(remoteMappingContext,
- "Remote mappings reference is null,for readers that don't need this dependency use different constructor");
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/EidTableReaderFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/EidTableReaderFactory.java
deleted file mode 100755
index 553b5b5..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/EidTableReaderFactory.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.factory;
-
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.collect.ImmutableSet;
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.AdjacencyCustomizer;
-import io.fd.honeycomb.lisp.translate.read.BridgeDomainSubtableCustomizer;
-import io.fd.honeycomb.lisp.translate.read.LocalMappingCustomizer;
-import io.fd.honeycomb.lisp.translate.read.RemoteMappingCustomizer;
-import io.fd.honeycomb.lisp.translate.read.VniTableCustomizer;
-import io.fd.honeycomb.lisp.translate.read.VrfSubtableCustomizer;
-import io.fd.honeycomb.translate.impl.read.GenericListReader;
-import io.fd.honeycomb.translate.impl.read.GenericReader;
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.Adjacencies;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.AdjacenciesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.Adjacency;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.LocalEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.RemoteEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.LocalMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.LocalMappingsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappingsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.negative.mapping.MapReply;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.Rlocs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.rlocs.Locator;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureData;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-/**
- * Factory that produces {@code Reader} for {@code EidTable}<br> with all its inhired child readers
- */
-final class EidTableReaderFactory extends AbstractLispReaderFactoryBase implements ReaderFactory {
-
- private final AdjacenciesMappingContext adjacenciesMappingContext;
-
- private EidTableReaderFactory(final InstanceIdentifier<LispState> lispStateId,
- final FutureJVppCore vppApi,
- final NamingContext interfaceContext,
- final NamingContext locatorSetContext,
- final NamingContext bridgeDomainContext,
- final EidMappingContext localMappingContext,
- final EidMappingContext remoteMappingContext,
- final AdjacenciesMappingContext adjacenciesMappingContext) {
- super(lispStateId, vppApi, interfaceContext, locatorSetContext, bridgeDomainContext, localMappingContext,
- remoteMappingContext);
- this.adjacenciesMappingContext = checkNotNull(adjacenciesMappingContext, "Adjacencies context cannot be null");
- }
-
- public static EidTableReaderFactory newInstance(@Nonnull final InstanceIdentifier<LispState> lispStateId,
- @Nonnull final FutureJVppCore vppApi,
- @Nonnull final NamingContext interfaceContext,
- @Nonnull final NamingContext locatorSetContext,
- @Nonnull final NamingContext bridgeDomainContext,
- @Nonnull final EidMappingContext localMappingContext,
- @Nonnull final EidMappingContext remoteMappingContext,
- @Nonnull final AdjacenciesMappingContext adjacenciesMappingContext) {
- return new EidTableReaderFactory(lispStateId, vppApi, interfaceContext, locatorSetContext, bridgeDomainContext,
- localMappingContext, remoteMappingContext, adjacenciesMappingContext);
- }
-
- @Override
- public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) {
- final InstanceIdentifier<EidTable> eidTableInstanceIdentifier =
- lispStateId.child(LispFeatureData.class).child(EidTable.class);
- final InstanceIdentifier<VniTable> vniTableInstanceIdentifier =
- eidTableInstanceIdentifier.child(VniTable.class);
- final InstanceIdentifier<VrfSubtable> vrfSubtable = vniTableInstanceIdentifier.child(VrfSubtable.class);
- final InstanceIdentifier<BridgeDomainSubtable> bridgeDomainSubtable =
- vniTableInstanceIdentifier.child(BridgeDomainSubtable.class);
-
- final InstanceIdentifier<LocalMappings> vrfTableLocalMappingsInstanceIdentifier =
- vrfSubtable.child(LocalMappings.class);
- final InstanceIdentifier<RemoteMappings> vrfTableRemoteMappingsInstanceIdentifier =
- vrfSubtable.child(RemoteMappings.class);
- final InstanceIdentifier<Adjacencies> vrfTableAdjacenciesInstanceIdentifier =
- vrfSubtable.child(RemoteMappings.class).child(RemoteMapping.class).child(Adjacencies.class);
-
- final InstanceIdentifier<LocalMappings> bridgeDomainLocalMappingsInstanceIdentifier =
- bridgeDomainSubtable.child(LocalMappings.class);
- final InstanceIdentifier<RemoteMappings> bridgeDomainRemoteMappingsInstanceIdentifier =
- bridgeDomainSubtable.child(RemoteMappings.class);
- final InstanceIdentifier<Adjacencies> bridgeDomainAdjacenciesInstanceIdentifier =
- bridgeDomainSubtable.child(RemoteMappings.class).child(RemoteMapping.class).child(Adjacencies.class);
-
- //EidTable
- registry.addStructuralReader(eidTableInstanceIdentifier, EidTableBuilder.class);
- //EidTable -> VniTable
- registry.add(new GenericListReader<>(vniTableInstanceIdentifier, new VniTableCustomizer(vppApi)));
-
- //EidTable -> VniTable -> VrfSubtable
- registry.add(new GenericReader<>(vrfSubtable, new VrfSubtableCustomizer(vppApi)));
-
- //EidTable -> VniTable -> BridgeDomainSubtable
- registry.add(new GenericReader<>(bridgeDomainSubtable,
- new BridgeDomainSubtableCustomizer(vppApi, bridgeDomainContext)));
-
- //EidTable -> VniTable -> VrfSubtable -> LocalMappings
- registry.addStructuralReader(vrfTableLocalMappingsInstanceIdentifier, LocalMappingsBuilder.class);
- //EidTable -> VniTable -> BridgeDomainSubtable -> LocalMappings
- registry.addStructuralReader(bridgeDomainLocalMappingsInstanceIdentifier, LocalMappingsBuilder.class);
-
- final InstanceIdentifier<LocalMapping> localMappingSubtreeId = InstanceIdentifier.create(LocalMapping.class);
- //EidTable -> VniTable -> VrfSubtable -> LocalMappings -> LocalMapping
- registry.subtreeAdd(ImmutableSet.of(localMappingSubtreeId
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid.class)),
- new GenericListReader<>(vrfTableLocalMappingsInstanceIdentifier.child(LocalMapping.class),
- new LocalMappingCustomizer(vppApi, locatorSetContext, localMappingContext)));
-
- //EidTable -> VniTable -> BridgeDomainSubtable -> LocalMappings -> LocalMapping
- registry.subtreeAdd(ImmutableSet.of(localMappingSubtreeId
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid.class)),
- new GenericListReader<>(bridgeDomainLocalMappingsInstanceIdentifier.child(LocalMapping.class),
- new LocalMappingCustomizer(vppApi, locatorSetContext, localMappingContext)));
-
- //EidTable -> VniTable -> VrfSubtable -> RemoteMappings
- registry.addStructuralReader(vrfTableRemoteMappingsInstanceIdentifier, RemoteMappingsBuilder.class);
- registry.addStructuralReader(bridgeDomainRemoteMappingsInstanceIdentifier, RemoteMappingsBuilder.class);
-
- final InstanceIdentifier<RemoteMapping> remoteMappingSubtreeId = InstanceIdentifier.create(RemoteMapping.class);
- registry.subtreeAdd(ImmutableSet.of(remoteMappingSubtreeId
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid.class),
- remoteMappingSubtreeId.child(Rlocs.class),
- remoteMappingSubtreeId.child(Rlocs.class).child(Locator.class),
- remoteMappingSubtreeId.child(MapReply.class)),
- new GenericListReader<>(vrfTableRemoteMappingsInstanceIdentifier.child(RemoteMapping.class),
- new RemoteMappingCustomizer(vppApi, locatorSetContext, remoteMappingContext)));
- registry.subtreeAdd(ImmutableSet.of(remoteMappingSubtreeId
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid.class),
- remoteMappingSubtreeId.child(Rlocs.class),
- remoteMappingSubtreeId.child(Rlocs.class).child(Locator.class),
- remoteMappingSubtreeId.child(MapReply.class)),
- new GenericListReader<>(bridgeDomainRemoteMappingsInstanceIdentifier.child(RemoteMapping.class),
- new RemoteMappingCustomizer(vppApi, locatorSetContext, remoteMappingContext)));
-
- registry.addStructuralReader(vrfTableAdjacenciesInstanceIdentifier, AdjacenciesBuilder.class);
- registry.addStructuralReader(bridgeDomainAdjacenciesInstanceIdentifier, AdjacenciesBuilder.class);
-
- final InstanceIdentifier<Adjacency> adjacencySubtreeId = InstanceIdentifier.create(Adjacency.class);
- registry.subtreeAdd(
- ImmutableSet.of(adjacencySubtreeId.child(LocalEid.class), adjacencySubtreeId.child(RemoteEid.class)),
- new GenericListReader<>(vrfTableAdjacenciesInstanceIdentifier.child(Adjacency.class),
- new AdjacencyCustomizer(vppApi, localMappingContext, remoteMappingContext,
- adjacenciesMappingContext)));
- registry.subtreeAdd(
- ImmutableSet.of(adjacencySubtreeId.child(LocalEid.class), adjacencySubtreeId.child(RemoteEid.class)),
- new GenericListReader<>(bridgeDomainAdjacenciesInstanceIdentifier.child(Adjacency.class),
- new AdjacencyCustomizer(vppApi, localMappingContext, remoteMappingContext,
- adjacenciesMappingContext)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/LispStateReaderFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/LispStateReaderFactory.java
deleted file mode 100755
index e96246b..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/LispStateReaderFactory.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.factory;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.ADJACENCIES_IDENTIFICATION_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.INTERFACE_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.LOCAL_MAPPING_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.LOCATOR_SET_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.REMOTE_MAPPING_CONTEXT;
-
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.LispStateCustomizer;
-import io.fd.honeycomb.lisp.translate.read.PitrCfgCustomizer;
-import io.fd.honeycomb.translate.impl.read.GenericReader;
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.pitr.cfg.grouping.PitrCfg;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-/**
- * Initialize readers for {@link LispState}
- */
-public class LispStateReaderFactory extends AbstractLispReaderFactoryBase implements ReaderFactory {
-
- private final AdjacenciesMappingContext adjacenciesIdentificationContext;
-
- @Inject
- public LispStateReaderFactory(final FutureJVppCore vppApi,
- @Named(INTERFACE_CONTEXT) final NamingContext interfaceContext,
- @Named(LOCATOR_SET_CONTEXT) final NamingContext locatorSetContext,
- @Named("bridge-domain-context") final NamingContext bridgeDomainContext,
- @Named(LOCAL_MAPPING_CONTEXT) final EidMappingContext localMappingContext,
- @Named(REMOTE_MAPPING_CONTEXT) final EidMappingContext remoteMappingContext,
- @Named(ADJACENCIES_IDENTIFICATION_CONTEXT) final
- AdjacenciesMappingContext adjacenciesIdentificationContext) {
- super(InstanceIdentifier.create(LispState.class), vppApi, interfaceContext, locatorSetContext,
- bridgeDomainContext, localMappingContext, remoteMappingContext);
- this.adjacenciesIdentificationContext =
- checkNotNull(adjacenciesIdentificationContext, "Adjacencies mapping context cannot be null");
- }
-
- @Override
- public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) {
-
- registry.add(new GenericReader<>(lispStateId, new LispStateCustomizer(vppApi)));
- registry.addStructuralReader(lispStateId.child(LispFeatureData.class), LispFeatureDataBuilder.class);
-
- LocatorSetsReaderFactory.newInstance(lispStateId, vppApi, interfaceContext, locatorSetContext).init(registry);
- MapResolversReaderFactory.newInstance(lispStateId, vppApi).init(registry);
- EidTableReaderFactory
- .newInstance(lispStateId, vppApi, interfaceContext, locatorSetContext, bridgeDomainContext,
- localMappingContext, remoteMappingContext, adjacenciesIdentificationContext)
- .init(registry);
-
- registry.add(new GenericReader<>(lispStateId.child(LispFeatureData.class).child(PitrCfg.class),
- new PitrCfgCustomizer(vppApi)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/LocatorSetsReaderFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/LocatorSetsReaderFactory.java
deleted file mode 100755
index c0d9468..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/LocatorSetsReaderFactory.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.factory;
-
-
-import io.fd.honeycomb.lisp.translate.read.InterfaceCustomizer;
-import io.fd.honeycomb.lisp.translate.read.LocatorSetCustomizer;
-import io.fd.honeycomb.translate.impl.read.GenericListReader;
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.LocatorSets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.LocatorSetsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.Interface;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Produces reader for {@link LocatorSets} <br> and all its inhired child readers.
- */
-public class LocatorSetsReaderFactory extends AbstractLispReaderFactoryBase implements ReaderFactory {
-
-
- private LocatorSetsReaderFactory(final InstanceIdentifier<LispState> lispStateId,
- final FutureJVppCore vppApi,
- final NamingContext interfaceContext,
- final NamingContext locatorSetContext) {
- super(lispStateId, vppApi);
- this.interfaceContext = interfaceContext;
- this.locatorSetContext = locatorSetContext;
- }
-
- public static final LocatorSetsReaderFactory newInstance(@Nonnull final InstanceIdentifier<LispState> lispStateId,
- @Nonnull final FutureJVppCore vppApi,
- final NamingContext interfaceContext,
- @Nonnull final NamingContext locatorSetContext) {
- return new LocatorSetsReaderFactory(lispStateId, vppApi, interfaceContext, locatorSetContext);
- }
-
- @Override
- public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) {
- InstanceIdentifier<LocatorSets> locatorSetsInstanceIdentifier = lispStateId.child(LispFeatureData.class).child(LocatorSets.class);
- InstanceIdentifier<LocatorSet> locatorSetInstanceIdentifier =
- locatorSetsInstanceIdentifier.child(LocatorSet.class);
-
- registry.addStructuralReader(locatorSetsInstanceIdentifier, LocatorSetsBuilder.class);
- registry.add(new GenericListReader<>(locatorSetInstanceIdentifier,
- new LocatorSetCustomizer(vppApi, locatorSetContext)));
- registry.add(new GenericListReader<>(locatorSetInstanceIdentifier.child(Interface.class),
- new InterfaceCustomizer(vppApi, interfaceContext, locatorSetContext)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/MapResolversReaderFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/MapResolversReaderFactory.java
deleted file mode 100755
index 866f137..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/factory/MapResolversReaderFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.factory;
-
-
-import io.fd.honeycomb.lisp.translate.read.MapResolverCustomizer;
-import io.fd.honeycomb.translate.impl.read.GenericListReader;
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.MapResolvers;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.MapResolversBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolver;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Builds reader for {@link MapResolvers}<br> and all its inhired child readers
- */
-public class MapResolversReaderFactory extends AbstractLispReaderFactoryBase implements ReaderFactory {
-
- private MapResolversReaderFactory(final InstanceIdentifier<LispState> lispStateId, final FutureJVppCore vppApi) {
- super(lispStateId, vppApi);
- }
-
- public static MapResolversReaderFactory newInstance(@Nonnull final InstanceIdentifier<LispState> lispStateId,
- @Nonnull final FutureJVppCore vppApi) {
- return new MapResolversReaderFactory(lispStateId, vppApi);
- }
-
- @Override
- public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) {
-
- InstanceIdentifier<MapResolvers> mapResolversInstanceIdentifier =
- lispStateId.child(LispFeatureData.class).child(MapResolvers.class);
-
- registry.addStructuralReader(mapResolversInstanceIdentifier, MapResolversBuilder.class);
- registry.add(new GenericListReader<>(mapResolversInstanceIdentifier.child(MapResolver.class),
- new MapResolverCustomizer(vppApi)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/LocatorReader.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/LocatorReader.java
deleted file mode 100644
index 54fef65..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/LocatorReader.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.trait;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.LocatorDumpParams;
-import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import javax.annotation.Nonnull;
-
-/**
- * Provides common logic for reading of locators
- */
-public interface LocatorReader extends JvppReplyConsumer {
-
- default EntityDumpExecutor<LispLocatorDetailsReplyDump, LocatorDumpParams> createLocatorDumpExecutor(
- @Nonnull final FutureJVppCore vppApi) {
- return (identifier, params) -> {
- checkNotNull(params, "Params for dump request not present");
- final LispLocatorDump request = new LispLocatorDump();
- request.lsIndex = params.getLocatorSetIndex();
- //flag that lsIndex is set
- request.isIndexSet = (byte) 1;
-
- return getReplyForRead(vppApi.lispLocatorDump(request).toCompletableFuture(), identifier);
- };
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/LocatorSetReader.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/LocatorSetReader.java
deleted file mode 100644
index 7085b04..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/LocatorSetReader.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.trait;
-
-import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispLocatorSetDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-
-/**
- * Provides common logic for reading {@link LocatorSet}
- */
-public interface LocatorSetReader extends JvppReplyConsumer {
-
- default EntityDumpExecutor<LispLocatorSetDetailsReplyDump, Void> createExecutor(
- @Nonnull final FutureJVppCore vppApi) {
- return (identifier, params) -> {
- final LispLocatorSetDump request = new LispLocatorSetDump();
- //only local
- request.filter = 1;
- return getReplyForRead(vppApi.lispLocatorSetDump(request).toCompletableFuture(), identifier);
- };
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/MappingProducer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/MappingProducer.java
deleted file mode 100644
index 92e5c31..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/MappingProducer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.trait;
-
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4Afi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv6Afi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.MacAfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * Trait that verifies data for mappings
- */
-public interface MappingProducer {
-
- /**
- * Checks whether provided {@link LocalMapping} can be written under subtree idenfied by {@link InstanceIdentifier}
- */
- default void checkAllowedCombination(@Nonnull final InstanceIdentifier<LocalMapping> identifier,
- @Nonnull final LocalMapping data) throws WriteFailedException {
- final Class<? extends LispAddressFamily> eidAddressType = data.getEid().getAddressType();
-
- if (identifier.firstIdentifierOf(VrfSubtable.class) != null) {
- if (Ipv4Afi.class != eidAddressType && Ipv6Afi.class != eidAddressType) {
- throw new WriteFailedException.CreateFailedException(identifier, data,
- new IllegalArgumentException("Only Ipv4/Ipv6 eid's are allowed for Vrf Subtable"));
- }
- } else if (identifier.firstIdentifierOf(BridgeDomainSubtable.class) != null) {
- if (MacAfi.class != eidAddressType) {
- throw new WriteFailedException.CreateFailedException(identifier, data,
- new IllegalArgumentException("Only Mac eid's are allowed for Bridge Domain Subtable"));
- }
- }
- }
-
- default void checkAllowedCombination(@Nonnull final InstanceIdentifier<RemoteMapping> identifier,
- @Nonnull final RemoteMapping data) throws WriteFailedException {
- final Class<? extends LispAddressFamily> eidAddressType = data.getEid().getAddressType();
-
- if (identifier.firstIdentifierOf(VrfSubtable.class) != null) {
- if (Ipv4Afi.class != eidAddressType && Ipv6Afi.class != eidAddressType) {
- throw new WriteFailedException.CreateFailedException(identifier, data,
- new IllegalArgumentException("Only Ipv4/Ipv6 eid's are allowed for Vrf Subtable"));
- }
- } else if (identifier.firstIdentifierOf(BridgeDomainSubtable.class) != null) {
- if (MacAfi.class != eidAddressType) {
- throw new WriteFailedException.CreateFailedException(identifier, data,
- new IllegalArgumentException("Only Mac eid's are allowed for Bridge Domain Subtable"));
- }
- }
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/MappingReader.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/MappingReader.java
deleted file mode 100644
index 759e52a..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/MappingReader.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.trait;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV4;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV6;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.MAC;
-
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams;
-import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.function.Predicate;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * Trait providing predicates to filter mappings to respective subtables
- */
-public interface MappingReader extends JvppReplyConsumer {
-
- Predicate<LispEidTableDetails> BRIDGE_DOMAIN_MAPPINGS_ONLY =
- (LispEidTableDetails detail) -> detail.eidType == MAC.getValue();
-
- Predicate<LispEidTableDetails> VRF_MAPPINGS_ONLY =
- (LispEidTableDetails detail) -> detail.eidType == IPV4.getValue() || detail.eidType == IPV6.getValue();
-
- default Predicate<LispEidTableDetails> subtableFilterForLocalMappings(
- @Nonnull final InstanceIdentifier<LocalMapping> identifier) {
-
- if (identifier.firstIdentifierOf(VrfSubtable.class) != null) {
- return VRF_MAPPINGS_ONLY;
- } else if (identifier.firstIdentifierOf(BridgeDomainSubtable.class) != null) {
- return BRIDGE_DOMAIN_MAPPINGS_ONLY;
- } else {
- throw new IllegalArgumentException("Cannot determine mappings predicate for " + identifier);
- }
- }
-
- default Predicate<LispEidTableDetails> subtableFilterForRemoteMappings(
- @Nonnull final InstanceIdentifier<RemoteMapping> identifier) {
-
- if (identifier.firstIdentifierOf(VrfSubtable.class) != null) {
- return VRF_MAPPINGS_ONLY;
- } else if (identifier.firstIdentifierOf(BridgeDomainSubtable.class) != null) {
- return BRIDGE_DOMAIN_MAPPINGS_ONLY;
- } else {
- throw new IllegalArgumentException("Cannot determine mappings predicate for " + identifier);
- }
- }
-
- default EntityDumpExecutor<LispEidTableDetailsReplyDump, MappingsDumpParams> createMappingDumpExecutor(
- @Nonnull final FutureJVppCore vppApi) {
- return (identifier, params) -> {
- checkNotNull(params, "Params for dump request not present");
-
- LispEidTableDump request = new LispEidTableDump();
- request.eid = params.getEid();
- request.eidSet = params.getEidSet();
- request.eidType = params.getEidType();
- request.prefixLength = params.getPrefixLength();
- request.vni = params.getVni();
- request.filter = params.getFilter();
-
- return getReplyForRead(vppApi.lispEidTableDump(request).toCompletableFuture(), identifier);
- };
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/SubtableReader.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/SubtableReader.java
deleted file mode 100644
index a4a6e21..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/trait/SubtableReader.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.trait;
-
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams.MapLevel.L2;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams.MapLevel.L3;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams.SubtableDumpParamsBuilder;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams;
-import io.fd.honeycomb.translate.ModificationCache;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.ChildOf;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * Provides common logic for reading Eid subtables
- */
-public interface SubtableReader extends JvppReplyConsumer {
-
- SubtableDumpParams L2_PARAMS = new SubtableDumpParamsBuilder().setL2(L2).build();
- SubtableDumpParams L3_PARAMS = new SubtableDumpParamsBuilder().setL2(L3).build();
-
- default EntityDumpExecutor<LispEidTableMapDetailsReplyDump, SubtableDumpParams> createExecutor(
- @Nonnull final FutureJVppCore vppApi) {
- return (identifier, params) -> {
- final LispEidTableMapDump request = new LispEidTableMapDump();
- request.isL2 = checkNotNull(params, "Cannot bind null params").isL2();
- return getReplyForRead(vppApi.lispEidTableMapDump(request).toCompletableFuture(), identifier);
- };
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/util/EidMetadataProvider.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/util/EidMetadataProvider.java
deleted file mode 100644
index 88571f7..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/util/EidMetadataProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.util;
-
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.LocalEidBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.RemoteEidBuilder;
-
-/**
- * Trait providing metadata for eid's
- */
-public interface EidMetadataProvider {
-
- /**
- * Returns new {@link org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder}
- * binded with metadata
- */
- default org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder newRemoteEidBuilder(
- @Nonnull final Class<? extends LispAddressFamily> eidAddressType,
- final int vni) {
- return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder()
- .setAddressType(eidAddressType)
- .setVirtualNetworkId(new InstanceIdType(Long.valueOf(vni)));
- }
-
- /**
- * Returns new {@link org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.EidBuilder}
- * binded with metadata
- */
- default org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.EidBuilder newLocalEidBuilder(
- @Nonnull final Class<? extends LispAddressFamily> eidAddressType,
- final int vni) {
- return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.EidBuilder()
- .setAddressType(eidAddressType)
- .setVirtualNetworkId(new InstanceIdType(Long.valueOf(vni)));
- }
-
- default LocalEidBuilder newEidBuilderLocal(@Nonnull final Class<? extends LispAddressFamily> eidAddressType,
- final int vni) {
- return new LocalEidBuilder()
- .setAddressType(eidAddressType)
- .setVirtualNetworkId(new InstanceIdType(Long.valueOf(vni)));
- }
-
- default RemoteEidBuilder newEidBuilderRemote(@Nonnull final Class<? extends LispAddressFamily> eidAddressType,
- final int vni) {
- return new RemoteEidBuilder()
- .setAddressType(eidAddressType)
- .setVirtualNetworkId(new InstanceIdType(Long.valueOf(vni)));
- }
-
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/util/EidTranslator.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/util/EidTranslator.java
deleted file mode 100755
index 0b7faba..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/util/EidTranslator.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.util;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV4;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV6;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.MAC;
-
-import io.fd.honeycomb.translate.vpp.util.AddressTranslator;
-import java.util.Arrays;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4Afi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv6Afi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.MacAfi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Mac;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.MacBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.LocalEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.RemoteEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid;
-
-
-/**
- * Trait providing converting logic for eid's
- */
-public interface EidTranslator extends AddressTranslator, EidMetadataProvider {
-
-
- default byte getPrefixLength(LocalEid address) {
- return resolverPrefixLength(address.getAddress());
- }
-
- default byte getPrefixLength(RemoteEid address) {
- return resolverPrefixLength(address.getAddress());
- }
-
- default byte getPrefixLength(
- org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid address) {
- return resolverPrefixLength(address.getAddress());
- }
-
- default byte getPrefixLength(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid address) {
- return resolverPrefixLength(address.getAddress());
- }
-
- default byte getPrefixLength(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid address) {
- return resolverPrefixLength(address.getAddress());
- }
-
- static byte resolverPrefixLength(Address address) {
-
- switch (resolveType(address)) {
- case IPV4:
- return 32;
- case IPV6:
- return (byte) 128;
- case MAC:
- return 0;
- default:
- throw new IllegalArgumentException("Illegal type");
- }
- }
-
- default Eid getArrayAsEidLocal(@Nonnull final EidType type, final byte[] address, final int vni) {
-
- switch (type) {
- case IPV4: {
- return newLocalEidBuilder(Ipv4Afi.class, vni).setAddress(
- new Ipv4Builder().setIpv4(arrayToIpv4AddressNoZoneReversed(address)).build())
- .build();
- }
- case IPV6: {
- return newLocalEidBuilder(Ipv6Afi.class, vni).setAddress(
- new Ipv6Builder().setIpv6(arrayToIpv6AddressNoZoneReversed(address)).build())
- .build();
- }
- case MAC: {
- return newLocalEidBuilder(MacAfi.class, vni).setAddress(
- new MacBuilder().setMac(new MacAddress(byteArrayToMacSeparated(address)))
- .build()).build();
- }
- default: {
- throw new IllegalStateException("Unknown type detected");
- }
- }
- }
-
- default org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid getArrayAsEidRemote(
- @Nonnull final EidType type, final byte[] address, final int vni) {
-
- switch (type) {
- case IPV4: {
- return newRemoteEidBuilder(Ipv4Afi.class, vni)
- .setAddress(
- new Ipv4Builder().setIpv4(arrayToIpv4AddressNoZoneReversed(address))
- .build())
- .build();
- }
- case IPV6: {
- return newRemoteEidBuilder(Ipv6Afi.class, vni)
- .setAddress(
- new Ipv6Builder().setIpv6(arrayToIpv6AddressNoZoneReversed(address))
- .build())
- .build();
- }
- case MAC: {
- return newRemoteEidBuilder(MacAfi.class, vni)
- .setAddress(
- new MacBuilder().setMac(new MacAddress(byteArrayToMacSeparated(address)))
- .build()).build();
- }
- default: {
- throw new IllegalStateException("Unknown type detected");
- }
- }
- }
-
- default LocalEid getArrayAsLocalEid(@Nonnull final EidType type, final byte[] address, final int vni) {
- switch (type) {
- case IPV4: {
- return newEidBuilderLocal(Ipv4Afi.class, vni)
- .setAddress(
- new Ipv4Builder().setIpv4(arrayToIpv4AddressNoZoneReversed(address))
- .build())
- .build();
- }
- case IPV6: {
- return newEidBuilderLocal(Ipv6Afi.class, vni)
- .setAddress(
- new Ipv6Builder().setIpv6(arrayToIpv6AddressNoZoneReversed(address))
- .build())
- .build();
- }
- case MAC: {
- return newEidBuilderLocal(MacAfi.class, vni)
- .setAddress(
- new MacBuilder().setMac(new MacAddress(byteArrayToMacSeparated(address)))
- .build()).build();
- }
- default: {
- throw new IllegalStateException("Unknown type detected");
- }
- }
- }
-
- default RemoteEid getArrayAsRemoteEid(@Nonnull final EidType type, final byte[] address, final int vni) {
- switch (type) {
- case IPV4: {
- return newEidBuilderRemote(Ipv4Afi.class, vni)
- .setAddress(
- new Ipv4Builder().setIpv4(arrayToIpv4AddressNoZoneReversed(address))
- .build())
- .build();
- }
- case IPV6: {
- return newEidBuilderRemote(Ipv6Afi.class, vni)
- .setAddress(
- new Ipv6Builder().setIpv6(arrayToIpv6AddressNoZoneReversed(address))
- .build())
- .build();
- }
- case MAC: {
- return newEidBuilderRemote(MacAfi.class, vni)
- .setAddress(
- new MacBuilder().setMac(new MacAddress(byteArrayToMacSeparated(address)))
- .build()).build();
- }
- default: {
- throw new IllegalStateException("Unknown type detected");
- }
- }
- }
-
- default String getArrayAsEidString(
- EidType type, byte[] address) {
- switch (type) {
- case IPV4: {
- return arrayToIpv4AddressNoZoneReversed(address).getValue();
- }
- case IPV6: {
- return arrayToIpv6AddressNoZoneReversed(address).getValue();
- }
- case MAC: {
- //as wrong as it looks ,its right(second param is not end index,but count)
- return byteArrayToMacSeparated(Arrays.copyOfRange(address, 0, 6));
- }
- default: {
- throw new IllegalStateException("Unknown type detected");
- }
- }
- }
-
-
- default EidType getEidType(
- org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid address) {
- checkNotNull(address, "SimpleAddress cannot be null");
-
- return resolveType(address.getAddress());
- }
-
- default EidType getEidType(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid address) {
- checkNotNull(address, "SimpleAddress cannot be null");
-
- return resolveType(address.getAddress());
- }
-
-
- default EidType getEidType(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid address) {
- checkNotNull(address, "Address cannot be null");
-
- return resolveType(address.getAddress());
- }
-
-
- default EidType getEidType(final LocalEid address) {
- checkNotNull(address, "Address cannot be null");
-
- return resolveType(address.getAddress());
- }
-
- default EidType getEidType(final RemoteEid address) {
- checkNotNull(address, "Address cannot be null");
-
- return resolveType(address.getAddress());
- }
-
- static EidType resolveType(
- Address address) {
-
- if (address instanceof Ipv4) {
- return IPV4;
- } else if (address instanceof Ipv6) {
- return IPV6;
- } else if (address instanceof Mac) {
- return MAC;
- } else {
- throw new IllegalStateException("Unknown type detected");
- }
- }
-
- default byte[] getEidAsByteArray(
- org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid address) {
- checkNotNull(address, "Eid cannot be null");
-
- return resolveByteArray(getEidType(address), address.getAddress());
- }
-
- default byte[] getEidAsByteArray(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid address) {
- checkNotNull(address, "Eid cannot be null");
-
- return resolveByteArray(getEidType(address), address.getAddress());
- }
-
- default byte[] getEidAsByteArray(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid address) {
- checkNotNull(address, "Eid cannot be null");
-
- return resolveByteArray(getEidType(address), address.getAddress());
- }
-
- default byte[] getEidAsByteArray(final LocalEid address) {
- checkNotNull(address, "Eid cannot be null");
-
- return resolveByteArray(getEidType(address), address.getAddress());
- }
-
-
- default byte[] getEidAsByteArray(final RemoteEid address) {
- checkNotNull(address, "Eid cannot be null");
-
- return resolveByteArray(getEidType(address), address.getAddress());
- }
-
- default byte[] resolveByteArray(EidType type, Address address) {
- switch (type) {
- case IPV4:
- return ipv4AddressNoZoneToArray(new Ipv4AddressNoZone(((Ipv4) address).getIpv4()));
- case IPV6:
- return ipv6AddressNoZoneToArray(new Ipv6AddressNoZone(((Ipv6) address).getIpv6()));
- case MAC:
- return parseMac(((Mac) address).getMac().getValue());
- default:
- throw new IllegalArgumentException("Unsupported type");
- }
- }
-
- default boolean compareEids(
- LispAddress first,
- LispAddress second) {
-
- return compareAddresses(checkNotNull(first, "First eid is null").getAddress(),
- checkNotNull(second, "Second eid is null").getAddress());
- }
-
- default boolean compareAddresses(Address firstAddress, Address secondAddress) {
-
- checkNotNull(firstAddress, "First address is null");
- checkNotNull(secondAddress, "Second address is null");
-
- if (firstAddress instanceof Ipv4 && secondAddress instanceof Ipv4) {
- return ((Ipv4) firstAddress).getIpv4().getValue().equals(((Ipv4) secondAddress).getIpv4().getValue());
- }
-
- if (firstAddress instanceof Ipv6 && secondAddress instanceof Ipv6) {
- return ((Ipv6) firstAddress).getIpv6().getValue().equals(((Ipv6) secondAddress).getIpv6().getValue());
- }
-
- if (firstAddress instanceof Mac && secondAddress instanceof Mac) {
- return ((Mac) firstAddress).getMac().getValue().equals(((Mac) secondAddress).getMac().getValue());
- }
-
- return false;
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/AdjacencyCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/AdjacencyCustomizer.java
deleted file mode 100755
index b394f2a..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/AdjacencyCustomizer.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType;
-
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispAddDelAdjacency;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.Adjacency;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.LocalEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.RemoteEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class AdjacencyCustomizer extends FutureJVppCustomizer
- implements ListWriterCustomizer<Adjacency, AdjacencyKey>, ByteDataTranslator, EidTranslator,
- JvppReplyConsumer {
-
- private final EidMappingContext localEidsMappingContext;
- private final EidMappingContext remoteEidsMappingContext;
- private final AdjacenciesMappingContext adjacenciesMappingContext;
-
- public AdjacencyCustomizer(@Nonnull final FutureJVppCore futureJvpp,
- @Nonnull final EidMappingContext localEidsMappingContext,
- @Nonnull final EidMappingContext remoteEidsMappingContext,
- @Nonnull final AdjacenciesMappingContext adjacenciesMappingContext) {
- super(futureJvpp);
- this.localEidsMappingContext =
- checkNotNull(localEidsMappingContext, "Eid context for local eid's cannot be null");
- this.remoteEidsMappingContext =
- checkNotNull(remoteEidsMappingContext, "Eid context for remote eid's cannot be null");
- this.adjacenciesMappingContext = checkNotNull(adjacenciesMappingContext, "Adjacencies context cannot be null");
- }
-
- @Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Adjacency> id,
- @Nonnull final Adjacency dataAfter, @Nonnull final WriteContext writeContext)
- throws WriteFailedException {
- try {
- addDelAdjacency(true, id, dataAfter, writeContext);
- } catch (TimeoutException | VppBaseCallException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
-
- //after successful creation, create mapping
- adjacenciesMappingContext.addEidPair(adjacencyId(id),
- localEidId(dataAfter, writeContext),
- remoteEidId(dataAfter, writeContext),
- writeContext.getMappingContext());
- }
-
- private String remoteEidId(final @Nonnull Adjacency dataAfter, final @Nonnull WriteContext writeContext) {
- return remoteEidsMappingContext.getId(toRemoteEid(dataAfter.getRemoteEid()), writeContext.getMappingContext())
- .getValue();
- }
-
- private String localEidId(final @Nonnull Adjacency dataAfter, final @Nonnull WriteContext writeContext) {
- return localEidsMappingContext.getId(toLocalEid(dataAfter.getLocalEid()), writeContext.getMappingContext())
- .getValue();
- }
-
- private String adjacencyId(final @Nonnull InstanceIdentifier<Adjacency> id) {
- return id.firstKeyOf(Adjacency.class).getId();
- }
-
- @Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Adjacency> id,
- @Nonnull final Adjacency dataBefore, @Nonnull final Adjacency dataAfter,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- throw new UnsupportedOperationException("Operation not supported");
- }
-
- @Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Adjacency> id,
- @Nonnull final Adjacency dataBefore, @Nonnull final WriteContext writeContext)
- throws WriteFailedException {
- try {
- addDelAdjacency(false, id, dataBefore, writeContext);
- } catch (TimeoutException | VppBaseCallException e) {
- throw new WriteFailedException.CreateFailedException(id, dataBefore, e);
- }
-
- //after successful creation, create mapping
- adjacenciesMappingContext.removeForIndex(adjacencyId(id),
- writeContext.getMappingContext());
- }
-
- private void addDelAdjacency(boolean add, final InstanceIdentifier<Adjacency> id, final Adjacency data,
- final WriteContext writeContext)
- throws TimeoutException, VppBaseCallException {
-
- final int vni = checkNotNull(id.firstKeyOf(VniTable.class), "Unable to find parent VNI for {}", id)
- .getVirtualNetworkIdentifier().intValue();
-
- // both local and remote eids must be referenced to have respective mapping,
- // if there is an attempt to add adjacency.
- // In our case its enough to check if local/remote mapping exist for respective eid,
- // because such mappings are created while creating mappings
- final LocalEid localEid = add
- ? verifiedLocalEid(data.getLocalEid(), writeContext)
- : data.getLocalEid();
- final RemoteEid remoteEid = add
- ? verifiedRemoteEid(data.getRemoteEid(), writeContext)
- : data.getRemoteEid();
- final EidType localEidType = getEidType(localEid);
- final EidType remoteEidType = getEidType(data.getRemoteEid());
-
- checkArgument(localEidType ==
- remoteEidType, "Local[%s] and Remote[%s] eid types must be the same", localEidType, remoteEidType);
-
- LispAddDelAdjacency request = new LispAddDelAdjacency();
-
- request.isAdd = booleanToByte(add);
- request.leid = getEidAsByteArray(localEid);
- request.leidLen = getPrefixLength(localEid);
- request.reid = getEidAsByteArray(remoteEid);
- request.reidLen = getPrefixLength(remoteEid);
- request.eidType = (byte) localEidType.getValue();
- request.vni = vni;
-
- getReply(getFutureJVpp().lispAddDelAdjacency(request).toCompletableFuture());
- }
-
- private LocalEid verifiedLocalEid(final LocalEid localEid, final WriteContext writeContext) {
- if (localEidsMappingContext.containsId(toLocalEid(localEid), writeContext.getMappingContext())) {
- return localEid;
- }
- throw new IllegalStateException(
- "Referenced Local Eid[" + localEid +
- "] doesn't have local mapping defined, therefore it can't be used in adjacency");
- }
-
- private RemoteEid verifiedRemoteEid(final RemoteEid remoteEid, final WriteContext writeContext) {
- if (remoteEidsMappingContext.containsId(toRemoteEid(remoteEid), writeContext.getMappingContext())) {
- return remoteEid;
- }
- throw new IllegalStateException(
- "Referenced Remote Eid[" + remoteEid +
- "] doesn't have remote mapping defined, therefore it can't be used in adjacency");
- }
-
- private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid toRemoteEid(
- final RemoteEid remoteEid) {
- return newRemoteEidBuilder(remoteEid.getAddressType(), remoteEid.getVirtualNetworkId().getValue().intValue())
- .setAddress(remoteEid.getAddress()).build();
- }
-
- private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid toLocalEid(
- LocalEid localEid) {
- return newLocalEidBuilder(localEid.getAddressType(), localEid.getVirtualNetworkId().getValue().intValue())
- .setAddress(localEid.getAddress()).build();
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/BridgeDomainSubtableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/BridgeDomainSubtableCustomizer.java
deleted file mode 100644
index 41e1adc..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/BridgeDomainSubtableCustomizer.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import io.fd.honeycomb.lisp.translate.write.trait.SubtableWriter;
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BridgeDomainSubtableCustomizer extends FutureJVppCustomizer
- implements WriterCustomizer<BridgeDomainSubtable>, SubtableWriter {
-
- private static final Logger LOG = LoggerFactory.getLogger(BridgeDomainSubtableCustomizer.class);
-
- private final NamingContext bridgeDomainContext;
-
- public BridgeDomainSubtableCustomizer(@Nonnull final FutureJVppCore futureJvpp,
- @Nonnull final NamingContext bridgeDomainContext) {
- super(futureJvpp);
- this.bridgeDomainContext = checkNotNull(bridgeDomainContext, "Bridge domain context cannot be null");
- }
-
- @Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<BridgeDomainSubtable> id,
- @Nonnull final BridgeDomainSubtable dataAfter,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- LOG.debug("Writing Id {} ", id);
-
- try {
- addDelSubtableMapping(getFutureJVpp(), true, extractVni(id),
- extractBridgeDomainId(dataAfter.getBridgeDomainRef(), writeContext.getMappingContext()), true, LOG);
- } catch (TimeoutException | VppBaseCallException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
-
- LOG.debug("{} successfully written", id);
- }
-
- @Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<BridgeDomainSubtable> id,
- @Nonnull final BridgeDomainSubtable dataBefore,
- @Nonnull final BridgeDomainSubtable dataAfter,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- throw new UnsupportedOperationException("Operation not supported");
- }
-
- @Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<BridgeDomainSubtable> id,
- @Nonnull final BridgeDomainSubtable dataBefore,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- LOG.debug("Removing Id {}", id);
-
- try {
- addDelSubtableMapping(getFutureJVpp(), false, extractVni(id),
- extractBridgeDomainId(dataBefore.getBridgeDomainRef(), writeContext.getMappingContext()), true,
- LOG);
- } catch (TimeoutException | VppBaseCallException e) {
- throw new WriteFailedException.CreateFailedException(id, dataBefore, e);
- }
-
- LOG.debug("{} successfully removed", id);
- }
-
- private int extractBridgeDomainId(final String bridgeDomainName, final MappingContext mappingContext) {
- checkState(bridgeDomainContext.containsIndex(bridgeDomainName, mappingContext),
- "No mapping for bridge domain name %s", bridgeDomainName);
- return bridgeDomainContext.getIndex(bridgeDomainName, mappingContext);
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/InterfaceCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/InterfaceCustomizer.java
deleted file mode 100755
index fa477e5..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/InterfaceCustomizer.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.io.UnsupportedEncodingException;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.Interface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.InterfaceKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispAddDelLocator;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Customizer for updating {@link Interface}
- *
- * @see Interface
- */
-public class InterfaceCustomizer extends FutureJVppCustomizer
- implements ListWriterCustomizer<Interface, InterfaceKey>, ByteDataTranslator, JvppReplyConsumer {
-
- private final NamingContext interfaceContext;
-
- public InterfaceCustomizer(@Nonnull FutureJVppCore futureJvpp, @Nonnull NamingContext interfaceContext) {
- super(futureJvpp);
- this.interfaceContext = checkNotNull(interfaceContext, "Naming context is null");
- }
-
- @Override
- public void writeCurrentAttributes(InstanceIdentifier<Interface> id, Interface dataAfter, WriteContext writeContext)
- throws WriteFailedException {
-
- checkNotNull(dataAfter, "Interface is null");
- checkNotNull(dataAfter.getPriority(), "Priority is null");
- checkNotNull(dataAfter.getWeight(), "Weight is null");
- checkState(id.firstKeyOf(Interface.class) != null, "Parent interface not found");
- checkState(id.firstKeyOf(LocatorSet.class) != null, "Parent locator set not found");
-
- String interfaceName = id.firstKeyOf(Interface.class).getInterfaceRef();
- String locatorSetName = id.firstKeyOf(LocatorSet.class).getName();
-
- checkState(interfaceContext.containsIndex(interfaceName, writeContext.getMappingContext()),
- "No mapping stored for interface %s", interfaceName);
-
- try {
- addDelInterfaceAndReply(true, dataAfter,
- interfaceContext.getIndex(interfaceName, writeContext.getMappingContext()), locatorSetName);
- } catch (VppBaseCallException | TimeoutException | UnsupportedEncodingException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
-
- }
-
- @Override
- public void updateCurrentAttributes(InstanceIdentifier<Interface> id, Interface dataBefore, Interface dataAfter,
- WriteContext writeContext) throws WriteFailedException {
- throw new UnsupportedOperationException("Operation not supported");
- }
-
- @Override
- public void deleteCurrentAttributes(InstanceIdentifier<Interface> id, Interface dataBefore,
- WriteContext writeContext) throws WriteFailedException {
- checkNotNull(dataBefore, "Interface is null");
- checkNotNull(dataBefore.getPriority(), "Priority is null");
- checkNotNull(dataBefore.getWeight(), "Weight is null");
- checkState(id.firstKeyOf(Interface.class) != null, "Parent interface not found");
- checkState(id.firstKeyOf(LocatorSet.class) != null, "Parent locator set not found");
-
- String interfaceName = id.firstKeyOf(Interface.class).getInterfaceRef();
- String locatorSetName = id.firstKeyOf(LocatorSet.class).getName();
-
- checkState(interfaceContext.containsIndex(interfaceName, writeContext.getMappingContext()),
- "No mapping stored for interface %s", interfaceName);
- try {
- addDelInterfaceAndReply(false, dataBefore,
- interfaceContext.getIndex(interfaceName, writeContext.getMappingContext()), locatorSetName);
- } catch (VppBaseCallException | TimeoutException | UnsupportedEncodingException e) {
- throw new WriteFailedException.DeleteFailedException(id, e);
- }
- }
-
- private void addDelInterfaceAndReply(boolean add, Interface data, int interfaceIndex, String locatorSetName)
- throws VppBaseCallException, TimeoutException, UnsupportedEncodingException {
- LispAddDelLocator request = new LispAddDelLocator();
-
- request.isAdd = booleanToByte(add);
- request.priority = data.getPriority().byteValue();
- request.weight = data.getWeight().byteValue();
- request.swIfIndex = interfaceIndex;
- request.locatorSetName = locatorSetName.getBytes(UTF_8);
-
- getReply(getFutureJVpp().lispAddDelLocator(request).toCompletableFuture());
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/ItrRemoteLocatorSetCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/ItrRemoteLocatorSetCustomizer.java
deleted file mode 100644
index 8ba1bcf..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/ItrRemoteLocatorSetCustomizer.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-
-import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.nio.charset.StandardCharsets;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.itr.remote.locator.sets.grouping.ItrRemoteLocatorSet;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispAddDelMapRequestItrRlocs;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-public class ItrRemoteLocatorSetCustomizer extends FutureJVppCustomizer implements
- WriterCustomizer<ItrRemoteLocatorSet>, ByteDataTranslator, JvppReplyConsumer {
-
- public ItrRemoteLocatorSetCustomizer(@Nonnull final FutureJVppCore futureJVppCore) {
- super(futureJVppCore);
- }
-
- @Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<ItrRemoteLocatorSet> id,
- @Nonnull final ItrRemoteLocatorSet dataAfter,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- try {
- addDelItrRemoteLocatorSet(true, dataAfter);
- } catch (TimeoutException | VppBaseCallException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
- }
-
- @Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<ItrRemoteLocatorSet> id,
- @Nonnull final ItrRemoteLocatorSet dataBefore,
- @Nonnull final ItrRemoteLocatorSet dataAfter,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
- new UnsupportedOperationException("Operation not supported"));
- }
-
- @Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<ItrRemoteLocatorSet> id,
- @Nonnull final ItrRemoteLocatorSet dataBefore,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- try {
- addDelItrRemoteLocatorSet(false, dataBefore);
- } catch (TimeoutException | VppBaseCallException e) {
- throw new WriteFailedException.DeleteFailedException(id, e);
- }
- }
-
- private void addDelItrRemoteLocatorSet(final boolean add, @Nonnull final ItrRemoteLocatorSet data)
- throws TimeoutException, VppBaseCallException {
-
- LispAddDelMapRequestItrRlocs request = new LispAddDelMapRequestItrRlocs();
- request.isAdd = booleanToByte(add);
- request.locatorSetName = data.getRemoteLocatorSetName().getBytes(StandardCharsets.UTF_8);
-
- getReply(getFutureJVpp().lispAddDelMapRequestItrRlocs(request).toCompletableFuture());
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LispCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LispCustomizer.java
deleted file mode 100755
index ba2e240..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LispCustomizer.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import com.google.common.base.Preconditions;
-import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.util.concurrent.CompletionStage;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.Lisp;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispEnableDisable;
-import io.fd.vpp.jvpp.core.dto.LispEnableDisableReply;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Handles updates of {@link Lisp} node. Takes care of LISP enable/disable
- */
-public class LispCustomizer extends FutureJVppCustomizer
- implements WriterCustomizer<Lisp>, ByteDataTranslator, JvppReplyConsumer {
-
- public LispCustomizer(final FutureJVppCore vppApi) {
- super(vppApi);
- }
-
- @Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Lisp> id, @Nonnull final Lisp dataAfter,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- Preconditions.checkNotNull(dataAfter, "Lisp is null");
-
- try {
- enableDisableLisp(dataAfter.isEnable());
- } catch (VppBaseCallException | TimeoutException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
- }
-
- @Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Lisp> id, @Nonnull final Lisp dataBefore,
- @Nonnull final Lisp dataAfter, @Nonnull final WriteContext writeContext)
- throws WriteFailedException {
- Preconditions.checkNotNull(dataAfter, "Lisp is null");
-
- try {
- enableDisableLisp(dataAfter.isEnable());
- } catch (VppBaseCallException | TimeoutException e) {
- throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter, e);
- }
- }
-
- @Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Lisp> id, @Nonnull final Lisp dataBefore,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- Preconditions.checkNotNull(dataBefore, "Lisp is null");
-
- try {
- enableDisableLisp(false);
- } catch (VppBaseCallException | TimeoutException e) {
- throw new WriteFailedException.DeleteFailedException(id, e);
- }
-
- }
-
-
- private void enableDisableLisp(final boolean enable) throws VppBaseCallException, TimeoutException {
- final CompletionStage<LispEnableDisableReply> lispEnableDisableReplyCompletionStage =
- getFutureJVpp().lispEnableDisable(getRequest(enable));
- getReply(lispEnableDisableReplyCompletionStage.toCompletableFuture());
- }
-
- private LispEnableDisable getRequest(final boolean enable) {
- final LispEnableDisable lispEnableDisable = new LispEnableDisable();
- lispEnableDisable.isEn = booleanToByte(enable);
- return lispEnableDisable;
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LocalMappingCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LocalMappingCustomizer.java
deleted file mode 100755
index 93f39f4..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LocalMappingCustomizer.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV4;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV6;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.trait.MappingProducer;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.io.UnsupportedEncodingException;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMappingKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispAddDelLocalEid;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Customizer that writes changes for {@link LocalMapping}
- */
-public class LocalMappingCustomizer extends FutureJVppCustomizer
- implements ListWriterCustomizer<LocalMapping, LocalMappingKey>, ByteDataTranslator, EidTranslator,
- JvppReplyConsumer, MappingProducer {
-
- private final EidMappingContext localMappingsContext;
-
- public LocalMappingCustomizer(@Nonnull FutureJVppCore futureJvpp, @Nonnull EidMappingContext localMappingsContext) {
- super(futureJvpp);
- this.localMappingsContext = checkNotNull(localMappingsContext, "No local mappings context defined");
- }
-
- @Override
- public void writeCurrentAttributes(InstanceIdentifier<LocalMapping> id, LocalMapping dataAfter,
- WriteContext writeContext) throws WriteFailedException {
- checkNotNull(dataAfter, "Mapping is null");
- checkNotNull(dataAfter.getEid(), "Eid is null");
- checkNotNull(dataAfter.getLocatorSet(), "Locator set is null");
- checkState(id.firstKeyOf(VniTable.class) != null, "Parent vni table not found");
- checkAllowedCombination(id, dataAfter);
-
- //checks whether value with specified mapping-id does not exist in mapping allready
- final MappingId mappingId = id.firstKeyOf(LocalMapping.class).getId();
- checkState(!localMappingsContext
- .containsEid(mappingId, writeContext.getMappingContext()),
- "Local mapping with id %s already defined", id);
-
-
- try {
- addDelMappingAndReply(true, dataAfter,
- id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier().intValue());
- } catch (VppBaseCallException | TimeoutException | UnsupportedEncodingException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
-
- //adds mapping for id and eid
- localMappingsContext.addEid(mappingId, dataAfter.getEid(), writeContext.getMappingContext());
- }
-
- @Override
- public void updateCurrentAttributes(InstanceIdentifier<LocalMapping> id, LocalMapping dataBefore,
- LocalMapping dataAfter, WriteContext writeContext)
- throws WriteFailedException {
- throw new UnsupportedOperationException("Operation not supported");
- }
-
- @Override
- public void deleteCurrentAttributes(InstanceIdentifier<LocalMapping> id, LocalMapping dataBefore,
- WriteContext writeContext) throws WriteFailedException {
- checkNotNull(dataBefore, "Mapping is null");
- checkNotNull(dataBefore.getEid(), "Eid is null");
- checkNotNull(dataBefore.getLocatorSet(), "LocatorSet is null");
- checkState(id.firstKeyOf(VniTable.class) != null, "Parent vni table not found");
-
- //checks whether value with specified mapping-id does exist in mapping,so there is something to delete
- MappingId mappingId = id.firstKeyOf(LocalMapping.class).getId();
- checkState(localMappingsContext
- .containsEid(mappingId, writeContext.getMappingContext()),
- "Local mapping with id %s not present in mapping", id);
-
- try {
- addDelMappingAndReply(false, dataBefore,
- id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier().intValue());
- } catch (VppBaseCallException | TimeoutException | UnsupportedEncodingException e) {
- throw new WriteFailedException.DeleteFailedException(id, e);
- }
-
- //removes value also from mapping
- localMappingsContext.removeEid(mappingId, writeContext.getMappingContext());
- }
-
- private void addDelMappingAndReply(boolean add, LocalMapping data, int vni) throws VppBaseCallException,
- TimeoutException, UnsupportedEncodingException {
-
- LispAddDelLocalEid request = new LispAddDelLocalEid();
-
- request.isAdd = booleanToByte(add);
- request.eid = getEidAsByteArray(data.getEid());
- request.eidType = (byte) getEidType(data.getEid()).getValue();
- request.locatorSetName = data.getLocatorSet().getBytes(UTF_8);
- request.vni = vni;
-
- //default prefixes
- if (request.eidType == IPV4.getValue()) {
- request.prefixLen = 32;
- } else if (request.eidType == IPV6.getValue()) {
- request.prefixLen = (byte) 128;
- }
-
- getReply(getFutureJVpp().lispAddDelLocalEid(request).toCompletableFuture());
- }
-
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LocatorSetCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LocatorSetCustomizer.java
deleted file mode 100755
index 7492558..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/LocatorSetCustomizer.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import io.fd.honeycomb.lisp.translate.read.trait.LocatorSetReader;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
-import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.vpp.jvpp.core.dto.LispAddDelLocatorSet;
-import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetailsReplyDump;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.List;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.Interface;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-/**
- * Customizer for {@link LocatorSet} entity.
- *
- * @see LocatorSet
- */
-public class LocatorSetCustomizer extends FutureJVppCustomizer
- implements ListWriterCustomizer<LocatorSet, LocatorSetKey>, ByteDataTranslator,
- LocatorSetReader {
-
- private final NamingContext locatorSetContext;
-
- public LocatorSetCustomizer(@Nonnull final FutureJVppCore futureJvpp,
- @Nonnull final NamingContext locatorSetContext) {
- super(futureJvpp);
- this.locatorSetContext = checkNotNull(locatorSetContext, "Locator set context cannot be null");
- }
-
- @Override
- public void writeCurrentAttributes(@Nonnull InstanceIdentifier<LocatorSet> id,
- @Nonnull LocatorSet dataAfter,
- @Nonnull WriteContext writeContext) throws WriteFailedException {
- checkState(isNonEmptyLocatorSet(writeContext.readAfter(id).get()),
- "Creating empty locator-sets is not allowed");
- final String locatorSetName = dataAfter.getName();
- checkState(!locatorSetContext.containsIndex(locatorSetName, writeContext.getMappingContext()),
- "Locator set with name %s already defined", locatorSetName);
-
- final int locatorSetIndex = addDelLocatorSetAndReply(true, dataAfter.getName(), id);
- locatorSetContext.addName(locatorSetIndex, locatorSetName, writeContext.getMappingContext());
- }
-
- private boolean isNonEmptyLocatorSet(final LocatorSet locatorSet) {
- final List<Interface> locators = locatorSet.getInterface();
- return locators != null && !locators.isEmpty();
- }
-
- @Override
- public void updateCurrentAttributes(@Nonnull InstanceIdentifier<LocatorSet> id,
- @Nonnull LocatorSet dataBefore,
- @Nonnull LocatorSet dataAfter,
- @Nonnull WriteContext writeContext) throws WriteFailedException {
- throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
- new UnsupportedOperationException("Operation not supported"));
- }
-
- @Override
- public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<LocatorSet> id,
- @Nonnull LocatorSet dataBefore,
- @Nonnull WriteContext writeContext) throws WriteFailedException {
- final String locatorSetName = dataBefore.getName();
- addDelLocatorSetAndReply(false, dataBefore.getName(), id);
- //removes mapping after successful delete
- locatorSetContext.removeName(locatorSetName, writeContext.getMappingContext());
- }
-
- private int addDelLocatorSetAndReply(final boolean add, final String name, final InstanceIdentifier<LocatorSet> id)
- throws WriteFailedException {
-
- LispAddDelLocatorSet addDelSet = new LispAddDelLocatorSet();
-
- addDelSet.isAdd = booleanToByte(add);
- addDelSet.locatorSetName = name.getBytes(UTF_8);
-
- return getReplyForWrite(getFutureJVpp().lispAddDelLocatorSet(addDelSet).toCompletableFuture(), id).lsIndex;
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/MapResolverCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/MapResolverCustomizer.java
deleted file mode 100755
index 42066c4..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/MapResolverCustomizer.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.AddressTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolver;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolverKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispAddDelMapResolver;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Handles updates of {@link MapResolver} list
- */
-public class MapResolverCustomizer extends FutureJVppCustomizer
- implements ListWriterCustomizer<MapResolver, MapResolverKey>, AddressTranslator,
- JvppReplyConsumer {
-
- public MapResolverCustomizer(final FutureJVppCore vppApi) {
- super(vppApi);
- }
-
- @Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<MapResolver> id,
- @Nonnull final MapResolver dataAfter, @Nonnull final WriteContext writeContext)
- throws WriteFailedException {
-
- checkNotNull(dataAfter, "Data is null");
- checkNotNull(dataAfter.getIpAddress(), "Address is null");
-
- try {
- addDelMapResolverAndReply(true, dataAfter);
- } catch (VppBaseCallException | TimeoutException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
- }
-
- @Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<MapResolver> id,
- @Nonnull final MapResolver dataBefore, @Nonnull final MapResolver dataAfter,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- throw new UnsupportedOperationException("Operation not supported");
- }
-
- @Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<MapResolver> id,
- @Nonnull final MapResolver dataBefore, @Nonnull final WriteContext writeContext)
- throws WriteFailedException {
-
- checkNotNull(dataBefore, "Data is null");
- checkNotNull(dataBefore.getIpAddress(), "Address is null");
-
- try {
- addDelMapResolverAndReply(false, dataBefore);
- } catch (VppBaseCallException | TimeoutException e) {
- throw new WriteFailedException.CreateFailedException(id, dataBefore, e);
- }
- }
-
- private void addDelMapResolverAndReply(boolean add, MapResolver data) throws VppBaseCallException,
- TimeoutException {
-
- LispAddDelMapResolver request = new LispAddDelMapResolver();
- request.isAdd = booleanToByte(add);
-
-
- boolean ipv6 = isIpv6(data.getIpAddress());
-
- request.isIpv6 = booleanToByte(ipv6);
- request.ipAddress = ipAddressToArray(ipv6, data.getIpAddress());
-
- getReply(getFutureJVpp().lispAddDelMapResolver(request).toCompletableFuture());
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/PitrCfgCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/PitrCfgCustomizer.java
deleted file mode 100755
index 035db3c..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/PitrCfgCustomizer.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.util.concurrent.TimeoutException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.pitr.cfg.grouping.PitrCfg;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispPitrSetLocatorSet;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Customizer for {@code PitrCfg}
- */
-public class PitrCfgCustomizer extends FutureJVppCustomizer
- implements WriterCustomizer<PitrCfg>, JvppReplyConsumer, ByteDataTranslator {
-
- private static final String DEFAULT_LOCATOR_SET_NAME = "N/A";
-
- public PitrCfgCustomizer(FutureJVppCore futureJvpp) {
- super(futureJvpp);
- }
-
- @Override
- public void writeCurrentAttributes(InstanceIdentifier<PitrCfg> id, PitrCfg dataAfter, WriteContext writeContext)
- throws WriteFailedException {
- checkNotNull(dataAfter, "PitrCfg is null");
- checkNotNull(dataAfter.getLocatorSet(), "Locator set name is null");
-
- try {
- addDelPitrSetLocatorSetAndReply(true, dataAfter);
- } catch (VppBaseCallException | TimeoutException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
- }
-
- @Override
- public void updateCurrentAttributes(InstanceIdentifier<PitrCfg> id, PitrCfg dataBefore, PitrCfg dataAfter,
- WriteContext writeContext) throws WriteFailedException {
- checkNotNull(dataAfter, "PitrCfg is null");
- checkNotNull(dataAfter.getLocatorSet(), "Locator set name is null");
-
- try {
- addDelPitrSetLocatorSetAndReply(true, dataAfter);
- } catch (VppBaseCallException | TimeoutException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
- }
-
- @Override
- public void deleteCurrentAttributes(InstanceIdentifier<PitrCfg> id, PitrCfg dataBefore, WriteContext writeContext)
- throws WriteFailedException {
- checkNotNull(dataBefore, "PitrCfg is null");
- checkNotNull(dataBefore.getLocatorSet(), "Locator set name is null");
-
- try {
- addDelPitrSetLocatorSetAndReply(false, dataBefore);
- } catch (VppBaseCallException | TimeoutException e) {
- throw new WriteFailedException.CreateFailedException(id, dataBefore, e);
- }
- }
-
- private void addDelPitrSetLocatorSetAndReply(boolean add, PitrCfg data)
- throws VppBaseCallException, TimeoutException {
-
- if (DEFAULT_LOCATOR_SET_NAME.equals(data.getLocatorSet())) {
- // ignores attempts to write default locator set
- // therefore even while its loaded to config data of honeycomb while starting
- // you can still enable/disable Lisp without having to define N/A as default pitr-set
- return;
- }
-
- LispPitrSetLocatorSet request = new LispPitrSetLocatorSet();
- request.isAdd = booleanToByte(add);
- request.lsName = data.getLocatorSet().getBytes(UTF_8);
-
- getReply(getFutureJVpp().lispPitrSetLocatorSet(request).toCompletableFuture());
- }
-
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/RemoteMappingCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/RemoteMappingCustomizer.java
deleted file mode 100755
index cb4313b..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/RemoteMappingCustomizer.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static io.fd.honeycomb.lisp.translate.write.RemoteMappingCustomizer.LocatorListType.NEGATIVE;
-import static io.fd.honeycomb.lisp.translate.write.RemoteMappingCustomizer.LocatorListType.POSITIVE;
-
-import com.google.common.base.Preconditions;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.trait.MappingProducer;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.AddressTranslator;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MapReplyAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMappingKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.LocatorList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.NegativeMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.PositiveMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.Rlocs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.rlocs.Locator;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispAddDelRemoteMapping;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Customizer for {@link RemoteMapping}
- */
-public class RemoteMappingCustomizer extends FutureJVppCustomizer
- implements ListWriterCustomizer<RemoteMapping, RemoteMappingKey>, EidTranslator,
- AddressTranslator, JvppReplyConsumer, MappingProducer {
-
- private final EidMappingContext remoteMappingContext;
-
- public RemoteMappingCustomizer(@Nonnull final FutureJVppCore futureJvpp,
- @Nonnull final EidMappingContext remoteMappingContext) {
- super(futureJvpp);
- this.remoteMappingContext = remoteMappingContext;
- }
-
- @Override
- public void writeCurrentAttributes(InstanceIdentifier<RemoteMapping> id, RemoteMapping dataAfter,
- WriteContext writeContext) throws WriteFailedException {
- checkNotNull(dataAfter, "Mapping is null");
- checkNotNull(dataAfter.getEid(), "Eid is null");
- checkState(id.firstKeyOf(VniTable.class) != null, "Parent vni table not found");
- checkAllowedCombination(id, dataAfter);
-
- //checks whether mapping not already contains such key
- MappingId mappingId = id.firstKeyOf(RemoteMapping.class).getId();
- checkState(!remoteMappingContext.containsEid(mappingId, writeContext.getMappingContext()),
- "Mapping for id %s already defined", mappingId);
-
- try {
- addDelRemoteMappingAndReply(true, dataAfter,
- id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier().intValue());
- } catch (VppBaseCallException | TimeoutException | IOException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
-
- //after successfull adition adds mapping
- remoteMappingContext.addEid(mappingId, dataAfter.getEid(), writeContext.getMappingContext());
- }
-
- @Override
- public void updateCurrentAttributes(InstanceIdentifier<RemoteMapping> id, RemoteMapping dataBefore,
- RemoteMapping dataAfter, WriteContext writeContext)
- throws WriteFailedException {
- throw new UnsupportedOperationException("Operation not supported");
- }
-
- @Override
- public void deleteCurrentAttributes(InstanceIdentifier<RemoteMapping> id, RemoteMapping dataBefore,
- WriteContext writeContext) throws WriteFailedException {
- checkNotNull(dataBefore, "Mapping is null");
- checkNotNull(dataBefore.getEid(), "Eid is null");
-
- //checks whether mapping already contains such key
- MappingId mappingId = id.firstKeyOf(RemoteMapping.class).getId();
- checkState(remoteMappingContext.containsEid(mappingId, writeContext.getMappingContext()),
- "Mapping for id %s is not existing,nothing to remove", mappingId);
-
- try {
- addDelRemoteMappingAndReply(false, dataBefore,
- id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier().intValue());
- } catch (VppBaseCallException | TimeoutException | IOException e) {
- throw new WriteFailedException.DeleteFailedException(id, e);
- }
-
- //remote mapping after successfull remove of data
- remoteMappingContext.removeEid(mappingId, writeContext.getMappingContext());
- }
-
- private void addDelRemoteMappingAndReply(boolean add, RemoteMapping data, int vni)
- throws VppBaseCallException, TimeoutException, IOException {
-
- LispAddDelRemoteMapping request = new LispAddDelRemoteMapping();
-
- request.isAdd = booleanToByte(add);
- request.vni = vni;
- request.eidType = (byte) getEidType(data.getEid()).getValue();
- request.eid = getEidAsByteArray(data.getEid());
-
- //this is not length of eid array,but prefix length(bad naming by vpp)
- request.eidLen = getPrefixLength(data.getEid());
-
- if (LocatorListType.NEGATIVE
- .equals(resolveType(data.getLocatorList()))) {
- request.action = (byte) extractAction(data.getLocatorList()).getIntValue();
- } else {
- Rlocs rlocs = extractRemoteLocators(data.getLocatorList());
-
- checkArgument(rlocs != null, "No remote locators set for Positive mapping");
-
- request.rlocs = locatorsToBinaryData(rlocs.getLocator());
- request.rlocNum = Integer.valueOf(rlocs.getLocator().size()).byteValue();
- }
-
- getReply(getFutureJVpp().lispAddDelRemoteMapping(request).toCompletableFuture());
- }
-
- private static LocatorListType resolveType(LocatorList locatorList) {
- checkNotNull(locatorList, "Locator List cannot be null");
-
- if (locatorList instanceof PositiveMapping) {
- return POSITIVE;
- } else {
- return NEGATIVE;
- }
- }
-
- private static MapReplyAction extractAction(LocatorList locatorList) {
- checkNotNull(locatorList, "Locator List cannot be null");
- Preconditions.checkArgument(NEGATIVE.equals(resolveType(locatorList)),
- "Action can be extracted only from Negative Mapping");
-
- return ((NegativeMapping) locatorList).getMapReply().getMapReplyAction();
- }
-
- private static Rlocs extractRemoteLocators(LocatorList locatorList) {
- checkNotNull(locatorList, "Locator List cannot be null");
- Preconditions.checkArgument(POSITIVE.equals(resolveType(locatorList)),
- "RLocs can be extracted only from Positive Mapping");
-
- return ((PositiveMapping) locatorList).getRlocs();
- }
-
- //cant be static because of use of default methods from traits
- private byte[] locatorsToBinaryData(List<Locator> locators) throws IOException {
- checkNotNull(locators, "Cannot convert null list");
-
- ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
-
- DataOutputStream out = new DataOutputStream(byteArrayOut);
-
-
- for (Locator locator : locators) {
- boolean isIpv4;
- byte[] address;
-
- //first byte says that its v4/v6
- isIpv4 = !isIpv6(locator.getAddress());
- out.writeByte(booleanToByte(isIpv4));
-
- //then writes priority
- out.write(locator.getPriority());
-
- //and weight
- out.write(locator.getWeight());
-
- if (isIpv4) {
- //vpp in this case needs address as 16 byte array,regardless if it is ivp4 or ipv6
- address = Arrays.copyOf(
-
- ipv4AddressNoZoneToArray(new Ipv4AddressNoZone(locator.getAddress().getIpv4Address())),
- 16);
-
- out.write(address);
- } else {
- out.write(
- ipv6AddressNoZoneToArray(new Ipv6AddressNoZone(locator.getAddress().getIpv6Address())));
- }
- }
-
- return byteArrayOut.toByteArray();
- }
-
- public enum LocatorListType {
-
- /**
- * Represents locator list as negative mapping
- */
- NEGATIVE,
-
- /**
- * Represents locator list as positive mapping
- */
- POSITIVE
- }
-
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/VniTableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/VniTableCustomizer.java
deleted file mode 100755
index 005b336..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/VniTableCustomizer.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static com.google.common.base.Preconditions.checkState;
-
-import com.google.common.base.Optional;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
-import io.fd.honeycomb.translate.util.RWUtils;
-
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * This customizer serves only as a check if user is not trying to define VniTable <br>
- * without mapping to vrf/bd
- */
-public class VniTableCustomizer extends FutureJVppCustomizer implements ListWriterCustomizer<VniTable, VniTableKey> {
-
- private static final Logger LOG = LoggerFactory.getLogger(VniTableCustomizer.class);
-
- public VniTableCustomizer(FutureJVppCore futureJvpp) {
- super(futureJvpp);
- }
-
- @Override
- public void writeCurrentAttributes(InstanceIdentifier<VniTable> id, VniTable dataAfter, WriteContext writeContext)
- throws WriteFailedException {
- checkAtLeastOnChildExists(id, writeContext, false);
- }
-
- @Override
- public void updateCurrentAttributes(InstanceIdentifier<VniTable> id, VniTable dataBefore, VniTable dataAfter,
- WriteContext writeContext) throws WriteFailedException {
- throw new UnsupportedOperationException("Operation not supported");
- }
-
- @Override
- public void deleteCurrentAttributes(InstanceIdentifier<VniTable> id, VniTable dataBefore, WriteContext writeContext)
- throws WriteFailedException {
- checkAtLeastOnChildExists(id, writeContext, true);
- }
-
- private void checkAtLeastOnChildExists(final InstanceIdentifier<VniTable> id, final WriteContext writeContext,
- final boolean before) {
-
- Optional<VniTable> optData;
- final InstanceIdentifier<VniTable> trimmedId = RWUtils.cutId(id, InstanceIdentifier.create(VniTable.class));
- if (before) {
- optData = writeContext.readBefore(trimmedId);
- } else {
- optData = writeContext.readAfter(trimmedId);
- }
-
- checkState(optData.isPresent(), "Illegal after-write state");
-
- final VniTable dataAfter = optData.get();
- checkState(dataAfter.getVrfSubtable() != null || dataAfter.getBridgeDomainSubtable() != null,
- "At least one of VrfSubtable/BridgeDomainSubtable must be defined");
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/VrfSubtableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/VrfSubtableCustomizer.java
deleted file mode 100644
index a977871..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/VrfSubtableCustomizer.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import io.fd.honeycomb.lisp.translate.write.trait.SubtableWriter;
-import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
-import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class VrfSubtableCustomizer extends FutureJVppCustomizer
- implements WriterCustomizer<VrfSubtable>, SubtableWriter {
-
- private static final Logger LOG = LoggerFactory.getLogger(VrfSubtableCustomizer.class);
-
- public VrfSubtableCustomizer(@Nonnull final FutureJVppCore futureJvpp) {
- super(futureJvpp);
- }
-
- @Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<VrfSubtable> id,
- @Nonnull final VrfSubtable dataAfter, @Nonnull final WriteContext writeContext)
- throws WriteFailedException {
-
- LOG.debug("Writing Id[{}]/Data[{}]", id, dataAfter);
-
- try {
- addDelSubtableMapping(getFutureJVpp(), true, extractVni(id), dataAfter.getTableId().intValue(), false, LOG);
- } catch (TimeoutException | VppBaseCallException e) {
- throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
- }
-
- LOG.debug("{} successfully written", id);
- }
-
- @Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<VrfSubtable> id,
- @Nonnull final VrfSubtable dataBefore, @Nonnull final VrfSubtable dataAfter,
- @Nonnull final WriteContext writeContext) throws WriteFailedException {
- throw new UnsupportedOperationException("Operation not supported");
- }
-
- @Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<VrfSubtable> id,
- @Nonnull final VrfSubtable dataBefore, @Nonnull final WriteContext writeContext)
- throws WriteFailedException {
-
- LOG.debug("Removing Id[{}]/Data[{}]", id, dataBefore);
-
- try {
- addDelSubtableMapping(getFutureJVpp(), false, extractVni(id), dataBefore.getTableId().intValue(), false,
- LOG);
- } catch (TimeoutException | VppBaseCallException e) {
- throw new WriteFailedException.CreateFailedException(id, dataBefore, e);
- }
-
- LOG.debug("{} successfully removed", id);
- }
-
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/AbstractLispWriterFactoryBase.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/AbstractLispWriterFactoryBase.java
deleted file mode 100644
index 366caf8..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/AbstractLispWriterFactoryBase.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write.factory;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.Lisp;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Basic attributes for lisp writer factories
- */
-abstract class AbstractLispWriterFactoryBase {
-
- protected final InstanceIdentifier<Lisp> lispInstanceIdentifier;
- protected final FutureJVppCore vppApi;
- protected NamingContext interfaceContext;
- protected NamingContext locatorSetContext;
- protected EidMappingContext localMappingContext;
- protected EidMappingContext remoteMappingContext;
-
- protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- @Nonnull final FutureJVppCore vppApi,
- NamingContext interfaceContext) {
- this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
- this.interfaceContext = interfaceContext;
- }
-
- protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- @Nonnull final FutureJVppCore vppApi,
- NamingContext interfaceContext,
- NamingContext locatorSetContext) {
- this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
- this.interfaceContext = interfaceContext;
- this.locatorSetContext = locatorSetContext;
- }
-
- protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- @Nonnull final FutureJVppCore vppApi,
- EidMappingContext localMappingContext,
- EidMappingContext remoteMappingContext) {
- this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
- this.localMappingContext = localMappingContext;
- this.remoteMappingContext = remoteMappingContext;
- }
-
- protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- @Nonnull final FutureJVppCore vppApi,
- NamingContext interfaceContext,
- NamingContext locatorSetContext,
- EidMappingContext localMappingContext,
- EidMappingContext remoteMappingContext) {
- this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
- this.interfaceContext = interfaceContext;
- this.locatorSetContext = locatorSetContext;
- this.localMappingContext = localMappingContext;
- this.remoteMappingContext = remoteMappingContext;
- }
-
- protected AbstractLispWriterFactoryBase(@Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- @Nonnull final FutureJVppCore vppApi,
- NamingContext interfaceContext,
- EidMappingContext localMappingContext,
- EidMappingContext remoteMappingContext) {
- this.lispInstanceIdentifier = checkNotNull(lispInstanceIdentifier, "Lisp identifier is null");
- this.vppApi = checkNotNull(vppApi, "VPP Api refference is null");
- this.interfaceContext = interfaceContext;
- this.localMappingContext = localMappingContext;
- this.remoteMappingContext = remoteMappingContext;
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/LispWriterFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/LispWriterFactory.java
deleted file mode 100755
index 055aa72..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/LispWriterFactory.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write.factory;
-
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.ADJACENCIES_IDENTIFICATION_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.INTERFACE_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.LOCAL_MAPPING_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.LOCATOR_SET_CONTEXT;
-import static io.fd.honeycomb.lisp.cfgattrs.LispConfiguration.REMOTE_MAPPING_CONTEXT;
-
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.write.LispCustomizer;
-import io.fd.honeycomb.lisp.translate.write.PitrCfgCustomizer;
-import io.fd.honeycomb.translate.impl.write.GenericWriter;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.Lisp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.pitr.cfg.grouping.PitrCfg;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-/**
- * Initialize writers for {@link Lisp}
- */
-public final class LispWriterFactory extends AbstractLispWriterFactoryBase implements WriterFactory {
-
- private final NamingContext bridgeDomainContext;
- private final AdjacenciesMappingContext adjacenciesMappingContext;
-
- @Inject
- public LispWriterFactory(final FutureJVppCore vppApi,
- @Named(INTERFACE_CONTEXT) final NamingContext interfaceContext,
- @Named(LOCATOR_SET_CONTEXT) final NamingContext locatorSetContext,
- @Named("bridge-domain-context") final NamingContext bridgeDomainContext,
- @Named(LOCAL_MAPPING_CONTEXT) final EidMappingContext localMappingContext,
- @Named(REMOTE_MAPPING_CONTEXT) final EidMappingContext remoteMappingContext,
- @Named(ADJACENCIES_IDENTIFICATION_CONTEXT) final AdjacenciesMappingContext adjacenciesMappingContext) {
- super(InstanceIdentifier.create(Lisp.class), vppApi, interfaceContext, locatorSetContext, localMappingContext,
- remoteMappingContext);
- this.bridgeDomainContext = checkNotNull(bridgeDomainContext, "Bridge domain context cannot be null");
- this.adjacenciesMappingContext =
- checkNotNull(adjacenciesMappingContext, "Adjacencies mapping context cannot be null");
- }
-
- @Override
- public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) {
- registry.add(new GenericWriter<>(lispInstanceIdentifier, new LispCustomizer(vppApi)));
-
- VniTableWriterFactory.newInstance(lispInstanceIdentifier, vppApi, localMappingContext, remoteMappingContext,
- bridgeDomainContext, adjacenciesMappingContext)
- .init(registry);
- LocatorSetsWriterFactory.newInstance(lispInstanceIdentifier, vppApi, interfaceContext, locatorSetContext)
- .init(registry);
- MapResolversWriterFactory.newInstance(lispInstanceIdentifier, vppApi).init(registry);
-
- registry.add(new GenericWriter<>(lispInstanceIdentifier.child(LispFeatureData.class).child(PitrCfg.class),
- new PitrCfgCustomizer(vppApi)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/LocatorSetsWriterFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/LocatorSetsWriterFactory.java
deleted file mode 100755
index eabdfe2..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/LocatorSetsWriterFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write.factory;
-
-import io.fd.honeycomb.lisp.translate.write.InterfaceCustomizer;
-import io.fd.honeycomb.lisp.translate.write.LocatorSetCustomizer;
-import io.fd.honeycomb.translate.impl.write.GenericListWriter;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.Lisp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.LocatorSets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.Interface;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Factory producing writers for {@code LocatorSets}
- */
-final class LocatorSetsWriterFactory extends AbstractLispWriterFactoryBase implements WriterFactory {
-
- private LocatorSetsWriterFactory(final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- final FutureJVppCore vppApi,
- final NamingContext interfaceContext,
- final NamingContext locatorSetContext) {
- super(lispInstanceIdentifier, vppApi, interfaceContext, locatorSetContext);
- }
-
- public static LocatorSetsWriterFactory newInstance(
- @Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- @Nonnull final FutureJVppCore vppApi,
- @Nonnull final NamingContext interfaceContext,
- @Nonnull final NamingContext locatorSetContext) {
- return new LocatorSetsWriterFactory(lispInstanceIdentifier, vppApi, interfaceContext, locatorSetContext);
- }
-
- @Override
- public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) {
- InstanceIdentifier<LocatorSet> locatorSetId =
- lispInstanceIdentifier.child(LispFeatureData.class).child(LocatorSets.class).child(LocatorSet.class);
-
- registry.add(new GenericListWriter<>(locatorSetId, new LocatorSetCustomizer(vppApi, locatorSetContext)));
- registry.add(new GenericListWriter<>(locatorSetId.child(Interface.class),
- new InterfaceCustomizer(vppApi, interfaceContext)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/MapResolversWriterFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/MapResolversWriterFactory.java
deleted file mode 100755
index 0586f88..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/MapResolversWriterFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write.factory;
-
-
-import io.fd.honeycomb.lisp.translate.write.MapResolverCustomizer;
-import io.fd.honeycomb.translate.impl.write.GenericListWriter;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.Lisp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.MapResolvers;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolver;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-
-/**
- * Factory responsible for producing writers for {@code MapResolvers}
- */
-final class MapResolversWriterFactory extends AbstractLispWriterFactoryBase implements WriterFactory {
-
- private MapResolversWriterFactory(final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- final FutureJVppCore vppApi) {
- super(lispInstanceIdentifier, vppApi, null);
- }
-
- public static MapResolversWriterFactory newInstance(
- @Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- @Nonnull final FutureJVppCore vppApi) {
- return new MapResolversWriterFactory(lispInstanceIdentifier, vppApi);
- }
-
- @Override
- public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) {
- registry.add(new GenericListWriter<>(
- lispInstanceIdentifier.child(LispFeatureData.class).child(MapResolvers.class).child(MapResolver.class),
- new MapResolverCustomizer(vppApi)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/VniTableWriterFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/VniTableWriterFactory.java
deleted file mode 100755
index 9e9152c..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/factory/VniTableWriterFactory.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write.factory;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.collect.ImmutableSet;
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.write.AdjacencyCustomizer;
-import io.fd.honeycomb.lisp.translate.write.BridgeDomainSubtableCustomizer;
-import io.fd.honeycomb.lisp.translate.write.LocalMappingCustomizer;
-import io.fd.honeycomb.lisp.translate.write.RemoteMappingCustomizer;
-import io.fd.honeycomb.lisp.translate.write.VniTableCustomizer;
-import io.fd.honeycomb.lisp.translate.write.VrfSubtableCustomizer;
-import io.fd.honeycomb.translate.impl.write.GenericListWriter;
-import io.fd.honeycomb.translate.impl.write.GenericWriter;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.Lisp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.Adjacencies;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.Adjacency;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.LocalEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.RemoteEid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.LocalMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.negative.mapping.MapReply;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.Rlocs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.rlocs.Locator;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureData;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-//TODO - HONEYCOMB-282 - refactor this and other factories for better readability
-
-/**
- * Factory for producing writers for {@code EidTable}
- */
-final class VniTableWriterFactory extends AbstractLispWriterFactoryBase implements WriterFactory {
-
- private final NamingContext bridgeDomainContext;
- private final AdjacenciesMappingContext adjacenciesMappingContext;
-
- private VniTableWriterFactory(final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- final FutureJVppCore vppApi,
- final EidMappingContext localMappingContext,
- final EidMappingContext remoteMappingContext,
- final NamingContext bridgeDomainContext,
- final AdjacenciesMappingContext adjacenciesMappingContext) {
- super(lispInstanceIdentifier, vppApi, localMappingContext, remoteMappingContext);
- this.bridgeDomainContext = checkNotNull(bridgeDomainContext, "Bridge domain context cannot be null");
- this.adjacenciesMappingContext =
- checkNotNull(adjacenciesMappingContext, "Adjacencies mapping context cannot be null");
- }
-
- public static VniTableWriterFactory newInstance(
- @Nonnull final InstanceIdentifier<Lisp> lispInstanceIdentifier,
- @Nonnull final FutureJVppCore vppApi,
- @Nonnull final EidMappingContext localMappingContext,
- @Nonnull final EidMappingContext remoteMappingContext,
- @Nonnull final NamingContext bridgeDomainContext,
- @Nonnull final AdjacenciesMappingContext adjacenciesMappingContext) {
- return new VniTableWriterFactory(lispInstanceIdentifier, vppApi, localMappingContext, remoteMappingContext,
- bridgeDomainContext, adjacenciesMappingContext);
- }
-
- @Override
- public void init(final ModifiableWriterRegistryBuilder registry) {
- final InstanceIdentifier<VniTable> vniTableId =
- lispInstanceIdentifier.child(LispFeatureData.class).child(EidTable.class).child(VniTable.class);
-
- final InstanceIdentifier<VrfSubtable> vrfSubtableId = vniTableId.child(VrfSubtable.class);
- final InstanceIdentifier<BridgeDomainSubtable> bridgeDomainSubtableId =
- vniTableId.child(BridgeDomainSubtable.class);
-
- registry.add(new GenericListWriter<>(vniTableId, new VniTableCustomizer(vppApi)));
-
- registry.add(new GenericWriter<>(vrfSubtableId, new VrfSubtableCustomizer(vppApi)));
- registry.add(new GenericWriter<>(bridgeDomainSubtableId,
- new BridgeDomainSubtableCustomizer(vppApi, bridgeDomainContext)));
-
- //VniTable - > VrfSubtable -> LocalMappings - > LocalMapping
- final InstanceIdentifier<LocalMapping> localMappingSubtreeId = InstanceIdentifier.create(LocalMapping.class);
- registry.subtreeAdd(ImmutableSet.of(localMappingSubtreeId
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid.class)),
- new GenericListWriter<>(
- vrfSubtableId.child(LocalMappings.class).child(LocalMapping.class),
- new LocalMappingCustomizer(vppApi, localMappingContext)));
- //VniTable - > BridgeDomainSubtable -> LocalMappings - > LocalMapping
- registry.subtreeAdd(ImmutableSet.of(localMappingSubtreeId
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid.class)),
- new GenericListWriter<>(bridgeDomainSubtableId.child(LocalMappings.class)
- .child(LocalMapping.class),
- new LocalMappingCustomizer(vppApi, localMappingContext)));
-
- //VniTable - > VrfSubtable -> RemoteMappings - > RemoteMapping
- final InstanceIdentifier<RemoteMapping> remoteMappingSubtreeId = InstanceIdentifier.create(RemoteMapping.class);
- registry.subtreeAdd(ImmutableSet.of(remoteMappingSubtreeId
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid.class),
- remoteMappingSubtreeId.child(Rlocs.class),
- remoteMappingSubtreeId.child(Rlocs.class).child(Locator.class),
- remoteMappingSubtreeId.child(MapReply.class)),
- new GenericListWriter<>(
- vrfSubtableId.child(RemoteMappings.class).child(RemoteMapping.class),
- new RemoteMappingCustomizer(vppApi, remoteMappingContext)));
- //VniTable - > BridgeDomainSubtable -> RemoteMappings - > RemoteMapping
- registry.subtreeAdd(ImmutableSet.of(remoteMappingSubtreeId
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid.class),
- remoteMappingSubtreeId.child(Rlocs.class),
- remoteMappingSubtreeId.child(Rlocs.class).child(Locator.class),
- remoteMappingSubtreeId.child(MapReply.class)),
- new GenericListWriter<>(bridgeDomainSubtableId.child(RemoteMappings.class)
- .child(RemoteMapping.class),
- new RemoteMappingCustomizer(vppApi, remoteMappingContext)));
-
- //VniTable - > VrfSubtable -> RemoteMappings - > RemoteMapping - > Adjacencies - > Adjacency
- final InstanceIdentifier<Adjacency> adjacencySubtreeId = InstanceIdentifier.create(Adjacency.class);
- registry.subtreeAdd(ImmutableSet.of(adjacencySubtreeId
- .child(LocalEid.class), adjacencySubtreeId.child(RemoteEid.class)),
- new GenericListWriter<>(
- vrfSubtableId.child(RemoteMappings.class).child(RemoteMapping.class)
- .child(Adjacencies.class).child(Adjacency.class),
- new AdjacencyCustomizer(vppApi, localMappingContext, remoteMappingContext,
- adjacenciesMappingContext)));
- //VniTable - > BridgeDomainSubtable -> RemoteMappings - > RemoteMapping - > Adjacencies - > Adjacency
- registry.subtreeAdd(ImmutableSet.of(adjacencySubtreeId
- .child(LocalEid.class), adjacencySubtreeId.child(RemoteEid.class)),
- new GenericListWriter<>(
- bridgeDomainSubtableId.child(RemoteMappings.class)
- .child(RemoteMapping.class)
- .child(Adjacencies.class).child(Adjacency.class),
- new AdjacencyCustomizer(vppApi, localMappingContext, remoteMappingContext,
- adjacenciesMappingContext)));
- }
-}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/trait/SubtableWriter.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/trait/SubtableWriter.java
deleted file mode 100644
index b00bfc0..0000000
--- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/write/trait/SubtableWriter.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write.trait;
-
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.ChildOf;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.LispEidTableAddDelMap;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import org.slf4j.Logger;
-
-/**
- * Trait providing logic for writing subtables
- */
-public interface SubtableWriter extends ByteDataTranslator, JvppReplyConsumer {
- int DEFAULT_VNI = 0;
-
- /**
- * Writes mapping from {@link VniTable}
- * to {@link VrfSubtable} or
- * {@link BridgeDomainSubtable}
- *
- * @param addDel true if add,delete otherwise
- * @param vni {@link VniTable} ID
- * @param tableId if <b>isL2</b> is true, than bridge domain subtable id,else vrf subtable id
- * @param isL2 indicates whether (false) writing to L3 vrfSubtrable of (true) L2 bridgeDomainSubtrable
- */
- default void addDelSubtableMapping(@Nonnull final FutureJVppCore vppApi, final boolean addDel, final int vni,
- final int tableId,
- final boolean isL2,
- final Logger logger) throws TimeoutException, VppBaseCallException {
-
- if (vni == DEFAULT_VNI) {
- // attempt to write subtable with default vni mapping(it does'nt make sense and it should'nt be possible)
- // also allows to enable lisp without defining default mapping in request
- logger.info("An attempt to write subtable[id = {}] with default vni {} was detected, ignoring write",
- tableId, DEFAULT_VNI);
- return;
- }
-
- checkNotNull(vppApi, "VPP Api refference cannot be null");
-
- LispEidTableAddDelMap request = new LispEidTableAddDelMap();
-
- request.isAdd = booleanToByte(addDel);
- request.vni = vni;
- request.dpTable = tableId;
- request.isL2 = booleanToByte(isL2);
-
- getReply(vppApi.lispEidTableAddDelMap(request).toCompletableFuture());
- }
-
- default int extractVni(@Nonnull final InstanceIdentifier<? extends ChildOf<VniTable>> id) {
- return checkNotNull(
- checkNotNull(id, "Identifier cannot be null").firstKeyOf(VniTable.class),
- "Parent VNI id not defined").getVirtualNetworkIdentifier().intValue();
- }
-}
diff --git a/lisp/lisp2vpp/src/main/resources/honeycomb-minimal-resources/config/lisp.json b/lisp/lisp2vpp/src/main/resources/honeycomb-minimal-resources/config/lisp.json
deleted file mode 100644
index 7a73a41..0000000
--- a/lisp/lisp2vpp/src/main/resources/honeycomb-minimal-resources/config/lisp.json
+++ /dev/null
@@ -1,2 +0,0 @@
-{
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java
deleted file mode 100644
index 20c6aa3..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.honeycomb.lisp;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.Matchers.empty;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.mockito.MockitoAnnotations.initMocks;
-
-import com.google.inject.Guice;
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import com.google.inject.testing.fieldbinder.Bind;
-import com.google.inject.testing.fieldbinder.BoundFieldModule;
-import io.fd.honeycomb.translate.read.ReaderFactory;
-import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder;
-import io.fd.honeycomb.translate.impl.write.registry.FlatWriterRegistryBuilder;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriterFactory;
-import java.util.HashSet;
-import java.util.Set;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
-public class LispModuleTest {
-
- @Named("interface-context")
- @Bind
- private NamingContext interfaceContext;
-
- @Named("bridge-domain-context")
- @Bind
- private NamingContext bridgeDomainContext;
-
- @Named("honeycomb-context")
- @Bind
- @Mock
- private DataBroker honeycombContext;
-
- @Named("honeycomb-initializer")
- @Bind
- @Mock
- private DataBroker honeycombInitializer;
-
- @Bind
- @Mock
- private FutureJVppCore futureJVppCore;
-
- @Inject
- private Set<ReaderFactory> readerFactories = new HashSet<>();
-
- @Inject
- private Set<WriterFactory> writerFactories = new HashSet<>();
-
- @Before
- public void setUp() throws Exception {
- initMocks(this);
- interfaceContext = new NamingContext("interfaceContext", "interfaceContext");
- bridgeDomainContext = new NamingContext("bridgeDomainContext", "bridgeDomainContext");
- Guice.createInjector(new LispModule(), BoundFieldModule.of(this)).injectMembers(this);
- }
-
- @Test
- public void testReaderFactories() throws Exception {
- assertThat(readerFactories, is(not(empty())));
-
- // Test registration process (all dependencies present, topological order of readers does exist, etc.)
- final CompositeReaderRegistryBuilder registryBuilder = new CompositeReaderRegistryBuilder();
- readerFactories.stream().forEach(factory -> factory.init(registryBuilder));
- assertNotNull(registryBuilder.build());
- }
-
- @Test
- public void testWriterFactories() throws Exception {
- assertThat(writerFactories, is(not(empty())));
-
- // Test registration process (all dependencies present, topological order of writers does exist, etc.)
- final FlatWriterRegistryBuilder registryBuilder = new FlatWriterRegistryBuilder();
- writerFactories.stream().forEach(factory -> factory.init(registryBuilder));
- assertNotNull(registryBuilder.build());
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/context/util/AdjacenciesMappingContextTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/context/util/AdjacenciesMappingContextTest.java
deleted file mode 100644
index 4a5302b..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/context/util/AdjacenciesMappingContextTest.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * 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.honeycomb.lisp.context.util;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableSet;
-import io.fd.honeycomb.test.tools.HoneycombTestRunner;
-import io.fd.honeycomb.test.tools.annotations.InjectTestData;
-import io.fd.honeycomb.test.tools.annotations.InjectablesProcessor;
-import io.fd.honeycomb.test.tools.annotations.SchemaContextProvider;
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.util.RWUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.$YangModuleInfoImpl;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.AdjacenciesIdentificationContexts;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentification;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentificationKey;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.Mappings;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.Mapping;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.MappingKey;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPair;
-import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-
-@RunWith(HoneycombTestRunner.class)
-public class AdjacenciesMappingContextTest implements InjectablesProcessor {
-
- private static final String PARENT_1 = "first";
- private static final String PARENT_2 = "second";
- private static final String PARENT_3 = "third";
- private static final String PARENT_4 = "fourth";
-
- private static final String LOCAL_EID_ID_1 = "local-eid-1";
- private static final String LOCAL_EID_ID_2 = "local-eid-2";
- private static final String LOCAL_EID_ID_3 = "local-eid-3";
-
- private static final String REMOTE_EID_ID_1 = "remote-eid-1";
- private static final String REMOTE_EID_ID_2 = "remote-eid-2";
- private static final String REMOTE_EID_ID_3 = "remote-eid-3";
-
- @Mock
- private MappingContext mappingContext;
-
- @Captor
- private ArgumentCaptor<Mapping> mappingArgumentCaptor;
-
- @Captor
- private ArgumentCaptor<KeyedInstanceIdentifier<Mapping, MappingKey>> keyedInstanceIdentifierArgumentCaptor;
-
- private AdjacenciesMappingContext adjacenciesMappingContext;
- private KeyedInstanceIdentifier<AdjacenciesIdentification, AdjacenciesIdentificationKey>
- adjacenciesMappingContextId;
-
- @SchemaContextProvider
- public ModuleInfoBackedContext schemaContext() {
- return provideSchemaContextFor(ImmutableSet.of($YangModuleInfoImpl.getInstance(),
- org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.$YangModuleInfoImpl
- .getInstance()));
- }
-
- @InjectTestData(resourcePath = "/adjacencies-identification-context.json", id = "/naming-context:contexts" +
- "/adjacencies-identification-context:adjacencies-identification-contexts" +
- "/adjacencies-identification-context:adjacencies-identification[adjacencies-identification-context:name='context']" +
- "/adjacencies-identification-context:mappings")
- private Mappings mappings;
-
- @Before
- public void init() {
- MockitoAnnotations.initMocks(this);
-
- adjacenciesMappingContext = new AdjacenciesMappingContext("context");
- adjacenciesMappingContextId = InstanceIdentifier.create(AdjacenciesIdentificationContexts.class).child(
- AdjacenciesIdentification.class, new AdjacenciesIdentificationKey("context"));
-
- when(mappingContext.read(adjacenciesMappingContextId.child(Mappings.class))).thenReturn(Optional.of(mappings));
- when(mappingContext.read(parentKey(PARENT_1))).thenReturn(Optional.of(filterForParent(PARENT_1)));
- when(mappingContext.read(parentKey(PARENT_2))).thenReturn(Optional.of(filterForParent(PARENT_2)));
- when(mappingContext.read(parentKey(PARENT_3))).thenReturn(Optional.of(filterForParent(PARENT_3)));
- }
-
- private Mapping filterForParent(final String parent) {
- return mappings.getMapping().stream()
- .filter(mapping -> mapping.getId().equals(parent))
- .collect(RWUtils.singleItemCollector());
- }
-
- private KeyedInstanceIdentifier<Mapping, MappingKey> parentKey(final String parent) {
- return adjacenciesMappingContextId.child(Mappings.class).child(Mapping.class, new MappingKey(parent));
- }
-
- @Test
- public void getAdjacencyId() throws Exception {
- assertEquals(PARENT_1,
- adjacenciesMappingContext.getAdjacencyId(LOCAL_EID_ID_1, REMOTE_EID_ID_1, mappingContext));
- assertEquals(PARENT_2,
- adjacenciesMappingContext.getAdjacencyId(LOCAL_EID_ID_2, REMOTE_EID_ID_2, mappingContext));
- assertEquals(PARENT_3,
- adjacenciesMappingContext.getAdjacencyId(LOCAL_EID_ID_3, REMOTE_EID_ID_3, mappingContext));
- }
-
- @Test
- public void containsId() throws Exception {
- assertTrue(adjacenciesMappingContext.containsId(LOCAL_EID_ID_1, REMOTE_EID_ID_1, mappingContext));
- assertTrue(adjacenciesMappingContext.containsId(LOCAL_EID_ID_2, REMOTE_EID_ID_2, mappingContext));
- assertTrue(adjacenciesMappingContext.containsId(LOCAL_EID_ID_3, REMOTE_EID_ID_3, mappingContext));
- }
-
- @Test
- public void addEidPair() throws Exception {
- adjacenciesMappingContext.addEidPair(PARENT_4, LOCAL_EID_ID_1, REMOTE_EID_ID_3, mappingContext);
- verify(mappingContext, times(1))
- .put(keyedInstanceIdentifierArgumentCaptor.capture(), mappingArgumentCaptor.capture());
-
- final KeyedInstanceIdentifier<Mapping, MappingKey> key = keyedInstanceIdentifierArgumentCaptor.getValue();
- final Mapping mapping = mappingArgumentCaptor.getValue();
-
- assertEquals(PARENT_4, key.getKey().getId());
- assertEquals(PARENT_4, mapping.getId());
- assertEquals(PARENT_4, mapping.getKey().getId());
-
- final EidIdentificatorPair pair = mapping.getEidIdentificatorPair();
- assertEquals(LOCAL_EID_ID_1, pair.getLocalEidId().getValue());
- assertEquals(REMOTE_EID_ID_3, pair.getRemoteEidId().getValue());
- }
-
- @Test
- public void removeForIndex() throws Exception {
- adjacenciesMappingContext.removeForIndex(PARENT_1, mappingContext);
- adjacenciesMappingContext.removeForIndex(PARENT_2, mappingContext);
- adjacenciesMappingContext.removeForIndex(PARENT_3, mappingContext);
- verify(mappingContext, times(1)).delete(parentKey(PARENT_1));
- verify(mappingContext, times(1)).delete(parentKey(PARENT_2));
- verify(mappingContext, times(1)).delete(parentKey(PARENT_3));
- }
-
- @Test
- public void getEidPair() throws Exception {
- final EidIdentificatorPair pair1 = adjacenciesMappingContext.getEidPair(PARENT_1, mappingContext);
- final EidIdentificatorPair pair2 = adjacenciesMappingContext.getEidPair(PARENT_2, mappingContext);
- final EidIdentificatorPair pair3 = adjacenciesMappingContext.getEidPair(PARENT_3, mappingContext);
-
- assertEquals(LOCAL_EID_ID_1, pair1.getLocalEidId().getValue());
- assertEquals(REMOTE_EID_ID_1, pair1.getRemoteEidId().getValue());
- assertEquals(LOCAL_EID_ID_2, pair2.getLocalEidId().getValue());
- assertEquals(REMOTE_EID_ID_2, pair2.getRemoteEidId().getValue());
- assertEquals(LOCAL_EID_ID_3, pair3.getLocalEidId().getValue());
- assertEquals(REMOTE_EID_ID_3, pair3.getRemoteEidId().getValue());
- }
-
- @Test
- public void containsEidPairForIndex() throws Exception {
- assertTrue(adjacenciesMappingContext.containsEidPairForIndex(PARENT_1, mappingContext));
- assertTrue(adjacenciesMappingContext.containsEidPairForIndex(PARENT_2, mappingContext));
- assertTrue(adjacenciesMappingContext.containsEidPairForIndex(PARENT_3, mappingContext));
- }
-
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/context/util/EidMappingContextTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/context/util/EidMappingContextTest.java
deleted file mode 100644
index ccd3829..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/context/util/EidMappingContextTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.honeycomb.lisp.context.util;
-
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import io.fd.honeycomb.lisp.util.EidMappingContextHelper;
-import io.fd.honeycomb.translate.MappingContext;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.EidBuilder;
-
-public class EidMappingContextTest implements EidMappingContextHelper {
-
- private static final String EID_MAPPING_CONTEXT_NAME = "eidMappingContext";
-
- @Mock
- private MappingContext mappingContext;
-
- private EidMappingContext eidMappingContext;
- private Eid localEid;
- private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid
- remoteEid;
- private org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid
- mappingEid;
- private MappingId mappingId;
-
- @Before
- public void init() {
- MockitoAnnotations.initMocks(this);
- eidMappingContext = new EidMappingContext(EID_MAPPING_CONTEXT_NAME);
-
- localEid =
- new EidBuilder().setAddress(new Ipv4Builder().setIpv4(new Ipv4Address("192.168.2.1")).build()).build();
- remoteEid = fromLocalToRemoteEid(localEid);
- mappingEid = fromLocalToMappingEid(localEid);
- mappingId = new MappingId("mapping");
-
- defineEidMapping(mappingContext, mappingEid, mappingId, EID_MAPPING_CONTEXT_NAME);
- }
-
- @Test
- public void testContainsEid() {
- assertTrue(eidMappingContext.containsEid(mappingId, mappingContext));
- org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid
- loadedEid = eidMappingContext.getEid(mappingId, mappingContext);
-
- assertEquals("192.168.2.1", ((Ipv4) (loadedEid.getAddress())).getIpv4().getValue());
- }
-
- @Test
- public void testContainsId() {
- assertTrue(eidMappingContext.containsId(localEid, mappingContext));
- assertTrue(eidMappingContext.containsId(remoteEid, mappingContext));
- }
-
- @Test
- public void testGetEid() {
- assertEquals(mappingEid, eidMappingContext.getEid(mappingId, mappingContext));
- }
-
- @Test
- public void testGetId() {
- assertEquals(mappingId, eidMappingContext.getId(localEid, mappingContext));
- assertEquals(mappingId, eidMappingContext.getId(remoteEid, mappingContext));
- }
-
- private org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid fromLocalToMappingEid(
- Eid eid) {
- return new org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.EidBuilder()
- .setAddress(eid.getAddress())
- .setAddressType(eid.getAddressType())
- .setVirtualNetworkId(eid.getVirtualNetworkId())
- .build();
- }
-
- private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid fromLocalToRemoteEid(
- Eid eid) {
- return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder()
- .setAddress(eid.getAddress())
- .setAddressType(eid.getAddressType())
- .setVirtualNetworkId(eid.getVirtualNetworkId())
- .build();
- }
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/AdjacencyData.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/AdjacencyData.java
deleted file mode 100644
index 2ecfe17..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/AdjacencyData.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate;
-
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.EidBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4Afi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
-
-public class AdjacencyData {
-
- public static final Long VNI = 12L;
-
- public static final Ipv4Address ADDRESS_ONE = new Ipv4Address("192.168.2.1");
- public static final Ipv4Address ADDRESS_TWO = new Ipv4Address("192.168.2.2");
- public static final Ipv4Address ADDRESS_THREE = new Ipv4Address("192.168.2.3");
- public static final Ipv4Address ADDRESS_FOUR = new Ipv4Address("192.168.2.4");
-
- public static final Eid LOCAL_EID_ONE = new EidBuilder()
- .setAddressType(Ipv4Afi.class)
- .setVirtualNetworkId(new InstanceIdType(VNI))
- .setAddress(new Ipv4Builder().setIpv4(ADDRESS_ONE).build())
- .build();
-
- public static final Eid LOCAL_EID_TWO = new EidBuilder()
- .setAddressType(Ipv4Afi.class)
- .setVirtualNetworkId(new InstanceIdType(VNI))
- .setAddress(new Ipv4Builder().setIpv4(ADDRESS_TWO).build())
- .build();
-
- public static final Eid REMOTE_EID_ONE = new EidBuilder()
- .setAddressType(Ipv4Afi.class)
- .setVirtualNetworkId(new InstanceIdType(VNI))
- .setAddress(new Ipv4Builder().setIpv4(ADDRESS_THREE).build())
- .build();
- public static final Eid REMOTE_EID_TWO = new EidBuilder()
- .setAddressType(Ipv4Afi.class)
- .setVirtualNetworkId(new InstanceIdType(VNI))
- .setAddress(new Ipv4Builder().setIpv4(ADDRESS_FOUR).build())
- .build();
-
-
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/AdjacencyCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/AdjacencyCustomizerTest.java
deleted file mode 100644
index 09d4d27..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/AdjacencyCustomizerTest.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.ADDRESS_ONE;
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.ADDRESS_THREE;
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.LOCAL_EID_ONE;
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.LOCAL_EID_TWO;
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.REMOTE_EID_ONE;
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.REMOTE_EID_TWO;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.contains;
-import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.when;
-
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.util.EidMetadataProvider;
-import io.fd.honeycomb.lisp.util.AdjacencyMappingContextTestHelper;
-import io.fd.honeycomb.lisp.util.EidMappingContextHelper;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator;
-import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest;
-import io.fd.vpp.jvpp.core.dto.LispAdjacenciesGetReply;
-import io.fd.vpp.jvpp.core.types.LispAdjacency;
-import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.Adjacencies;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.AdjacenciesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.Adjacency;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMappingKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-public class AdjacencyCustomizerTest
- extends ListReaderCustomizerTest<Adjacency, AdjacencyKey, AdjacencyBuilder>
- implements ByteDataTranslator, EidMetadataProvider, EidMappingContextHelper, AdjacencyMappingContextTestHelper {
-
- private InstanceIdentifier<Adjacency> identifier;
-
- public AdjacencyCustomizerTest() {
- super(Adjacency.class, AdjacenciesBuilder.class);
- }
-
- @Before
- public void init() {
- identifier = InstanceIdentifier.create(EidTable.class)
- .child(VniTable.class, new VniTableKey(2L))
- .child(BridgeDomainSubtable.class)
- .child(RemoteMappings.class)
- .child(RemoteMapping.class, new RemoteMappingKey(new MappingId("remote-mapping")))
- .child(Adjacencies.class)
- .child(Adjacency.class, new AdjacencyKey("adj-one"));
-
-
- mockApi();
- defineEidMapping(mappingContext, LOCAL_EID_ONE, new MappingId("local-eid-one"), "local-mapping-context");
- defineEidMapping(mappingContext, LOCAL_EID_TWO, new MappingId("local-eid-two"), "local-mapping-context");
- defineEidMapping(mappingContext, REMOTE_EID_ONE, new MappingId("remote-eid-one"), "remote-mapping-context");
- defineEidMapping(mappingContext, REMOTE_EID_TWO, new MappingId("remote-eid-two"), "remote-mapping-context");
-
- defineAdjacencyMapping(mappingContext, "local-eid-one", "remote-eid-one", "adj-one",
- "adjacencies-mapping-context");
- defineAdjacencyMapping(mappingContext, "local-eid-two", "remote-eid-two", "adj-two",
- "adjacencies-mapping-context");
- mockApi();
- }
-
- @Test
- public void getAllIds() throws Exception {
- final List<AdjacencyKey> keys = getCustomizer().getAllIds(identifier, ctx);
-
- assertThat(keys, hasSize(2));
- assertThat(keys, contains(new AdjacencyKey("adj-one"), new AdjacencyKey("adj-two")));
- }
-
- @Test
- public void readCurrentAttributes() throws Exception {
- final AdjacencyBuilder builder = new AdjacencyBuilder();
- getCustomizer().readCurrentAttributes(identifier, builder, ctx);
-
- assertEquals("adj-one", builder.getId());
- assertEquals(new AdjacencyKey("adj-one"), builder.getKey());
- assertEquals(ADDRESS_ONE.getValue(), Ipv4.class.cast(builder.getLocalEid().getAddress()).getIpv4().getValue());
- assertEquals(ADDRESS_THREE.getValue(),
- Ipv4.class.cast(builder.getRemoteEid().getAddress()).getIpv4().getValue());
- }
-
- @Override
- protected ReaderCustomizer<Adjacency, AdjacencyBuilder> initCustomizer() {
- return new AdjacencyCustomizer(api, new EidMappingContext("local-mapping-context"),
- new EidMappingContext("remote-mapping-context"),
- new AdjacenciesMappingContext("adjacencies-mapping-context"));
- }
-
-
- private void mockApi() {
- LispAdjacency adjacencyOne = new LispAdjacency();
- adjacencyOne.eidType = 0;
- adjacencyOne.leid = new byte[]{-64, -88, 2, 1};
- adjacencyOne.leidPrefixLen = 32;
- adjacencyOne.reid = new byte[]{-64, -88, 2, 3};
- adjacencyOne.reidPrefixLen = 32;
-
-
- LispAdjacency adjacencyTwo = new LispAdjacency();
- adjacencyTwo.eidType = 0;
- adjacencyTwo.leid = new byte[]{-64, -88, 2, 2};
- adjacencyTwo.leidPrefixLen = 32;
- adjacencyTwo.reid = new byte[]{-64, -88, 2, 4};
- adjacencyTwo.reidPrefixLen = 32;
-
- LispAdjacenciesGetReply reply = new LispAdjacenciesGetReply();
- reply.adjacencies = new LispAdjacency[]{adjacencyOne, adjacencyTwo};
-
- when(api.lispAdjacenciesGet(any())).thenReturn(future(reply));
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/BridgeDomainSubtableCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/BridgeDomainSubtableCustomizerTest.java
deleted file mode 100644
index b230b34..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/BridgeDomainSubtableCustomizerTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams.MapLevel.L2;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import io.fd.honeycomb.lisp.translate.read.trait.SubtableReaderTestCase;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.vpp.jvpp.VppCallbackException;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtableBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class BridgeDomainSubtableCustomizerTest
- extends SubtableReaderTestCase<BridgeDomainSubtable, BridgeDomainSubtableBuilder> {
-
- private InstanceIdentifier<BridgeDomainSubtable> validId;
- private NamingContext bridgeDomainContext;
-
- public BridgeDomainSubtableCustomizerTest() {
- super(BridgeDomainSubtable.class, VniTableBuilder.class);
- }
-
- @Override
- protected void setUp() throws Exception {
- bridgeDomainContext = new NamingContext("br", "br-domain-context");
- validId = InstanceIdentifier.create(EidTable.class).child(VniTable.class, new VniTableKey(expectedVni))
- .child(BridgeDomainSubtable.class);
-
- defineMapping(mappingContext, "br-domain", expectedTableId, "br-domain-context");
- }
-
- @Test
- public void testReadCurrentSuccessfull() throws ReadFailedException {
- doReturnValidNonEmptyDataOnDump();
- BridgeDomainSubtableBuilder builder = new BridgeDomainSubtableBuilder();
- customizer.readCurrentAttributes(validId, builder, ctx);
-
- verifyLispEidTableMapDumpCalled(L2);
-
- final BridgeDomainSubtable subtable = builder.build();
- assertNotNull(subtable);
- assertEquals("br-domain", subtable.getBridgeDomainRef());
- }
-
-
- @Test
- public void testReadCurrentEmptyDump() throws ReadFailedException {
- doReturnEmptyDataOnDump();
- BridgeDomainSubtableBuilder builder = new BridgeDomainSubtableBuilder();
- customizer.readCurrentAttributes(validId, builder, ctx);
-
- verifyLispEidTableMapDumpCalled(L2);
-
- final BridgeDomainSubtable subtable = builder.build();
- assertNotNull(subtable);
- assertNull(subtable.getBridgeDomainRef());
- }
-
- @Test
- public void testReadCurrentFailed() {
- doThrowOnDump();
- BridgeDomainSubtableBuilder builder = new BridgeDomainSubtableBuilder();
- try {
- customizer.readCurrentAttributes(validId, builder, ctx);
- } catch (ReadFailedException e) {
- assertTrue(e.getCause() instanceof VppCallbackException);
- assertNull(builder.getBridgeDomainRef());
- verifyLispEidTableMapDumpNotCalled();
-
- return;
- }
-
- fail("Test should throw ReadFailedException");
- }
-
- @Test
- public void testGetBuilder() {
- final BridgeDomainSubtableBuilder builder = customizer.getBuilder(validId);
-
- assertNotNull(builder);
- assertNull(builder.getLocalMappings());
- assertNull(builder.getRemoteMappings());
- assertNull(builder.getBridgeDomainRef());
- }
-
- @Override
- protected ReaderCustomizer<BridgeDomainSubtable, BridgeDomainSubtableBuilder> initCustomizer() {
- return new BridgeDomainSubtableCustomizer(api, bridgeDomainContext);
- }
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizerTest.java
deleted file mode 100644
index fb97dce..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/InterfaceCustomizerTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.when;
-
-import com.google.common.collect.ImmutableList;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest;
-import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.LocatorSets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.Interface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.InterfaceBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.locator.set.InterfaceKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetails;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetailsReplyDump;
-
-public class InterfaceCustomizerTest
- extends ListReaderCustomizerTest<Interface, InterfaceKey, InterfaceBuilder> {
-
- public InterfaceCustomizerTest() {
- super(Interface.class, LocatorSetBuilder.class);
- }
-
- private InstanceIdentifier<Interface> validId;
-
- @Before
- public void init() {
- validId = InstanceIdentifier.create(LocatorSets.class).child(LocatorSet.class, new LocatorSetKey("loc-set-1"))
- .child(Interface.class, new InterfaceKey("interface-1"));
-
- //mappings
- defineMappings();
- //dump data
- defineDumpData();
- }
-
- private void defineDumpData() {
- final LispLocatorDetailsReplyDump dump = new LispLocatorDetailsReplyDump();
-
- final LispLocatorDetails detail1 = new LispLocatorDetails();
- detail1.swIfIndex = 1;
- detail1.ipAddress = new byte[]{-64, -88, 2, 1};
- detail1.isIpv6 = 0;
- detail1.local = 0;
- detail1.priority = 1;
- detail1.weight = 2;
-
- final LispLocatorDetails detail2 = new LispLocatorDetails();
- detail2.swIfIndex = 2;
- detail2.ipAddress = new byte[]{-64, -88, 2, 2};
- detail2.isIpv6 = 0;
- detail2.local = 0;
- detail2.priority = 2;
- detail2.weight = 3;
-
- dump.lispLocatorDetails = ImmutableList.of(detail1, detail2);
-
- when(api.lispLocatorDump(Mockito.any())).thenReturn(future(dump));
- }
-
- private void defineMappings() {
- defineMapping(mappingContext, "interface-1", 1, "interface-context");
- defineMapping(mappingContext, "interface-2", 2, "interface-context");
- defineMapping(mappingContext, "loc-set-1", 3, "locator-set-context");
- }
-
- @Test
- public void testGetAllIds() throws ReadFailedException {
-
- final List<InterfaceKey> keys = getCustomizer().getAllIds(validId, ctx);
-
- assertEquals(2, keys.size());
- assertEquals("interface-1", keys.get(0).getInterfaceRef());
- assertEquals("interface-2", keys.get(1).getInterfaceRef());
- }
-
- @Test
- public void testReadCurrentAttributes() throws ReadFailedException {
- InterfaceBuilder builder = new InterfaceBuilder();
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
-
- final Interface iface = builder.build();
- assertEquals("interface-1", iface.getInterfaceRef());
- assertEquals("interface-1", iface.getKey().getInterfaceRef());
-
- }
-
- @Override
- protected ReaderCustomizer<Interface, InterfaceBuilder> initCustomizer() {
- return new InterfaceCustomizer(api, new NamingContext("interface", "interface-context"),
- new NamingContext("loc-set", "locator-set-context"));
- }
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/ItrRemoteLocatorSetCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/ItrRemoteLocatorSetCustomizerTest.java
deleted file mode 100644
index 9b810b9..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/ItrRemoteLocatorSetCustomizerTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest;
-import io.fd.vpp.jvpp.VppCallbackException;
-import io.fd.vpp.jvpp.core.dto.LispGetMapRequestItrRlocs;
-import io.fd.vpp.jvpp.core.dto.LispGetMapRequestItrRlocsReply;
-import java.nio.charset.StandardCharsets;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.itr.remote.locator.sets.grouping.ItrRemoteLocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.itr.remote.locator.sets.grouping.ItrRemoteLocatorSetBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureDataBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-public class ItrRemoteLocatorSetCustomizerTest
- extends ReaderCustomizerTest<ItrRemoteLocatorSet, ItrRemoteLocatorSetBuilder> {
-
- private static final String EXPECTED_LOCATOR_SET_NAME = "loc-set";
-
- private InstanceIdentifier<ItrRemoteLocatorSet> validId;
- private ItrRemoteLocatorSetBuilder builder;
-
- public ItrRemoteLocatorSetCustomizerTest() {
- super(ItrRemoteLocatorSet.class, LispFeatureDataBuilder.class);
- }
-
- @Before
- public void setUp() throws Exception {
- validId = InstanceIdentifier.create(ItrRemoteLocatorSet.class);
- builder = new ItrRemoteLocatorSetBuilder();
- }
-
- @Override
- protected ReaderCustomizer<ItrRemoteLocatorSet, ItrRemoteLocatorSetBuilder> initCustomizer() {
- return new ItrRemoteLocatorSetCustomizer(api);
- }
-
- @Test
- public void getBuilder() throws Exception {
- final ItrRemoteLocatorSetBuilder itrRemoteLocatorSetBuilder = getCustomizer().getBuilder(validId);
-
- assertNotNull(itrRemoteLocatorSetBuilder);
- assertNull(itrRemoteLocatorSetBuilder.getRemoteLocatorSetName());
- }
-
- @Test
- public void readCurrentAttributesSuccess() throws Exception {
- doReturnValidDataOnDump();
-
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
-
- assertNotNull(builder);
- assertEquals(EXPECTED_LOCATOR_SET_NAME, builder.getRemoteLocatorSetName());
- verifyLispGetMapRequestItrRlocsInvokedOnce();
- }
-
- @Test
- public void readCurrentAttributesEmptyData() throws Exception {
- doReturnEmptyDataOnDump();
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
- verifyInvalidDataCase(builder);
- }
-
- @Test
- public void readCurrentAttributesFailedCallHalted() {
- doThrowExceptionOnDump();
- try {
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
- } catch (ReadFailedException e) {
- assertTrue(e.getCause() instanceof VppCallbackException);
- assertNotNull(builder);
- assertNull(builder.getRemoteLocatorSetName());
-
- verifyLispGetMapRequestItrRlocsInvokedOnce();
- return;
- }
-
- fail("Test should have thrown exception");
- }
-
- @Test
- public void merge() throws Exception {
- LispFeatureDataBuilder builder = new LispFeatureDataBuilder();
- ItrRemoteLocatorSet set = new ItrRemoteLocatorSetBuilder().setRemoteLocatorSetName("loc-set").build();
- getCustomizer().merge(builder, set);
-
- assertNotNull(builder);
- assertEquals(set, builder.getItrRemoteLocatorSet());
- }
-
-
- private void doReturnValidDataOnDump() {
- LispGetMapRequestItrRlocsReply reply = new LispGetMapRequestItrRlocsReply();
- reply.locatorSetName = EXPECTED_LOCATOR_SET_NAME.getBytes(StandardCharsets.UTF_8);
-
- when(api.lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class)))
- .thenReturn(CompletableFuture.completedFuture(reply));
- }
-
- private void doReturnNullDataOnDump() {
- when(api.lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class)))
- .thenReturn(CompletableFuture.completedFuture(null));
- }
-
- private void doReturnEmptyDataOnDump() {
- when(api.lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class)))
- .thenReturn(CompletableFuture.completedFuture(new LispGetMapRequestItrRlocsReply()));
- }
-
- private void doThrowExceptionOnDump() {
- when(api.lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class))).
- thenReturn(new CompletableFuture<LispGetMapRequestItrRlocsReply>() {
- @Override
- public LispGetMapRequestItrRlocsReply get(final long l, final TimeUnit timeUnit)
- throws InterruptedException, ExecutionException, TimeoutException {
- throw new ExecutionException(new VppCallbackException("lispGetMapRequestItrRlocs", 1, -2));
- }
- });
- }
-
- private void verifyLispGetMapRequestItrRlocsInvokedOnce() {
- verify(api, times(1)).lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class));
- }
-
- private void verifyInvalidDataCase(final ItrRemoteLocatorSetBuilder builder) {
- assertNotNull(builder);
- assertNull(builder.getRemoteLocatorSetName());
-
- verifyLispGetMapRequestItrRlocsInvokedOnce();
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LispStateCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LispStateCustomizerTest.java
deleted file mode 100644
index 33d956f..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LispStateCustomizerTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.when;
-
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispStateBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.ShowLispStatusReply;
-
-public class LispStateCustomizerTest extends ReaderCustomizerTest<LispState, LispStateBuilder> {
-
- private InstanceIdentifier<LispState> identifier;
-
- public LispStateCustomizerTest() {
- super(LispState.class, null);
- }
-
- @Before
- public void init() {
- identifier = InstanceIdentifier.create(LispState.class);
- final ShowLispStatusReply reply = new ShowLispStatusReply();
- reply.featureStatus = 1;
-
- when(api.showLispStatus(Mockito.any())).thenReturn(future(reply));
- }
-
- @Test
- public void testReadCurrentAttributes() throws ReadFailedException {
-
- LispStateBuilder builder = new LispStateBuilder();
- getCustomizer().readCurrentAttributes(identifier, builder, ctx);
-
- assertEquals(true, builder.build().isEnable());
- }
-
- @Override
- protected ReaderCustomizer<LispState, LispStateBuilder> initCustomizer() {
- return new LispStateCustomizer(api);
- }
-
- @Override
- public void testMerge() throws Exception {
- //LispState is root node, so there is no way to implement merge(it is also not needed)
- }
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LocalMappingCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LocalMappingCustomizerTest.java
deleted file mode 100644
index 065adcc..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LocalMappingCustomizerTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV4;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.when;
-
-import com.google.common.collect.ImmutableList;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest;
-import java.util.List;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.EidBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.LocalMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.LocalMappingsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMappingKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.Eid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump;
-
-public class LocalMappingCustomizerTest extends
- ListReaderCustomizerTest<LocalMapping, LocalMappingKey, LocalMappingBuilder> implements EidTranslator {
-
- private static final Ipv4
- EID_ADDRESS = new Ipv4Builder().setIpv4(new Ipv4Address("192.168.2.1")).build();
-
- @Mock
- private EidMappingContext localMappingContext;
-
- private InstanceIdentifier<LocalMapping> emptyIdentifier;
- private InstanceIdentifier<LocalMapping> validIdentifier;
-
- public LocalMappingCustomizerTest() {
- super(LocalMapping.class, LocalMappingsBuilder.class);
- }
-
-
- public void setUp() {
- emptyIdentifier = InstanceIdentifier.create(EidTable.class)
- .child(VniTable.class, new VniTableKey(12L))
- .child(VrfSubtable.class)
- .child(LocalMappings.class)
- .child(LocalMapping.class);
-
- validIdentifier = InstanceIdentifier.create(EidTable.class)
- .child(VniTable.class, new VniTableKey(12L))
- .child(VrfSubtable.class)
- .child(LocalMappings.class)
- .child(LocalMapping.class, new LocalMappingKey(new MappingId("local-mapping")));
-
- defineDumpData();
- defineMappings();
- }
-
- private void defineDumpData() {
- LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump();
- LispEidTableDetails detail = new LispEidTableDetails();
- detail.action = 0;
- detail.authoritative = 1;
- detail.context = 4;
- detail.eid = new byte[]{-64, -88, 2, 1};
- detail.eidPrefixLen = 32;
- detail.eidType = (byte) IPV4.getValue();
- detail.isLocal = 1;
- detail.locatorSetIndex = 1;
- detail.ttl = 7;
- detail.vni = 12;
-
- replyDump.lispEidTableDetails = ImmutableList.of(detail);
- when(api.lispEidTableDump(any())).thenReturn(future(replyDump));
- }
-
- private void defineMappings() {
- //eid mapping
-
- when(localMappingContext.getId(any(Eid.class), any(MappingContext.class)))
- .thenReturn(new MappingId("local-mapping"));
- when(localMappingContext.containsEid(new MappingId("local-mapping"), mappingContext)).thenReturn(true);
- when(localMappingContext.getEid(new MappingId("local-mapping"), mappingContext)).thenReturn(new EidBuilder()
- .setAddress(EID_ADDRESS).build());
- //naming context for locator
- defineMapping(mappingContext, "loc-set", 1, "locator-set-context");
- }
-
- @Test
- public void readCurrentAttributes() throws Exception {
- LocalMappingBuilder builder = new LocalMappingBuilder();
- getCustomizer().readCurrentAttributes(validIdentifier, builder, ctx);
-
- final LocalMapping mapping = builder.build();
-
- assertNotNull(mapping);
- assertEquals(true, compareAddresses(EID_ADDRESS, mapping.getEid().getAddress()));
- assertEquals("loc-set", mapping.getLocatorSet());
- }
-
- @Test
- public void getAllIds() throws Exception {
- final List<LocalMappingKey> keys = getCustomizer().getAllIds(emptyIdentifier, ctx);
-
- assertEquals(1, keys.size());
- assertEquals("local-mapping", keys.get(0).getId().getValue());
- }
-
- @Override
- protected ReaderCustomizer<LocalMapping, LocalMappingBuilder> initCustomizer() {
- return new LocalMappingCustomizer(api, new NamingContext("loc", "locator-set-context"), localMappingContext);
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LocatorSetCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LocatorSetCustomizerTest.java
deleted file mode 100644
index e863ba2..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/LocatorSetCustomizerTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.when;
-
-import com.google.common.collect.ImmutableList;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest;
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.LocatorSets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.LocatorSetsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSet;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.locator.sets.grouping.locator.sets.LocatorSetKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetails;
-import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetailsReplyDump;
-
-
-public class LocatorSetCustomizerTest
- extends ListReaderCustomizerTest<LocatorSet, LocatorSetKey, LocatorSetBuilder> {
-
- private InstanceIdentifier<LocatorSet> emptyId;
- private InstanceIdentifier<LocatorSet> validId;
-
- public LocatorSetCustomizerTest() {
- super(LocatorSet.class, LocatorSetsBuilder.class);
- }
-
- @Before
- public void init() {
- emptyId = InstanceIdentifier.create(LocatorSet.class);
- validId = InstanceIdentifier.create(LocatorSets.class).child(LocatorSet.class, new LocatorSetKey("loc-set"));
-
- defineDumpData();
- defineMapping(mappingContext, "loc-set", 1, "locator-set-context");
- }
-
- private void defineDumpData() {
- LispLocatorSetDetailsReplyDump dump = new LispLocatorSetDetailsReplyDump();
- LispLocatorSetDetails detail = new LispLocatorSetDetails();
- detail.context = 4;
- detail.lsName = "loc-set".getBytes(StandardCharsets.UTF_8);
- detail.lsIndex = 1;
-
- dump.lispLocatorSetDetails = ImmutableList.of(detail);
-
- when(api.lispLocatorSetDump(any())).thenReturn(future(dump));
- }
-
-
- @Test
- public void readCurrentAttributes() throws Exception {
- LocatorSetBuilder builder = new LocatorSetBuilder();
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
-
- assertNotNull(builder);
- assertEquals("loc-set", builder.getName());
- assertEquals("loc-set", builder.getKey().getName());
- }
-
- @Test
- public void getAllIds() throws Exception {
- final List<LocatorSetKey> keys = getCustomizer().getAllIds(emptyId, ctx);
-
- assertEquals(1, keys.size());
- assertEquals("loc-set", keys.get(0).getName());
- }
-
- @Override
- protected ReaderCustomizer<LocatorSet, LocatorSetBuilder> initCustomizer() {
- return new LocatorSetCustomizer(api, new NamingContext("loc", "locator-set-context"));
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/MapResolverCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/MapResolverCustomizerTest.java
deleted file mode 100644
index adcbdb6..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/MapResolverCustomizerTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.when;
-
-import com.google.common.collect.ImmutableList;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest;
-import io.fd.vpp.jvpp.core.dto.LispMapResolverDetails;
-import io.fd.vpp.jvpp.core.dto.LispMapResolverDetailsReplyDump;
-import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.MapResolvers;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.MapResolversBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolver;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolverBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.map.resolvers.grouping.map.resolvers.MapResolverKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-
-public class MapResolverCustomizerTest
- extends ListReaderCustomizerTest<MapResolver, MapResolverKey, MapResolverBuilder> {
-
- private static final IpAddress IP_ADDRESS_REVERTED =
- new IpAddress(new Ipv4AddressNoZone("1.2.168.192"));
-
- private InstanceIdentifier<MapResolver> emptyId;
- private InstanceIdentifier<MapResolver> validId;
-
- public MapResolverCustomizerTest() {
- super(MapResolver.class, MapResolversBuilder.class);
- }
-
- @Before
- public void init() {
-
- emptyId = InstanceIdentifier.create(MapResolver.class);
- validId = InstanceIdentifier.create(MapResolvers.class)
- .child(MapResolver.class, new MapResolverKey(IP_ADDRESS_REVERTED));
- defineDumpData();
- }
-
- @Test
- public void readCurrentAttributes() throws Exception {
- MapResolverBuilder builder = new MapResolverBuilder();
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
-
- MapResolver resolver = builder.build();
- assertNotNull(resolver);
- assertEquals("1.2.168.192", resolver.getIpAddress().getIpv4Address().getValue());
- }
-
- @Test
- public void getAllIds() throws Exception {
- final List<MapResolverKey> keys = getCustomizer().getAllIds(emptyId, ctx);
-
- assertEquals(1, keys.size());
-
- final MapResolverKey key = keys.get(0);
- assertNotNull(key);
- assertEquals("1.2.168.192", new String(key.getIpAddress().getValue()));
-
- }
-
- private void defineDumpData() {
- final LispMapResolverDetailsReplyDump replyDump = new LispMapResolverDetailsReplyDump();
- final LispMapResolverDetails detail = new LispMapResolverDetails();
- detail.context = 5;
- detail.ipAddress = new byte[]{1, 2, -88, -64};
- detail.isIpv6 = 0;
-
- replyDump.lispMapResolverDetails = ImmutableList.of(detail);
-
- when(api.lispMapResolverDump(any())).thenReturn(future(replyDump));
- }
-
- @Override
- protected ReaderCustomizer<MapResolver, MapResolverBuilder> initCustomizer() {
- return new MapResolverCustomizer(api);
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/PitrCfgCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/PitrCfgCustomizerTest.java
deleted file mode 100644
index 52abdf8..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/PitrCfgCustomizerTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.when;
-
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest;
-import java.nio.charset.StandardCharsets;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.lisp.feature.data.grouping.LispFeatureDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.pitr.cfg.grouping.PitrCfg;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.pitr.cfg.grouping.PitrCfgBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.ShowLispPitrReply;
-
-
-public class PitrCfgCustomizerTest extends ReaderCustomizerTest<PitrCfg, PitrCfgBuilder> {
-
- private static final byte[] LOC_SET_NAME_BYTES = "loc-set".getBytes(StandardCharsets.UTF_8);
-
- private InstanceIdentifier<PitrCfg> emptyId;
-
- public PitrCfgCustomizerTest() {
- super(PitrCfg.class, LispFeatureDataBuilder.class);
- }
-
- @Before
- public void init() {
- emptyId = InstanceIdentifier.create(PitrCfg.class);
-
- mockDumpData();
- }
-
- @Test
- public void readCurrentAttributes() throws Exception {
- PitrCfgBuilder builder = new PitrCfgBuilder();
- getCustomizer().readCurrentAttributes(emptyId, builder, ctx);
-
- final PitrCfg cfg = builder.build();
-
- assertNotNull(cfg);
- assertEquals("loc-set", cfg.getLocatorSet());
- }
-
- private void mockDumpData() {
- ShowLispPitrReply replyDump = new ShowLispPitrReply();
- replyDump.locatorSetName = LOC_SET_NAME_BYTES;
- replyDump.status = 1;
-
- when(api.showLispPitr(any())).thenReturn(future(replyDump));
- }
-
- @Override
- protected ReaderCustomizer<PitrCfg, PitrCfgBuilder> initCustomizer() {
- return new PitrCfgCustomizer(api);
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/RemoteMappingCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/RemoteMappingCustomizerTest.java
deleted file mode 100644
index 27c243e..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/RemoteMappingCustomizerTest.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.when;
-
-import com.google.common.collect.ImmutableList;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.translate.util.EidTranslator;
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetails;
-import io.fd.vpp.jvpp.core.dto.LispLocatorDetailsReplyDump;
-import java.util.Collections;
-import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.EidBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MapReplyAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappingsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMappingKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.Eid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.NegativeMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.PositiveMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.locator.list.positive.mapping.rlocs.Locator;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class RemoteMappingCustomizerTest
- extends ListReaderCustomizerTest<RemoteMapping, RemoteMappingKey, RemoteMappingBuilder>
- implements EidTranslator {
-
- private static final Ipv4
- EID_ADDRESS = new Ipv4Builder().setIpv4(new Ipv4Address("192.168.2.1")).build();
-
- @Mock
- private EidMappingContext eidMappingContext;
-
- private InstanceIdentifier<RemoteMapping> validId;
-
- public RemoteMappingCustomizerTest() {
- super(RemoteMapping.class, RemoteMappingsBuilder.class);
- }
-
- @Before
- public void init() {
-
- validId = InstanceIdentifier.create(EidTable.class)
- .child(VniTable.class, new VniTableKey(12L))
- .child(VrfSubtable.class)
- .child(RemoteMappings.class)
- .child(RemoteMapping.class, new RemoteMappingKey(new MappingId("remote-mapping")));
- mockMappings();
- defineMapping(mappingContext,"loc-set",1,"loc-set-context");
- }
-
-
- private void mockDumpDataActionZero() {
- LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump();
- LispEidTableDetails detail = new LispEidTableDetails();
- detail.action = 0;
- detail.authoritative = 1;
- detail.context = 4;
- detail.eid = new byte[]{-64, -88, 2, 1};
- detail.eidPrefixLen = 32;
- detail.isLocal = 0;
- detail.locatorSetIndex = 1;
- detail.ttl = 7;
- detail.vni = 12;
-
- replyDump.lispEidTableDetails = ImmutableList.of(detail);
-
- when(api.lispEidTableDump(any())).thenReturn(future(replyDump));
-
- LispLocatorDetailsReplyDump rlocs = new LispLocatorDetailsReplyDump();
- rlocs.lispLocatorDetails = Collections.emptyList();
- when(api.lispLocatorDump(any())).thenReturn(future(rlocs));
- }
-
- private void mockDumpDataActionOne() {
- LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump();
- LispEidTableDetails detail = new LispEidTableDetails();
- detail.action = 1;
- detail.authoritative = 1;
- detail.context = 4;
- detail.eid = new byte[]{-64, -88, 2, 1};
- detail.eidPrefixLen = 32;
- detail.isLocal = 0;
- detail.locatorSetIndex = 1;
- detail.ttl = 7;
- detail.vni = 12;
-
- replyDump.lispEidTableDetails = ImmutableList.of(detail);
-
- when(api.lispEidTableDump(any())).thenReturn(future(replyDump));
- }
-
- private void mockDumpDataActionZeroWithRemotes() {
- LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump();
- LispEidTableDetails detail = new LispEidTableDetails();
- detail.action = 0;
- detail.authoritative = 1;
- detail.context = 4;
- detail.eid = new byte[]{-64, -88, 2, 1};
- detail.eidPrefixLen = 32;
- detail.isLocal = 0;
- detail.locatorSetIndex = 1;
- detail.ttl = 7;
- detail.vni = 12;
-
- replyDump.lispEidTableDetails = ImmutableList.of(detail);
-
- when(api.lispEidTableDump(any())).thenReturn(future(replyDump));
-
- LispLocatorDetailsReplyDump rlocs = new LispLocatorDetailsReplyDump();
- LispLocatorDetails rloc = new LispLocatorDetails();
- rloc.ipAddress = new byte[]{-64, -88, 2, 1};
- rloc.isIpv6 = 0;
- rloc.priority = 1;
- rloc.weight = 2;
-
- rlocs.lispLocatorDetails = ImmutableList.of(rloc);
-
- when(api.lispLocatorDump(any())).thenReturn(future(rlocs));
- }
-
-
- private void mockMappings() {
-
- when(eidMappingContext.getId(any(Eid.class), any(MappingContext.class)))
- .thenReturn(new MappingId("remote-mapping"));
- when(eidMappingContext.containsEid(new MappingId("remote-mapping"), mappingContext)).thenReturn(true);
- when(eidMappingContext.getEid(new MappingId("remote-mapping"), mappingContext))
- .thenReturn(new EidBuilder().setAddress(EID_ADDRESS).build());
-
- }
-
- @Test
- public void readCurrentAttributesNegativeMappingOne() throws Exception {
- mockDumpDataActionOne();
- RemoteMappingBuilder builder = new RemoteMappingBuilder();
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
-
- RemoteMapping mapping = builder.build();
-
- assertNotNull(mapping);
- assertEquals(true, compareAddresses(EID_ADDRESS, mapping.getEid().getAddress()));
- assertEquals(true, mapping.getAuthoritative().isA());
- assertEquals(7L, mapping.getTtl().longValue());
- assertTrue(mapping.getLocatorList() instanceof NegativeMapping);
- assertEquals(MapReplyAction.NativelyForward,
- ((NegativeMapping) mapping.getLocatorList()).getMapReply().getMapReplyAction());
- }
-
- @Test
- public void readCurrentAttributesNegativeMappingZero() throws Exception {
- mockDumpDataActionZero();
- RemoteMappingBuilder builder = new RemoteMappingBuilder();
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
-
- RemoteMapping mapping = builder.build();
-
- assertNotNull(mapping);
- assertEquals(true, compareAddresses(EID_ADDRESS, mapping.getEid().getAddress()));
- assertEquals(true, mapping.getAuthoritative().isA());
- assertEquals(7L, mapping.getTtl().longValue());
- assertEquals(MapReplyAction.NoAction,
- ((NegativeMapping) mapping.getLocatorList()).getMapReply().getMapReplyAction());
- }
-
- @Test
- public void readCurrentAttributesPositiveMapping() throws Exception {
- mockDumpDataActionZeroWithRemotes();
- RemoteMappingBuilder builder = new RemoteMappingBuilder();
- getCustomizer().readCurrentAttributes(validId, builder, ctx);
-
- RemoteMapping mapping = builder.build();
-
- assertNotNull(mapping);
- assertEquals(true, compareAddresses(EID_ADDRESS, mapping.getEid().getAddress()));
- assertEquals(true, mapping.getAuthoritative().isA());
- assertEquals(7L, mapping.getTtl().longValue());
- assertTrue(mapping.getLocatorList() instanceof PositiveMapping);
-
- final List<Locator> locators = ((PositiveMapping) mapping.getLocatorList()).getRlocs().getLocator();
- assertEquals(1, locators.size());
- final Locator locator = locators.get(0);
- assertEquals("192.168.2.1", locator.getAddress().getIpv4Address().getValue());
- assertEquals(1, locator.getPriority().shortValue());
- assertEquals(2, locator.getWeight().shortValue());
- }
-
-
- @Test
- public void getAllIds() throws Exception {
- mockDumpDataActionOne();
- final List<RemoteMappingKey> keys = getCustomizer().getAllIds(validId, ctx);
-
- assertNotNull(keys);
- assertEquals(1, keys.size());
- assertEquals("remote-mapping", keys.get(0).getId().getValue());
- }
-
- @Override
- protected ReaderCustomizer<RemoteMapping, RemoteMappingBuilder> initCustomizer() {
- return new RemoteMappingCustomizer(api, new NamingContext("loc-set", "loc-set-context"), eidMappingContext);
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/VniTableCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/VniTableCustomizerTest.java
deleted file mode 100644
index 1ff6cc6..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/VniTableCustomizerTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.when;
-
-import com.google.common.collect.ImmutableList;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest;
-import io.fd.vpp.jvpp.VppCallbackException;
-import io.fd.vpp.jvpp.core.dto.LispEidTableVniDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableVniDetailsReplyDump;
-import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class VniTableCustomizerTest extends ListReaderCustomizerTest<VniTable, VniTableKey, VniTableBuilder> {
-
- private InstanceIdentifier<VniTable> validId;
-
- public VniTableCustomizerTest() {
- super(VniTable.class, EidTableBuilder.class);
- }
-
- @Before
- public void init() {
- validId = InstanceIdentifier.create(EidTable.class).child(VniTable.class, new VniTableKey(12L));
- }
-
- @Test
- public void testReadAllSuccessfull() throws ReadFailedException {
- whenLispEidTableVniDumpReturnValid();
- final List<VniTableKey> keys = getCustomizer().getAllIds(validId, ctx);
-
- assertNotNull(keys);
- assertEquals(3, keys.size());
- assertTrue(keys.contains(new VniTableKey(12L)));
- assertTrue(keys.contains(new VniTableKey(14L)));
- assertTrue(keys.contains(new VniTableKey(16L)));
- }
-
- @Test
- public void testReadAllFailed() {
- whenLispEidTableVniDumpThrowException();
- try {
- getCustomizer().getAllIds(validId, ctx);
- } catch (ReadFailedException e) {
- assertTrue(e.getCause() instanceof VppCallbackException);
- return;
- }
-
- fail("Test should have thrown ReadFailedException");
- }
-
- @Test
- public void testReadAttributes() throws ReadFailedException {
- whenLispEidTableVniDumpReturnValid();
- VniTableBuilder builder = new VniTableBuilder();
-
- customizer.readCurrentAttributes(validId, builder, ctx);
-
- final VniTable table = builder.build();
- assertNotNull(table);
- assertEquals(12L, table.getVirtualNetworkIdentifier().longValue());
- }
-
- private void whenLispEidTableVniDumpReturnValid() {
-
- LispEidTableVniDetailsReplyDump dump = new LispEidTableVniDetailsReplyDump();
- LispEidTableVniDetails details1 = new LispEidTableVniDetails();
- details1.vni = 14;
-
- LispEidTableVniDetails details2 = new LispEidTableVniDetails();
- details2.vni = 12;
-
- LispEidTableVniDetails details3 = new LispEidTableVniDetails();
- details3.vni = 16;
-
- dump.lispEidTableVniDetails = ImmutableList.of(details1, details2, details3);
-
- when(api.lispEidTableVniDump(Mockito.any())).thenReturn(CompletableFuture.completedFuture(dump));
- }
-
- private void whenLispEidTableVniDumpThrowException() {
- when(api.lispEidTableVniDump(Mockito.any()))
- .thenReturn(failedFuture());
- }
-
- @Override
- protected ReaderCustomizer<VniTable, VniTableBuilder> initCustomizer() {
- return new VniTableCustomizer(api);
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/VrfSubtableCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/VrfSubtableCustomizerTest.java
deleted file mode 100644
index 58965ed..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/VrfSubtableCustomizerTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read;
-
-
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams.MapLevel.L3;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import io.fd.honeycomb.lisp.translate.read.trait.SubtableReaderTestCase;
-import io.fd.honeycomb.translate.read.ReadFailedException;
-import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.vpp.jvpp.VppCallbackException;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtableBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class VrfSubtableCustomizerTest extends SubtableReaderTestCase<VrfSubtable, VrfSubtableBuilder> {
-
- private InstanceIdentifier<VrfSubtable> validId;
-
- public VrfSubtableCustomizerTest() {
- super(VrfSubtable.class, VrfSubtableBuilder.class);
- }
-
- @Before
- public void init() {
- validId = InstanceIdentifier.create(EidTable.class).child(VniTable.class, new VniTableKey(expectedVni))
- .child(VrfSubtable.class);
- }
-
- @Test
- public void testReadCurrentSuccessfull() throws ReadFailedException {
- doReturnValidNonEmptyDataOnDump();
- VrfSubtableBuilder builder = new VrfSubtableBuilder();
- customizer.readCurrentAttributes(validId, builder, ctx);
-
- verifyLispEidTableMapDumpCalled(L3);
-
- final VrfSubtable subtable = builder.build();
- assertNotNull(subtable);
- assertEquals(expectedTableId, subtable.getTableId().longValue());
- }
-
- @Test
- public void testReadCurrentEmptyDump() throws ReadFailedException {
- doReturnEmptyDataOnDump();
- VrfSubtableBuilder builder = new VrfSubtableBuilder();
- customizer.readCurrentAttributes(validId, builder, ctx);
-
- verifyLispEidTableMapDumpCalled(L3);
-
- final VrfSubtable subtable = builder.build();
- assertNotNull(subtable);
- assertNull(subtable.getTableId());
- }
-
- @Test
- public void testReadCurrentFailed() {
- doThrowOnDump();
- VrfSubtableBuilder builder = new VrfSubtableBuilder();
- try {
- customizer.readCurrentAttributes(validId, builder, ctx);
- } catch (ReadFailedException e) {
- assertTrue(e.getCause() instanceof VppCallbackException);
- assertTrue(builder.getTableId() == null);
- verifyLispEidTableMapDumpNotCalled();
-
- return;
- }
-
- fail("Test should throw ReadFailedException");
- }
-
- @Override
- protected ReaderCustomizer<VrfSubtable, VrfSubtableBuilder> initCustomizer() {
- return new VrfSubtableCustomizer(api);
- }
-
- @Test
- public void testGetBuilder() {
- final VrfSubtableBuilder builder = customizer.getBuilder(validId);
-
- assertNotNull(builder);
- assertNull(builder.getLocalMappings());
- assertNull(builder.getRemoteMappings());
- assertNull(builder.getTableId());
- }
-
- @Test
- public void testMerge() {
- VniTableBuilder parentBuilder = new VniTableBuilder();
- VrfSubtable subtable = new VrfSubtableBuilder().build();
-
- customizer.merge(parentBuilder, subtable);
- assertEquals(subtable, parentBuilder.getVrfSubtable());
- }
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/MappingProducerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/MappingProducerTest.java
deleted file mode 100644
index 313f27d..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/MappingProducerTest.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.trait;
-
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4Afi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv6Afi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.MacAfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.LocalMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.local.mapping.EidBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class MappingProducerTest implements MappingProducer {
-
- private InstanceIdentifier<LocalMapping> validVrfLocalMappingId;
- private InstanceIdentifier<LocalMapping> validBridgeDomainLocalMappingId;
- private InstanceIdentifier<RemoteMapping> validVrfRemoteMappingId;
- private InstanceIdentifier<RemoteMapping> validBridgeDomainRemoteMappingId;
-
- private LocalMapping ipv4LocalMapping;
- private LocalMapping ipv6LocalMapping;
- private LocalMapping macLocalMapping;
-
- private RemoteMapping ipv4RemoteMapping;
- private RemoteMapping ipv6RemoteMapping;
- private RemoteMapping macRemoteMapping;
-
- @Before
- public void init() {
- validVrfLocalMappingId = InstanceIdentifier.create(VrfSubtable.class)
- .child(LocalMappings.class)
- .child(LocalMapping.class);
-
- validBridgeDomainLocalMappingId = InstanceIdentifier.create(BridgeDomainSubtable.class)
- .child(LocalMappings.class)
- .child(LocalMapping.class);
-
- validVrfRemoteMappingId = InstanceIdentifier.create(VrfSubtable.class)
- .child(RemoteMappings.class)
- .child(RemoteMapping.class);
-
- validBridgeDomainRemoteMappingId = InstanceIdentifier.create(BridgeDomainSubtable.class)
- .child(RemoteMappings.class)
- .child(RemoteMapping.class);
-
- ipv4LocalMapping = new LocalMappingBuilder()
- .setEid(new EidBuilder()
- .setAddressType(Ipv4Afi.class)
- .build()).build();
-
- ipv6LocalMapping = new LocalMappingBuilder()
- .setEid(new EidBuilder()
- .setAddressType(Ipv6Afi.class)
- .build()).build();
- macLocalMapping = new LocalMappingBuilder()
- .setEid(new EidBuilder()
- .setAddressType(MacAfi.class)
- .build()).build();
-
- ipv4RemoteMapping = new RemoteMappingBuilder()
- .setEid(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder()
- .setAddressType(Ipv4Afi.class).build()).build();
-
- ipv6RemoteMapping = new RemoteMappingBuilder()
- .setEid(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder()
- .setAddressType(Ipv6Afi.class).build()).build();
-
- macRemoteMapping = new RemoteMappingBuilder()
- .setEid(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder()
- .setAddressType(MacAfi.class).build()).build();
- }
-
- @Test
- public void testValidVrfLocal() {
- testPositiveCase(validVrfLocalMappingId, ipv4LocalMapping);
- testPositiveCase(validVrfLocalMappingId, ipv6LocalMapping);
- }
-
- @Test
- public void testValidBridgeDomainLocal() {
- testPositiveCase(validBridgeDomainLocalMappingId, macLocalMapping);
- }
-
- @Test
- public void testInvalidVrfLocal() {
- testNegativeCase(validVrfLocalMappingId, macLocalMapping);
- }
-
- @Test
- public void testInvalidBridgeDomainLocal() {
- testNegativeCase(validBridgeDomainLocalMappingId, ipv4LocalMapping);
- testNegativeCase(validBridgeDomainLocalMappingId, ipv6LocalMapping);
- }
-
-
- @Test
- public void testValidVrfRemote() {
- testPositiveCase(validVrfRemoteMappingId, ipv4RemoteMapping);
- testPositiveCase(validVrfRemoteMappingId, ipv6RemoteMapping);
- }
-
- @Test
- public void testValidBridgeDomainRemote() {
- testPositiveCase(validBridgeDomainRemoteMappingId, macRemoteMapping);
- }
-
- @Test
- public void testInvalidVrfRemote() {
- testNegativeCase(validVrfRemoteMappingId, macRemoteMapping);
- }
-
- @Test
- public void testInvalidBridgeDomainRemote() {
- testNegativeCase(validBridgeDomainRemoteMappingId, ipv4RemoteMapping);
- testNegativeCase(validBridgeDomainRemoteMappingId, ipv6RemoteMapping);
- }
-
- private void testNegativeCase(final InstanceIdentifier<LocalMapping> identifier, final LocalMapping data) {
- try {
- checkAllowedCombination(identifier, data);
- } catch (WriteFailedException e) {
- assertTrue(e instanceof WriteFailedException.CreateFailedException);
- assertTrue(e.getCause() instanceof IllegalArgumentException);
- return;
- }
-
- fail("Test should have failed");
- }
-
-
- private void testPositiveCase(final InstanceIdentifier<LocalMapping> identifier, final LocalMapping data) {
- try {
- checkAllowedCombination(identifier, data);
- } catch (WriteFailedException e) {
- fail("Test should have passed");
- }
- }
-
- private void testNegativeCase(final InstanceIdentifier<RemoteMapping> identifier, final RemoteMapping data) {
- try {
- checkAllowedCombination(identifier, data);
- } catch (WriteFailedException e) {
- assertTrue(e instanceof WriteFailedException.CreateFailedException);
- assertTrue(e.getCause() instanceof IllegalArgumentException);
- return;
- }
-
- fail("Test should have failed");
- }
-
-
- private void testPositiveCase(final InstanceIdentifier<RemoteMapping> identifier, final RemoteMapping data) {
- try {
- checkAllowedCombination(identifier, data);
- } catch (WriteFailedException e) {
- fail("Test should have passed");
- }
- }
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/MappingReaderTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/MappingReaderTest.java
deleted file mode 100644
index 9366037..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/MappingReaderTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.trait;
-
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.LocalMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.local.mappings.LocalMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.VrfSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class MappingReaderTest implements MappingReader {
-
- private InstanceIdentifier<LocalMapping> validVrfLocal;
- private InstanceIdentifier<LocalMapping> validBdLocal;
- private InstanceIdentifier<LocalMapping> invalidLocal;
-
- private InstanceIdentifier<RemoteMapping> validVrfRemote;
- private InstanceIdentifier<RemoteMapping> validBdRemote;
- private InstanceIdentifier<RemoteMapping> invalidRemote;
-
-
- @Before
- public void init() {
- validVrfLocal = InstanceIdentifier.create(VrfSubtable.class)
- .child(LocalMappings.class)
- .child(LocalMapping.class);
-
- validBdLocal = InstanceIdentifier.create(BridgeDomainSubtable.class)
- .child(LocalMappings.class)
- .child(LocalMapping.class);
-
- invalidLocal = InstanceIdentifier.create(LocalMapping.class);
-
- validVrfRemote = InstanceIdentifier.create(VrfSubtable.class)
- .child(RemoteMappings.class)
- .child(RemoteMapping.class);
-
- validBdRemote = InstanceIdentifier.create(BridgeDomainSubtable.class)
- .child(RemoteMappings.class)
- .child(RemoteMapping.class);
-
- invalidRemote = InstanceIdentifier.create(RemoteMapping.class);
- }
-
- @Test
- public void testVrfLocalValid() {
- assertEquals(VRF_MAPPINGS_ONLY, subtableFilterForLocalMappings(validVrfLocal));
- }
-
- @Test
- public void testBridgeDomainLocalValid() {
- assertEquals(BRIDGE_DOMAIN_MAPPINGS_ONLY, subtableFilterForLocalMappings(validBdLocal));
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testLocalInvalid() {
- subtableFilterForLocalMappings(invalidLocal);
- }
-
- @Test
- public void testVrfRemoteValid() {
- assertEquals(VRF_MAPPINGS_ONLY, subtableFilterForRemoteMappings(validVrfRemote));
- }
-
- @Test
- public void testBridgeDomainRemoteValid() {
- assertEquals(BRIDGE_DOMAIN_MAPPINGS_ONLY, subtableFilterForRemoteMappings(validBdRemote));
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testRemoteInvalid() {
- subtableFilterForRemoteMappings(invalidRemote);
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/SubtableReaderTestCase.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/SubtableReaderTestCase.java
deleted file mode 100644
index 3313395..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/read/trait/SubtableReaderTestCase.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.read.trait;
-
-
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.SubtableDumpParams.MapLevel;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import static org.mockito.MockitoAnnotations.initMocks;
-
-import com.google.common.collect.ImmutableList;
-import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest;
-import io.fd.vpp.jvpp.VppCallbackException;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetails;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetailsReplyDump;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDump;
-import java.util.Collections;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import org.junit.Before;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-
-public abstract class SubtableReaderTestCase<D extends DataObject, B extends Builder<D>>
- extends ReaderCustomizerTest<D, B>
- implements SubtableReader {
-
- protected final long expectedVni = 12;
- protected final int expectedTableId = 14;
-
- @Captor
- protected ArgumentCaptor<LispEidTableMapDump> requestCaptor;
-
- public SubtableReaderTestCase(final Class<D> dataObjectClass,
- final Class<? extends Builder<? extends DataObject>> parentBuilderClass) {
- super(dataObjectClass, parentBuilderClass);
- }
-
- protected void doReturnValidNonEmptyDataOnDump() {
- LispEidTableMapDetailsReplyDump reply = new LispEidTableMapDetailsReplyDump();
- LispEidTableMapDetails detailFirst = new LispEidTableMapDetails();
- detailFirst.vni = Long.valueOf(expectedVni).intValue();
- detailFirst.dpTable = expectedTableId;
-
- LispEidTableMapDetails detailSecond = new LispEidTableMapDetails();
- detailSecond.vni = 13;
- detailSecond.dpTable = 15;
-
- reply.lispEidTableMapDetails = ImmutableList.of(detailFirst, detailSecond);
-
- when(api.lispEidTableMapDump(any(LispEidTableMapDump.class)))
- .thenReturn(future(reply));
- }
-
- protected void doReturnEmptyDataOnDump() {
- LispEidTableMapDetailsReplyDump reply = new LispEidTableMapDetailsReplyDump();
- reply.lispEidTableMapDetails = Collections.emptyList();
- when(api.lispEidTableMapDump(any(LispEidTableMapDump.class)))
- .thenReturn(future(reply));
- }
-
- protected void doThrowOnDump() {
- when(api.lispEidTableMapDump(any(LispEidTableMapDump.class)))
- .thenReturn(failedFuture());
- }
-
- protected void verifyLispEidTableMapDumpCalled(@Nonnull final MapLevel expectedLevel) {
- verify(api, times(1)).lispEidTableMapDump(requestCaptor.capture());
- assertEquals(expectedLevel.getValue(), requestCaptor.getValue().isL2);
- }
-
- protected void verifyLispEidTableMapDumpNotCalled() {
- verify(api, times(1)).lispEidTableMapDump(any());
- }
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/util/EidTranslatorTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/util/EidTranslatorTest.java
deleted file mode 100755
index bc0bfc9..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/util/EidTranslatorTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.util;
-
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV4;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV6;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.MAC;
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.MacBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
-
-public class EidTranslatorTest implements EidTranslator {
-
- @Test
- public void testGetEidType() {
- assertEquals(IPV4, getEidType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder()
- .setAddress(
- new Ipv4Builder().setIpv4(
- new Ipv4Address("192.168.2.1"))
- .build())
- .build()));
-
- assertEquals(IPV6, getEidType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder()
- .setAddress(
- new Ipv6Builder().setIpv6(
- new Ipv6Address("2001:0db8:0a0b:12f0:0000:0000:0000:0001"))
- .build())
- .build()));
-
- assertEquals(MAC, getEidType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.remote.mapping.EidBuilder()
- .setAddress(
- new MacBuilder().setMac(
- new MacAddress("aa:bb:cc:dd:ee:ff"))
- .build())
- .build()));
- }
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/AdjacencyCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/AdjacencyCustomizerTest.java
deleted file mode 100644
index 0b2536b..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/AdjacencyCustomizerTest.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.ADDRESS_ONE;
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.ADDRESS_THREE;
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.LOCAL_EID_ONE;
-import static io.fd.honeycomb.lisp.translate.AdjacencyData.REMOTE_EID_ONE;
-import static io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV4;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import io.fd.honeycomb.lisp.context.util.AdjacenciesMappingContext;
-import io.fd.honeycomb.lisp.context.util.EidMappingContext;
-import io.fd.honeycomb.lisp.util.EidMappingContextHelper;
-import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
-import io.fd.vpp.jvpp.core.dto.LispAddDelAdjacency;
-import io.fd.vpp.jvpp.core.dto.LispAddDelAdjacencyReply;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4Afi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.MacAfi;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.MacBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.Adjacencies;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.Adjacency;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.LocalEidBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.adjacency.RemoteEidBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.RemoteMappings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.dp.subtable.grouping.remote.mappings.RemoteMappingKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class AdjacencyCustomizerTest extends WriterCustomizerTest implements EidMappingContextHelper {
-
- @Captor
- private ArgumentCaptor<LispAddDelAdjacency> requestCaptor;
-
- private EidMappingContext localMappingContext;
-
- private EidMappingContext remoteMappingContext;
-
- @Mock
- private AdjacenciesMappingContext adjacenciesMappingContext;
-
- private AdjacencyCustomizer customizer;
-
- private InstanceIdentifier<Adjacency> emptyId;
- private InstanceIdentifier<Adjacency> validId;
-
- private Adjacency emptyData;
- private Adjacency invalidData;
- private Adjacency validData;
-
- @Before
- public void init() {
- localMappingContext = new EidMappingContext("local-mapping-context");
- remoteMappingContext = new EidMappingContext("remote-mapping-context");
- customizer = new AdjacencyCustomizer(api, localMappingContext, remoteMappingContext, adjacenciesMappingContext);
-
- emptyId = InstanceIdentifier.create(Adjacency.class);
- validId = InstanceIdentifier.create(EidTable.class)
- .child(VniTable.class, new VniTableKey(2L))
- .child(BridgeDomainSubtable.class)
- .child(RemoteMappings.class)
- .child(RemoteMapping.class, new RemoteMappingKey(new MappingId("remote-mapping")))
- .child(Adjacencies.class)
- .child(Adjacency.class, new AdjacencyKey("adj-one"));
-
- emptyData = new AdjacencyBuilder().build();
-
- invalidData = new AdjacencyBuilder().setId("ID").setLocalEid(
- new LocalEidBuilder()
- .setVirtualNetworkId(new InstanceIdType(12L))
- .setAddressType(Ipv4Afi.class)
- .setAddress(new Ipv4Builder().setIpv4(new Ipv4Address("192.168.2.1")).build())
- .build()).setRemoteEid(
- new RemoteEidBuilder()
- .setVirtualNetworkId(new InstanceIdType(12L))
- .setAddressType(MacAfi.class)
- .setAddress(new MacBuilder().setMac(new MacAddress("aa:aa:aa:aa:aa:aa")).build())
- .build())
- .build();
-
- validData = new AdjacencyBuilder().setId("ID").setLocalEid(
- new LocalEidBuilder()
- .setVirtualNetworkId(new InstanceIdType(12L))
- .setAddressType(Ipv4Afi.class)
- .setAddress(new Ipv4Builder().setIpv4(ADDRESS_ONE).build())
- .build()).setRemoteEid(
- new RemoteEidBuilder()
- .setVirtualNetworkId(new InstanceIdType(12L))
- .setAddressType(Ipv4Afi.class)
- .setAddress(new Ipv4Builder().setIpv4(ADDRESS_THREE).build()).build()).build();
-
- when(api.lispAddDelAdjacency(any())).thenReturn(future(new LispAddDelAdjacencyReply()));
- }
-
- @Test
- public void writeCurrentAttributesNoKey() throws Exception {
- try {
- customizer.writeCurrentAttributes(emptyId, emptyData, writeContext);
- } catch (NullPointerException e) {
- verify(api, times(0)).lispAddDelAdjacency(any());
- return;
- }
-
- fail("Test should have failed while reading parent vni table id");
- }
-
- @Test
- public void writeCurrentAttributesInvalidCombination() throws Exception {
- try {
- customizer.writeCurrentAttributes(emptyId, invalidData, writeContext);
- } catch (NullPointerException e) {
- verify(api, times(0)).lispAddDelAdjacency(any());
- return;
- }
-
- fail("Test should have failed while reading parent vni table id");
- }
-
-
- @Test
- public void writeCurrentAttributes() throws Exception {
- defineEidMapping(mappingContext, LOCAL_EID_ONE, new MappingId("local-eid-one"), "local-mapping-context");
- defineEidMapping(mappingContext, REMOTE_EID_ONE, new MappingId("remote-eid-one"), "remote-mapping-context");
- customizer.writeCurrentAttributes(validId, validData, writeContext);
- verify(api, times(1)).lispAddDelAdjacency(requestCaptor.capture());
- verifyRequest(requestCaptor.getValue(), 1, new byte[]{-64, -88, 2, 1}, 32, new byte[]{-64, -88, 2, 3},
- 32, IPV4.getValue(), 2);
- verify(adjacenciesMappingContext, times(1))
- .addEidPair("adj-one", "local-eid-one", "remote-eid-one", mappingContext);
- }
-
- @Test
- public void writeCurrentAttributesNonExistingLocalMapping() throws Exception {
- noEidMappingDefined(mappingContext, "local-eid-one", "local-mapping-context");
- defineEidMapping(mappingContext, REMOTE_EID_ONE, new MappingId("remote-eid-one"), "remote-mapping-context");
- try {
- customizer.writeCurrentAttributes(validId, validData, writeContext);
- } catch (IllegalStateException e) {
- verify(api, times(0)).lispAddDelAdjacency(any());
- return;
- }
-
- fail("Test should have failed while verifying local eid");
- }
-
- @Test
- public void writeCurrentAttributesNonExistingRemoteMapping() throws Exception {
- noEidMappingDefined(mappingContext, "remote-eid-one", "remote-mapping-context");
- defineEidMapping(mappingContext, LOCAL_EID_ONE, new MappingId("local-eid-one"), "local-mapping-context");
-
- try {
- customizer.writeCurrentAttributes(validId, validData, writeContext);
- } catch (IllegalStateException e) {
- verify(api, times(0)).lispAddDelAdjacency(any());
- return;
- }
-
- fail("Test should have failed while verifying remote eid");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void updateCurrentAttributes() throws Exception {
- customizer.updateCurrentAttributes(emptyId, emptyData, emptyData, writeContext);
- }
-
- @Test
- public void deleteCurrentAttributesNoKey() throws Exception {
- try {
- customizer.deleteCurrentAttributes(emptyId, emptyData, writeContext);
- } catch (NullPointerException e) {
- verify(api, times(0)).lispAddDelAdjacency(any());
- return;
- }
-
- fail("Test should have failed while reading parent vni table id");
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void deleteCurrentAttributesInvalidCombination() throws Exception {
- customizer.deleteCurrentAttributes(validId, invalidData, writeContext);
- }
-
- @Test
- public void deleteCurrentAttributes() throws Exception {
- customizer.deleteCurrentAttributes(validId, validData, writeContext);
- verify(api, times(1)).lispAddDelAdjacency(requestCaptor.capture());
- verifyRequest(requestCaptor.getValue(), 0, new byte[]{-64, -88, 2, 1}, 32, new byte[]{-64, -88, 2, 3},
- 32, IPV4.getValue(), 2);
- verify(adjacenciesMappingContext, times(1)).removeForIndex("adj-one", mappingContext);
- }
-
- private static void verifyRequest(final LispAddDelAdjacency request, final int isAdd, final byte[] leid,
- final int leidLen, final byte[] reid, final int reidLen, final int eidType,
- final int vni) {
-
- assertNotNull(request);
- assertEquals(isAdd, request.isAdd);
- assertArrayEquals(leid, request.leid);
- assertEquals(leidLen, request.leidLen);
- assertArrayEquals(reid, request.reid);
- assertEquals(reidLen, request.reidLen);
- assertEquals(eidType, request.eidType);
- assertEquals(vni, request.vni);
-
- }
-} \ No newline at end of file
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/BridgeDomainCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/BridgeDomainCustomizerTest.java
deleted file mode 100644
index ada98bf..0000000
--- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/BridgeDomainCustomizerTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.honeycomb.lisp.translate.write;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import io.fd.honeycomb.lisp.translate.write.trait.SubtableWriterTestCase;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.vpp.jvpp.VppCallbackException;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.EidTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.VniTableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtableBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class BridgeDomainCustomizerTest extends SubtableWriterTestCase {
-
- private BridgeDomainSubtableCustomizer customizer;
- private InstanceIdentifier<BridgeDomainSubtable> validId;
- private BridgeDomainSubtable validData;
- private NamingContext bridgeDomainContext;
-
- @Before
- public void init() {
- bridgeDomainContext = new NamingContext("br", "bridge-domain-context");
- customizer = new BridgeDomainSubtableCustomizer(api, bridgeDomainContext);
- validId = InstanceIdentifier.create(EidTable.class).child(VniTable.class, new VniTableKey(12L))
- .child(BridgeDomainSubtable.class);
- validData = new BridgeDomainSubtableBuilder().setBridgeDomainRef("br-domain").build();
- defineMapping(mappingContext, "br-domain", 10, "bridge-domain-context");
- }
-
- @Test
- public void testWriteSuccessfull() throws WriteFailedException {
- whenAddDelEidTableAddDelMapSuccess();
- customizer.writeCurrentAttributes(validId, validData, writeContext);
- verifyAddDelEidTableAddDelMapInvokedCorrectly(1, 12, 10, 1);
- }
-
- @Test
- public void testWriteFailed() throws WriteFailedException {
- whenAddDelEidTableAddDelMapFail();
-
- try {
- customizer.writeCurrentAttributes(validId, validData, writeContext);
- } catch (Exception e) {
- assertTrue(e instanceof WriteFailedException);
-
- final WriteFailedException realException = ((WriteFailedException) e);
- assertEquals(validId, realException.getFailedId());
- assertTrue(e.getCause() instanceof VppCallbackException);
- return;
- }
-
- fail("Test should throw exception");
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void testUpdate() throws WriteFailedException {
- customizer.updateCurrentAttributes(validId, validData, validData, writeContext);
- }
-
- @Test
- public void testDeleteSuccessfull() throws WriteFailedException {
- whenAddDelEidTableAddDelMapSuccess();
- customizer.deleteCurrentAttributes(validId, validData, writeContext);
- verifyAddDelEidTableAddDelMapInvokedCorrectly(0, 12, 10, 1);
- }
-
- @Test
- public void testDeleteFailed() {
- whenAddDelEidTableAddDelMapFail();
-
- try {
- customizer.deleteCurrentAttributes(validId, validData, writeContext);
- } catch (Exception e) {
- assertTrue(e instanceof WriteFailedException);
-
- final WriteFailedException realException = ((WriteFailedException) e);
- assertEquals(validId, realException.getFailedId());
- assertTrue(e.getCause() instanceof VppCallbackException);
- return;
- }
-
- fail("Test should throw exception");
- }
-
-}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/write/InterfaceCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/translate/writ