summaryrefslogtreecommitdiffstats
path: root/vbd/impl/src/main
diff options
context:
space:
mode:
authorRobert Varga <nite@hq.sk>2016-02-12 18:46:46 +0100
committerMarek Gradzki <mgradzki@cisco.com>2016-03-02 06:21:13 +0000
commit40e3a99694badc0dddad2ddf900c17979c299dfd (patch)
tree2269790eb87656483dd8961d6d83c463d90a1cb9 /vbd/impl/src/main
parent013d345ef6710abe4a8db3778b1e67f602ffc659 (diff)
Fix eclipse warnings
Reduce visibility of implementation class, add SafeVargars, make methods sstatic. Change-Id: I56c81371fad39b527d1423508537de59bd171e5b Signed-off-by: Robert Varga <nite@hq.sk>
Diffstat (limited to 'vbd/impl/src/main')
-rw-r--r--vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/BridgeDomain.java6
-rw-r--r--vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/VppModifier.java14
2 files changed, 11 insertions, 9 deletions
diff --git a/vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/BridgeDomain.java b/vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/BridgeDomain.java
index 915e1b431..02c5d89ed 100644
--- a/vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/BridgeDomain.java
+++ b/vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/BridgeDomain.java
@@ -295,7 +295,7 @@ final class BridgeDomain implements DataTreeChangeListener<Topology> {
wTx.submit();
}
- private Link prepareLinkData(final NodeId newVpp, final NodeId oldVpp, final LinkId linkId,
+ private static Link prepareLinkData(final NodeId newVpp, final NodeId oldVpp, final LinkId linkId,
final int srcVxlanTunnelId, final int dstVxlanTunnelId) {
final LinkBuilder linkBuilder = new LinkBuilder();
linkBuilder.setLinkId(linkId);
@@ -332,9 +332,9 @@ final class BridgeDomain implements DataTreeChangeListener<Topology> {
}
private void addSupportingBridgeDomain(final ListenableFuture<Void> addVppToBridgeDomainFuture, final Node node) {
- Futures.addCallback(addVppToBridgeDomainFuture, new FutureCallback() {
+ Futures.addCallback(addVppToBridgeDomainFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Object result) {
+ public void onSuccess(Void result) {
LOG.debug("Storing bridge member to operational DS....");
final BridgeMemberBuilder bridgeMemberBuilder = new BridgeMemberBuilder();
bridgeMemberBuilder.setSupportingBridgeDomain(new ExternalReference(iiBridgeDomainOnVPPRest));
diff --git a/vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/VppModifier.java b/vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/VppModifier.java
index 00cd3012b..c23f0f6ef 100644
--- a/vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/VppModifier.java
+++ b/vbd/impl/src/main/java/io/fd/honeycomb/vbd/impl/VppModifier.java
@@ -59,7 +59,7 @@ import org.slf4j.LoggerFactory;
/**
* Class which is used for manipulation with VPP
*/
-public class VppModifier {
+final class VppModifier {
private static final Long DEFAULT_ENCAP_VRF_ID = 0L;
private static final Logger LOG = LoggerFactory.getLogger(BridgeDomain.class);
@@ -69,21 +69,23 @@ public class VppModifier {
private final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomain> iiBridgeDomainOnVPP;
- public VppModifier(final MountPointService mountService, final String bridgeDomainName) {
+ VppModifier(final MountPointService mountService, final String bridgeDomainName) {
this.mountService = mountService;
this.bridgeDomainName = bridgeDomainName;
this.iiBridgeDomainOnVPP = InstanceIdentifier.create(Vpp.class)
.child(BridgeDomains.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomain.class, new BridgeDomainKey(bridgeDomainName));
}
+
/**
* Tryies to read ipv4 addresses from all specified {@code iiToVpps } vpps.
*
* @param iiToVpps collection of instance identifiers which points to concrete mount points.
* @return future which contains list of ip addreases in the same order as was specified in {@code iiToVpps}
*/
- ListenableFuture<List<Optional<Ipv4AddressNoZone>>> readIpAddressesFromVpps(final KeyedInstanceIdentifier<Node, NodeKey>... iiToVpps) {
- final List<ListenableFuture<Optional<Ipv4AddressNoZone>>> ipv4Futures = new ArrayList<>();
+ @SafeVarargs
+ final ListenableFuture<List<Optional<Ipv4AddressNoZone>>> readIpAddressesFromVpps(final KeyedInstanceIdentifier<Node, NodeKey>... iiToVpps) {
+ final List<ListenableFuture<Optional<Ipv4AddressNoZone>>> ipv4Futures = new ArrayList<>(iiToVpps.length);
for (final KeyedInstanceIdentifier<Node, NodeKey> iiToVpp : iiToVpps) {
ipv4Futures.add(readIpAddressFromVpp(iiToVpp));
}
@@ -166,7 +168,7 @@ public class VppModifier {
@Override
public void onFailure(Throwable t) {
- LOG.debug("Writing super virtual interface to {} failed.", iiToVpp.getKey().getNodeId());
+ LOG.debug("Writing super virtual interface to {} failed.", iiToVpp.getKey().getNodeId(), t);
}
});
} else {
@@ -174,7 +176,7 @@ public class VppModifier {
}
}
- private Interface prepareVirtualInterfaceData(final Vxlan vxlan, Integer vxlanTunnelId) {
+ private static Interface prepareVirtualInterfaceData(final Vxlan vxlan, Integer vxlanTunnelId) {
final InterfaceBuilder interfaceBuilder = new InterfaceBuilder();
//TODO implement tunnel counter
interfaceBuilder.setName(VbdUtil.provideVxlanId(vxlanTunnelId));