final String password, final long reconnectTime, final int redelegationTimeout, final int stateTimeout, final Timer timer) throws InterruptedException, ExecutionException {
startActivators();
InetAddress currentAddress = localAddress.getAddress();
- final PccDispatcherImpl pccDispatcher = new PccDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
+ final PCCDispatcherImpl pccDispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
for (int i = 0; i < pccCount; i++) {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(lspsPerPcc, currentAddress,
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(lspsPerPcc, currentAddress,
redelegationTimeout, stateTimeout, timer);
createPCC(pcerr, new InetSocketAddress(currentAddress, localAddress.getPort()),
remoteAddress, getSessionNegotiatorFactory(keepalive, deadtimer), pccDispatcher, password, reconnectTime, tunnelManager);
}
private static void createPCC(final boolean pcerr, final InetSocketAddress localAddress,
- final List<InetSocketAddress> remoteAddress, final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf, final PccDispatcherImpl pccDispatcher,
+ final List<InetSocketAddress> remoteAddress, final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf, final PCCDispatcherImpl pccDispatcher,
final String password, final long reconnectTime, final PccTunnelManager tunnelManager) throws InterruptedException, ExecutionException {
for (final InetSocketAddress pceAddress : remoteAddress) {
new PCEPSessionListenerFactory() {
@Override
public PCEPSessionListener getSessionListener() {
- return new PccSessionListener(remoteAddress.indexOf(pceAddress), tunnelManager, pcerr);
+ return new PCCSessionListener(remoteAddress.indexOf(pceAddress), tunnelManager, pcerr);
}
}, snf, getKeyMapping(pceAddress.getAddress(), password), localAddress);
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public final class PccDispatcherImpl implements PccDispatcher, AutoCloseable {
+public final class PCCDispatcherImpl implements PccDispatcher, AutoCloseable {
- private static final Logger LOG = LoggerFactory.getLogger(PccDispatcherImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(PCCDispatcherImpl.class);
private static final int RECONNECT_STRATEGY_TIMEOUT = 2000;
private final MD5ChannelFactory<?> cf;
private final NioEventLoopGroup workerGroup;
- public PccDispatcherImpl(final MessageRegistry registry) {
+ public PCCDispatcherImpl(final MessageRegistry registry) {
this.workerGroup = new NioEventLoopGroup();
this.factory = new PCEPHandlerFactory(registry);
this.cf = new MD5NioSocketChannelFactory(DeafultKeyAccessFactory.getKeyAccessFactory());
setChannelFactory(b, keys);
b.option(ChannelOption.SO_KEEPALIVE, true);
b.option(ChannelOption.MAX_MESSAGES_PER_READ, 1);
- final PccReconnectPromise promise = new PccReconnectPromise(remoteAddress,
+ final PCCReconnectPromise promise = new PCCReconnectPromise(remoteAddress,
reconnectTime == -1 ? getNeverReconnectStrategyFactory() : getTimedReconnectStrategyFactory(reconnectTime), b);
final ChannelInitializer<SocketChannel> channelInitializer = new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(final SocketChannel ch) throws Exception {
- ch.pipeline().addLast(PccDispatcherImpl.this.factory.getDecoders());
+ ch.pipeline().addLast(PCCDispatcherImpl.this.factory.getDecoders());
ch.pipeline().addLast("negotiator", negotiatorFactory.getSessionNegotiator(listenerFactory, ch, promise, null));
- ch.pipeline().addLast(PccDispatcherImpl.this.factory.getEncoders());
+ ch.pipeline().addLast(PCCDispatcherImpl.this.factory.getEncoders());
ch.pipeline().addLast(new ChannelInboundHandlerAdapter() {
@Override
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
LOG.debug("Connection to {} was dropped during negotiation, reattempting", remoteAddress);
}
LOG.debug("Reconnecting after connection to {} was dropped", remoteAddress);
- PccDispatcherImpl.this.createClient(remoteAddress, reconnectTime, listenerFactory, negotiatorFactory,
+ PCCDispatcherImpl.this.createClient(remoteAddress, reconnectTime, listenerFactory, negotiatorFactory,
keys, localAddress);
}
});
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class PccReconnectPromise extends DefaultPromise<PCEPSession> {
+public class PCCReconnectPromise extends DefaultPromise<PCEPSession> {
- private static final Logger LOG = LoggerFactory.getLogger(PccReconnectPromise.class);
+ private static final Logger LOG = LoggerFactory.getLogger(PCCReconnectPromise.class);
private final InetSocketAddress address;
private final Bootstrap b;
@GuardedBy("this")
private Future<?> pending;
- public PccReconnectPromise(final InetSocketAddress address, final ReconnectStrategyFactory rsf, final Bootstrap b) {
+ public PCCReconnectPromise(final InetSocketAddress address, final ReconnectStrategyFactory rsf, final Bootstrap b) {
this.address = address;
this.b = b;
this.reconnectStrategy = rsf.createReconnectStrategy();
try {
this.b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, this.reconnectStrategy.getConnectTimeout());
final ChannelFuture cf = this.b.connect(this.address);
- cf.addListener(new BootstrapConnectListener(PccReconnectPromise.this));
+ cf.addListener(new BootstrapConnectListener(PCCReconnectPromise.this));
this.pending = cf;
} catch (final Exception e) {
LOG.info("Failed to connect to {}", this.address, e);
public void operationComplete(final ChannelFuture cf) throws Exception {
synchronized (this.lock) {
- if (PccReconnectPromise.this.isCancelled()) {
+ if (PCCReconnectPromise.this.isCancelled()) {
if (cf.isSuccess()) {
- PccReconnectPromise.LOG.debug("Closing channels for cancelled promise {}");
+ PCCReconnectPromise.LOG.debug("Closing channels for cancelled promise {}");
cf.channel().close();
}
} else if (cf.isSuccess()) {
- PccReconnectPromise.LOG.debug("Promise connection is successful.");
+ PCCReconnectPromise.LOG.debug("Promise connection is successful.");
} else {
- PccReconnectPromise.LOG.debug("Attempt to reconnect using reconnect strategy ...");
- final Future<Void> rf = PccReconnectPromise.this.reconnectStrategy.scheduleReconnect(cf.cause());
- rf.addListener(new PccReconnectPromise.BootstrapConnectListener.ReconnectStrategyListener());
+ PCCReconnectPromise.LOG.debug("Attempt to reconnect using reconnect strategy ...");
+ final Future<Void> rf = PCCReconnectPromise.this.reconnectStrategy.scheduleReconnect(cf.cause());
+ rf.addListener(new PCCReconnectPromise.BootstrapConnectListener.ReconnectStrategyListener());
}
}
}
@Override
public void operationComplete(final Future<Void> f ) {
synchronized (BootstrapConnectListener.this.lock) {
- if (!PccReconnectPromise.this.isCancelled()) {
+ if (!PCCReconnectPromise.this.isCancelled()) {
if (f.isSuccess()) {
- PccReconnectPromise.LOG.debug("ReconnectStrategy has scheduled a retry.");
- PccReconnectPromise.this.connect();
+ PCCReconnectPromise.LOG.debug("ReconnectStrategy has scheduled a retry.");
+ PCCReconnectPromise.this.connect();
} else {
- PccReconnectPromise.LOG.debug("ReconnectStrategy has failed. No attempts will be made.");
- PccReconnectPromise.this.setFailure(f.cause());
+ PCCReconnectPromise.LOG.debug("ReconnectStrategy has failed. No attempts will be made.");
+ PCCReconnectPromise.this.setFailure(f.cause());
}
}
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class PccSessionListener implements PCEPSessionListener, PccSession {
+public class PCCSessionListener implements PCEPSessionListener, PccSession {
- private static final Logger LOG = LoggerFactory.getLogger(PccSessionListener.class);
+ private static final Logger LOG = LoggerFactory.getLogger(PCCSessionListener.class);
private final boolean errorMode;
private final PccTunnelManager tunnelManager;
private final int sessionId;
private PCEPSession session;
- public PccSessionListener(final int sessionId, final PccTunnelManager tunnelManager, final boolean errorMode) {
+ public PCCSessionListener(final int sessionId, final PccTunnelManager tunnelManager, final boolean errorMode) {
this.errorMode = errorMode;
this.tunnelManager = tunnelManager;
this.sessionId = sessionId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefixBuilder;
-public class PccTunnelManagerImpl implements PccTunnelManager {
+public class PCCTunnelManagerImpl implements PccTunnelManager {
private static final Subobject DEFAULT_ENDPOINT_HOP = getDefaultEROEndpointHop();
private static final String ENDPOINT_ADDRESS = "1.1.1.1";
private final int redelegationTimeout;
private final int stateTimeout;
- public PccTunnelManagerImpl(final int lspsCount, final InetAddress address, final int redelegationTimeout,
- final int stateTimeout, final Timer timer) {
+ public PCCTunnelManagerImpl(final int lspsCount, final InetAddress address, final int redelegationTimeout,
+ final int stateTimeout, final Timer timer) {
Preconditions.checkArgument(lspsCount >= 0);
Preconditions.checkNotNull(address);
this.redelegationTimeout = redelegationTimeout;
@Override
public void run(final Timeout timeout) throws Exception {
if (tunnel.getType() == LspType.PCE_LSP) {
- PccTunnelManagerImpl.this.tunnels.remove(plspId);
+ PCCTunnelManagerImpl.this.tunnels.remove(plspId);
//report tunnel removal to all
sendToAll(tunnel, plspId, Collections.<Subobject>emptyList(), createSrp(0), new PathBuilder().build(),
createLsp(plspId.getValue(), false, Optional.<Tlvs>absent(), false, true));
@Override
public void run(final Timeout timeout) throws Exception {
//remove delegation
- PccTunnelManagerImpl.this.setDelegation(plspId, null);
+ PCCTunnelManagerImpl.this.setDelegation(plspId, null);
//delegate to another PCE
int index = session.getId();
- for (int i = 1; i < PccTunnelManagerImpl.this.sessions.size(); i++) {
+ for (int i = 1; i < PCCTunnelManagerImpl.this.sessions.size(); i++) {
index++;
- if (index == PccTunnelManagerImpl.this.sessions.size()) {
+ if (index == PCCTunnelManagerImpl.this.sessions.size()) {
index = 0;
}
- final PccSession nextSession = PccTunnelManagerImpl.this.sessions.get(index);
+ final PccSession nextSession = PCCTunnelManagerImpl.this.sessions.get(index);
if (nextSession != null) {
tunnel.cancelTimeouts();
final Tlvs tlvs = createLspTlvs(plspId.getValue(), true,
- getDestinationAddress(tunnel.getLspState().getEro().getSubobject(), PccTunnelManagerImpl.this.address),
- PccTunnelManagerImpl.this.address, PccTunnelManagerImpl.this.address, Optional.of(tunnel.getPathName()));
+ getDestinationAddress(tunnel.getLspState().getEro().getSubobject(), PCCTunnelManagerImpl.this.address),
+ PCCTunnelManagerImpl.this.address, PCCTunnelManagerImpl.this.address, Optional.of(tunnel.getPathName()));
nextSession.sendReport(createPcRtpMessage(
createLsp(plspId.getValue(), true, Optional.<Tlvs> fromNullable(tlvs), true, false), NO_SRP,
tunnel.getLspState()));
import org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl;
import org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext;
-public class PccDispatcherImplTest {
+public class PCCDispatcherImplTest {
private static final List<PCEPCapability> CAPS = new ArrayList<>();
private static final PCEPSessionProposalFactory PROPOSAL = new BasePCEPSessionProposalFactory(30, 120, CAPS);
- private PccDispatcherImpl dispatcher;
+ private PCCDispatcherImpl dispatcher;
private final DefaultPCEPSessionNegotiatorFactory nf = new DefaultPCEPSessionNegotiatorFactory(PROPOSAL, 0);
private PCEPDispatcher pcepDispatcher;
private InetSocketAddress serverAddress;
public void setUp() {
this.workerGroup = new NioEventLoopGroup();
this.bossGroup = new NioEventLoopGroup();
- this.dispatcher = new PccDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
+ this.dispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
this.pcepDispatcher = new PCEPDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry(),
this.nf, this.bossGroup, this.workerGroup);
this.serverAddress = new InetSocketAddress("127.0.5.0", getRandomPort());
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefixBuilder;
-public class PccSessionListenerTest {
+public class PCCSessionListenerTest {
@Mock
private PCEPSession mockedSession;
Mockito.doAnswer(new Answer<Void>() {
@Override
public Void answer(final InvocationOnMock invocation) throws Throwable {
- PccSessionListenerTest.this.sendMessages.add((Message) invocation.getArguments()[0]);
+ PCCSessionListenerTest.this.sendMessages.add((Message) invocation.getArguments()[0]);
return null;
}
}).when(mockedSession).sendMessage(Mockito.any(Message.class));
@Test
public void testOnMessage() {
- final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+ final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
listener.onMessage(mockedSession, createUpdMsg(true));
Mockito.verify(tunnelManager).reportToAll(Mockito.any(Updates.class), Mockito.any(PccSession.class));
listener.onMessage(mockedSession, createUpdMsg(false));
@Test
public void testOnMessageErrorMode() {
- final PccSessionListener listener = new PccSessionListener(1, tunnelManager, true);
+ final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, true);
listener.onMessage(mockedSession, createUpdMsg(true));
Mockito.verify(mockedSession).sendMessage(Mockito.any(Message.class));
}
@Test
public void testOnSessionUp() {
- final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+ final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
listener.onSessionUp(mockedSession);
Mockito.verify(tunnelManager).onSessionUp(Mockito.any(PccSession.class));
}
@Test
public void testOnSessionDown() {
- final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+ final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
listener.onSessionDown(mockedSession, new Exception());
Mockito.verify(tunnelManager).onSessionDown(Mockito.any(PccSession.class));
}
@Test
public void testSendError() {
- final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+ final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
listener.onSessionUp(mockedSession);
listener.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.ATTEMPT_2ND_SESSION, 0));
Mockito.verify(mockedSession).sendMessage(Mockito.<Message>any());
@Test
public void testSendReport() {
- final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+ final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
listener.onSessionUp(mockedSession);
listener.sendReport(null);
Mockito.verify(mockedSession).sendMessage(Mockito.<Message>any());
@Test
public void testGetId() {
- final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+ final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
Assert.assertEquals(1, listener.getId());
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefixBuilder;
-public class PccTunnelManagerImplTest {
+public class PCCTunnelManagerImplTest {
private static final InetAddress ADDRESS = InetAddresses.forString("1.2.4.5");
private static final Timer TIMER = new HashedWheelTimer();
@Test
public void testOnSessionUp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
//1 reported LSP + 1 end-of-sync marker
@Test
public void testOnSessionDownAndDelegateBack() throws InterruptedException {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 1, 10, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 1, 10, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
Mockito.verify(session1, Mockito.times(2)).sendReport(Mockito.any(Pcrpt.class));
@Test
public void testOnSessionDownAndDelegateToOther() throws InterruptedException {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, -1, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, -1, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
Mockito.verify(session1, Mockito.times(2)).sendReport(Mockito.any(Pcrpt.class));
@Test
public void testReportToAll() throws InterruptedException {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.reportToAll(createUpdate(1), session1);
@Test
public void testReportToAllUnknownLsp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.reportToAll(createUpdate(2), session1);
Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@Test
public void testReportToAllNonDelegatedLsp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.reportToAll(createUpdate(1), session2);
@Test
public void testReturnDelegationPccLsp() throws InterruptedException {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 1, -1, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 1, -1, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.returnDelegation(createUpdate(1), session1);
@Test
public void testReturnDelegationUnknownLsp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.returnDelegation(createUpdate(2), session1);
Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@Test
public void testReturnDelegationNonDelegatedLsp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.returnDelegation(createUpdate(1), session2);
@Test
public void testAddTunnel() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.addTunnel(createRequests(1), session1);
@Test
public void testRemoveTunnel() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.addTunnel(createRequests(1), session1);
@Test
public void testRemoveTunnelUnknownLsp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.removeTunnel(createRequests(1), session1);
Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@Test
public void testRemoveTunnelNotPceInitiatedLsp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.removeTunnel(createRequests(1), session1);
Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@Test
public void testRemoveTunnelNotDelegated() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.addTunnel(createRequests(1), session1);
@Test
public void testTakeDelegation() throws InterruptedException {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, -1, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, -1, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.addTunnel(createRequests(1), session1);
@Test
public void testTakeDelegationUnknownLsp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.takeDelegation(createRequests(1), session1);
Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@Test
public void testTakeDelegationNotPceInitiatedLsp() {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.takeDelegation(createRequests(1), session1);
Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@Test
public void testReturnDelegationNoRetake() throws InterruptedException {
- final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+ final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
tunnelManager.onSessionUp(session1);
tunnelManager.onSessionUp(session2);
tunnelManager.addTunnel(createRequests(1), session1);
import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
import org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory;
import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
-import org.opendaylight.protocol.pcep.pcc.mock.PccDispatcherImpl;
+import org.opendaylight.protocol.pcep.pcc.mock.PCCDispatcherImpl;
import org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext;
public class PCCMock {
final PCEPSessionProposalFactory proposal = new BasePCEPSessionProposalFactory((short) 120, (short) 30, caps);
final PCEPSessionNegotiatorFactory snf = new DefaultPCEPSessionNegotiatorFactory(proposal, 0);
- try (final PccDispatcherImpl pccDispatcher = new PccDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry())) {
+ try (final PCCDispatcherImpl pccDispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry())) {
pccDispatcher.createClient(new InetSocketAddress("127.0.0.3", 12345), -1, new PCEPSessionListenerFactory() {
@Override
public PCEPSessionListener getSessionListener() {