private void startRedelegationTimer( final Tunnel tunnel, final PlspId plspId, final PccSession session) { final Timeout newRedelegationTimeout = this.timer.newTimeout( new TimerTask() { @Override public void run(final Timeout timeout) throws Exception { // remove delegation PccTunnelManagerImpl.this.setDelegation(plspId, null); // delegate to another PCE int index = session.getId(); for (int i = 1; i < PccTunnelManagerImpl.this.sessions.size(); i++) { index++; if (index == PccTunnelManagerImpl.this.sessions.size()) { index = 0; } 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())); nextSession.sendReport( createPcRtpMessage( createLsp( plspId.getValue(), true, Optional.<Tlvs>fromNullable(tlvs), true, false), NO_SRP, tunnel.getLspState())); tunnel.setDelegationHolder(nextSession.getId()); break; } } } }, this.redelegationTimeout, TimeUnit.SECONDS); tunnel.setRedelegationTimeout(newRedelegationTimeout); }