diff options
author | 2016-09-23 16:39:09 +0200 | |
---|---|---|
committer | 2016-09-23 16:41:57 +0200 | |
commit | 60d69218642cc976fa606fd8a38623d8c035dd86 (patch) | |
tree | a0ccb089d93198ff7c9974eaf3e39e44a1a1f06d /v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizer.java | |
parent | 08cd3ae5fd61d60ec07996179146c956459c084f (diff) |
HONEYCOMB-145 - Utility Class Refactoring
problematic mockito-all changed to mockito-core( https://github.com/mockito/mockito/issues/324)
Translate Utils Splitted to multiple Trait Interfaces
Ipv4Translator - Logic for translation of ipv4-based data
Ipv6Translator - Logic for translation of ipv6-based data
MacTranslator - Logic for translation of mac-based data
AddressTranslator - Aggregation trait for Ipv4/Ipv6/Mac
JvppReplyConsumer - Logic for extracting replies from jvpp calls
ByteDataTranslator - any byte-based conversions
Plus some existing utility classes changed to traits
Change-Id: I342b625954223966802e65dca0fabf8456c89345
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizer.java')
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizer.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizer.java index 574a42eb5..8ab5b6b62 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizer.java @@ -45,7 +45,8 @@ import org.slf4j.LoggerFactory; /** * Customizer for writing {@link Address} */ -public class Ipv4AddressCustomizer extends FutureJVppCustomizer implements ListWriterCustomizer<Address, AddressKey> { +public class Ipv4AddressCustomizer extends FutureJVppCustomizer + implements ListWriterCustomizer<Address, AddressKey>, Ipv4Writer { private static final Logger LOG = LoggerFactory.getLogger(Ipv4AddressCustomizer.class); private final NamingContext interfaceContext; @@ -131,8 +132,8 @@ public class Ipv4AddressCustomizer extends FutureJVppCustomizer implements ListW final DottedQuad netmask = subnet.getNetmask(); checkNotNull(netmask, "netmask value should not be null"); - final byte subnetLength = Ipv4WriteUtils.getSubnetMaskLength(netmask.getValue()); - Ipv4WriteUtils.addDelAddress(getFutureJVpp(), add, id, interfaceIndex, address.getIp(), subnetLength); + final byte subnetLength = getSubnetMaskLength(netmask.getValue()); + addDelAddress(getFutureJVpp(), add, id, interfaceIndex, address.getIp(), subnetLength); } catch (VppBaseCallException e) { LOG.warn("Failed to set Subnet(subnet-mask) for interface: {}(id={}). Subnet: {}, address: {}", interfaceName, interfaceIndex, subnet, address); @@ -148,7 +149,7 @@ public class Ipv4AddressCustomizer extends FutureJVppCustomizer implements ListW LOG.debug("Setting Subnet(prefix-length) for interface: {}(id={}). Subnet: {}, address: {}", interfaceName, interfaceIndex, subnet, address); - Ipv4WriteUtils.addDelAddress(getFutureJVpp(), add, id, interfaceIndex, address.getIp(), + addDelAddress(getFutureJVpp(), add, id, interfaceIndex, address.getIp(), subnet.getPrefixLength().byteValue()); LOG.debug("Subnet(prefix-length) set successfully for interface: {}(id={}). Subnet: {}, address: {}", |