diff options
author | 2016-04-10 22:06:36 +0200 | |
---|---|---|
committer | 2016-04-12 10:59:14 +0200 | |
commit | 6dcea1de979536dbe0478e31f17191bcfae92f3c (patch) | |
tree | a5070e77f1de0c17476a33aeaaa68fc21ba4315a /v3po/v3po2vpp/src | |
parent | 4ebc67b58e0172bd4f5704e52a10714ee64d7d07 (diff) |
HONEYCOMB-34: Configurable serializer dependency
Change-Id: I05cb7836ec4a379f7617710a6c6f64c3541ff0c9
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src')
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/BridgeDomainCustomizer.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/BridgeDomainCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/BridgeDomainCustomizer.java index 36e1da366..39f164e4b 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/BridgeDomainCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/BridgeDomainCustomizer.java @@ -39,10 +39,14 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.openvpp.vppjapi.vppBridgeDomainDetails; import org.openvpp.vppjapi.vppBridgeDomainInterfaceDetails; import org.openvpp.vppjapi.vppL2Fib; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public final class BridgeDomainCustomizer extends VppApiCustomizer implements ListReaderCustomizer<BridgeDomain, BridgeDomainKey, BridgeDomainBuilder> { + private static final Logger LOG = LoggerFactory.getLogger(BridgeDomainCustomizer.class); + public BridgeDomainCustomizer(@Nonnull final org.openvpp.vppjapi.vppApi vppApi) { super(vppApi); } @@ -50,11 +54,18 @@ public final class BridgeDomainCustomizer extends VppApiCustomizer @Override public void readCurrentAttributes(@Nonnull final InstanceIdentifier<BridgeDomain> id, @Nonnull final BridgeDomainBuilder builder, @Nonnull final Context context) { + LOG.debug("vppstate.BridgeDomainCustomizer.readCurrentAttributes: id={}, builderbuilder={}, context={}", + id, builder, context); + final BridgeDomainKey key = id.firstKeyOf(id.getTargetType()); // TODO find out if bd exists based on name and if not return + LOG.debug("vppstate.BridgeDomainCustomizer.readCurrentAttributes: key={}", key); final int bdId = getVppApi().bridgeDomainIdFromName(key.getName()); + LOG.debug("vppstate.BridgeDomainCustomizer.readCurrentAttributes: bdId={}", bdId); + final vppBridgeDomainDetails bridgeDomainDetails = getVppApi().getBridgeDomainDetails(bdId); + logBridgeDomainDetails(bridgeDomainDetails); builder.setName(key.getName()); // builder.setName(bridgeDomainDetails.name); @@ -83,6 +94,21 @@ public final class BridgeDomainCustomizer extends VppApiCustomizer builder.setL2Fib(l2Fibs); } + private void logBridgeDomainDetails(final vppBridgeDomainDetails bridgeDomainDetails) { + LOG.debug("bridgeDomainDetails={}", bridgeDomainDetails); + if (bridgeDomainDetails != null) { + LOG.debug("bridgeDomainDetails.arpTerm={}", bridgeDomainDetails.arpTerm); + LOG.debug("bridgeDomainDetails.bdId={}", bridgeDomainDetails.bdId); + LOG.debug("bridgeDomainDetails.bviInterfaceName={}", bridgeDomainDetails.bviInterfaceName); + LOG.debug("bridgeDomainDetails.flood={}", bridgeDomainDetails.flood); + LOG.debug("bridgeDomainDetails.forward={}", bridgeDomainDetails.forward); + LOG.debug("bridgeDomainDetails.learn={}", bridgeDomainDetails.learn); + LOG.debug("bridgeDomainDetails.name={}", bridgeDomainDetails.name); + LOG.debug("bridgeDomainDetails.uuFlood={}", bridgeDomainDetails.uuFlood); + } + } + + private static String getMacAddress(byte[] mac) { StringBuilder sb = new StringBuilder(18); for (byte b : mac) { @@ -116,13 +142,18 @@ public final class BridgeDomainCustomizer extends VppApiCustomizer @Override public List<BridgeDomainKey> getAllIds(@Nonnull final InstanceIdentifier<BridgeDomain> id, @Nonnull final Context context) { final int[] bIds = getVppApi().bridgeDomainDump(-1); + LOG.debug("vppstate.BridgeDomainCustomizer.getAllIds: bIds.length={}", bIds.length); final List<BridgeDomainKey> allIds = new ArrayList<>(bIds.length); for (int bId : bIds) { + LOG.debug("vppstate.BridgeDomainCustomizer.getAllIds: bId={}", bId); // FIXME this is highly inefficient having to dump all of the bridge domain details // Use context to store already read information // TODO Or just remove the getAllIds method and replace with a simple readAll final vppBridgeDomainDetails bridgeDomainDetails = getVppApi().getBridgeDomainDetails(bId); + logBridgeDomainDetails(bridgeDomainDetails); + final String bName = bridgeDomainDetails.name; + LOG.debug("vppstate.BridgeDomainCustomizer.getAllIds: bName={}", bName); allIds.add(new BridgeDomainKey(bName)); } |