import io.netty.channel.Channel;
import io.netty.util.concurrent.Promise;
-import org.opendaylight.protocol.pcep.PCEPPeerProposal;
-import org.opendaylight.protocol.pcep.PCEPSessionListener;
-import org.opendaylight.protocol.pcep.PCEPSessionListenerFactory;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
+import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactoryDependencies;
import org.opendaylight.protocol.pcep.SessionNegotiator;
+import org.opendaylight.yangtools.yang.common.Uint8;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* SessionNegotiator which takes care of making sure sessions between PCEP peers are kept unique. This needs to be
* further subclassed to provide either a client or server factory.
*/
-public abstract class AbstractPCEPSessionNegotiatorFactory implements PCEPSessionNegotiatorFactory<PCEPSessionImpl> {
-
+public abstract class AbstractPCEPSessionNegotiatorFactory implements PCEPSessionNegotiatorFactory {
private static final Logger LOG = LoggerFactory.getLogger(AbstractPCEPSessionNegotiatorFactory.class);
private final PCEPPeerRegistry sessionRegistry = new PCEPPeerRegistry();
/**
* Create a new negotiator. This method needs to be implemented by subclasses to actually provide a negotiator.
*
- * @param promise Session promise to be completed by the negotiator
- * @param listener PCEPSessionListener
- * @param channel Associated channel
+ * @param snd PCEP Session Negotiator dependencies
+ * @param promise Session promise to be completed by the negotiator
+ * @param channel Associated channel
* @param sessionId Session ID assigned to the resulting session
* @return a PCEP session negotiator
*/
- protected abstract AbstractPCEPSessionNegotiator createNegotiator(Promise<PCEPSessionImpl> promise, PCEPSessionListener listener,
- Channel channel, short sessionId, final PCEPPeerProposal peerProposal);
+ protected abstract AbstractPCEPSessionNegotiator createNegotiator(
+ PCEPSessionNegotiatorFactoryDependencies snd,
+ Promise<PCEPSession> promise,
+ Channel channel, Uint8 sessionId);
@Override
- public final SessionNegotiator getSessionNegotiator(final PCEPSessionListenerFactory factory,
- final Channel channel, final Promise<PCEPSessionImpl> promise, final PCEPPeerProposal peerProposal) {
+ public final SessionNegotiator getSessionNegotiator(final PCEPSessionNegotiatorFactoryDependencies dependencies,
+ final Channel channel, final Promise<PCEPSession> promise) {
LOG.debug("Instantiating bootstrap negotiator for channel {}", channel);
- return new PCEPSessionNegotiator(channel, promise, factory, this, peerProposal);
+ return new PCEPSessionNegotiator(channel, promise, dependencies, this);
}
public PCEPPeerRegistry getSessionRegistry() {
- return this.sessionRegistry;
+ return sessionRegistry;
}
}