X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pcep%2Fpcc-mock%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fpcc%2Fmock%2FPCCsBuilder.java;h=e93f54bd12c8000a2a8a8a46bcb3d989257031cc;hb=e12a8c80cf933d71dcba362ede913a7f65a99c1a;hp=6710f04c54e897160bdc220334a0d24321e85ff5;hpb=adefcce2fc703a06ce951a3e23d147a4f2b03fad;p=bgpcep.git diff --git a/pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCsBuilder.java b/pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCsBuilder.java index 6710f04c54..e93f54bd12 100644 --- a/pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCsBuilder.java +++ b/pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCsBuilder.java @@ -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 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 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) - throws InterruptedException, ExecutionException { + void createPCCs(final BigInteger initialDBVersion, final Optional 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 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); } }