Fix logging mismatches
[bgpcep.git] / pcep / pcc-mock / src / main / java / org / opendaylight / protocol / pcep / pcc / mock / PCCsBuilder.java
index 6710f04c54e897160bdc220334a0d24321e85ff5..e93f54bd12c8000a2a8a8a46bcb3d989257031cc 100644 (file)
@@ -17,7 +17,6 @@ import java.math.BigInteger;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.List;
-import java.util.concurrent.ExecutionException;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import org.opendaylight.protocol.concepts.KeyMapping;
@@ -51,10 +50,10 @@ final class PCCsBuilder {
     private final Timer timer = new HashedWheelTimer();
     private PCCDispatcherImpl pccDispatcher;
 
-    PCCsBuilder(final int lsps, final boolean pcError, final int pccCount, @Nonnull final InetSocketAddress localAddress,
-        @Nonnull final List<InetSocketAddress> remoteAddress, final short keepAlive, final short deadTimer,
-        @Nullable final String password, final long reconnectTime, final int redelegationTimeout, final int stateTimeout,
-        @Nonnull final PCEPCapability pcepCapabilities) {
+    PCCsBuilder(final int lsps, final boolean pcError, final int pccCount,
+            @Nonnull final InetSocketAddress localAddress, @Nonnull final List<InetSocketAddress> remoteAddress,
+            final short keepAlive, final short deadTimer, @Nullable final String password, final long reconnectTime,
+            final int redelegationTimeout, final int stateTimeout, @Nonnull final PCEPCapability pcepCapabilities) {
         this.lsps = lsps;
         this.pcError = pcError;
         this.pccCount = pccCount;
@@ -70,29 +69,29 @@ final class PCCsBuilder {
         startActivators();
     }
 
-    void createPCCs(final BigInteger initialDBVersion, final Optional<TimerHandler> timerHandler)
-        throws InterruptedException, ExecutionException {
+    void createPCCs(final BigInteger initialDBVersion, final Optional<TimerHandler> timerHandler) {
         InetAddress currentAddress = this.localAddress.getAddress();
         this.pccDispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance()
                 .getMessageHandlerRegistry());
-        if(timerHandler.isPresent()) {
+        if (timerHandler.isPresent()) {
             timerHandler.get().setPCCDispatcher(this.pccDispatcher);
         }
         for (int i = 0; i < this.pccCount; i++) {
             final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(this.lsps, currentAddress,
                 this.redelegationTimeout, this.stateTimeout, this.timer, timerHandler);
-            createPCC(new InetSocketAddress(currentAddress, localAddress.getPort()), tunnelManager, initialDBVersion);
+            createPCC(new InetSocketAddress(currentAddress, this.localAddress.getPort()), tunnelManager,
+                    initialDBVersion);
             currentAddress = InetAddresses.increment(currentAddress);
         }
     }
 
-    private void createPCC(@Nonnull final InetSocketAddress localAddress, @Nonnull final PCCTunnelManager tunnelManager,
-        final BigInteger initialDBVersion) throws InterruptedException, ExecutionException {
+    private void createPCC(@Nonnull final InetSocketAddress plocalAddress,
+            final PCCTunnelManager tunnelManager, final BigInteger initialDBVersion) {
         final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf = getSessionNegotiatorFactory();
         for (final InetSocketAddress pceAddress : this.remoteAddress) {
             this.pccDispatcher.createClient(pceAddress, this.reconnectTime, () -> new PCCSessionListener(
-                remoteAddress.indexOf(pceAddress), tunnelManager, pcError), snf,
-                KeyMapping.getKeyMapping(pceAddress.getAddress(), password), localAddress, initialDBVersion);
+                            this.remoteAddress.indexOf(pceAddress), tunnelManager, this.pcError), snf,
+                    KeyMapping.getKeyMapping(pceAddress.getAddress(), this.password), plocalAddress, initialDBVersion);
         }
     }