import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
+import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueueHandlerRegistration;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.connection.OutboundQueueProvider;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
private DeviceDisconnectedHandler deviceDisconnectedHandler;
private static final Logger LOG = LoggerFactory.getLogger(ConnectionContextImpl.class);
private OutboundQueueProvider outboundQueueProvider;
+ private OutboundQueueHandlerRegistration<OutboundQueueProvider> outboundQueueHandlerRegistration;
/**
* @param connectionAdapter
public void setFeatures(final FeaturesReply featuresReply) {
this.featuresReply = featuresReply;
}
+
+ @Override
+ public void close() {
+ if (getConnectionAdapter().isAlive()) {
+ setConnectionState(ConnectionContext.CONNECTION_STATE.RIP);
+ getConnectionAdapter().disconnect();
+ }
+ if (outboundQueueHandlerRegistration != null) {
+ outboundQueueHandlerRegistration.close();
+ outboundQueueHandlerRegistration = null;
+ }
+ }
+
+ @Override
+ public void setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> outboundQueueHandlerRegistration) {
+ this.outboundQueueHandlerRegistration = outboundQueueHandlerRegistration;
+ }
}