import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
+import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueueHandlerRegistration;
SessionStatistics.countEvent(nodeId.toString(), SessionStatistics.ConnectionStatus.CONNECTION_DISCONNECTED_BY_OFP);
}
final BigInteger datapathId = featuresReply != null ? featuresReply.getDatapathId() : BigInteger.ZERO;
- LOG.debug("Actively closing connection: {}, datapathId:{}.",
+ LOG.debug("Actively closing connection: {}, datapathId: {}",
connectionAdapter.getRemoteAddress(), datapathId);
connectionState = ConnectionContext.CONNECTION_STATE.RIP;
}
});
try {
- LOG.debug("Waiting 1s for unregistering outbound queue.");
future.get(1, TimeUnit.SECONDS);
- LOG.info("Unregistering outbound queue successful.");
- } catch (InterruptedException e) {
- LOG.warn("Unregistering outbound queue was interrupted for node {}", nodeId);
- } catch (ExecutionException e) {
- LOG.warn("Unregistering outbound queue throws exception for node {}", nodeId, e);
- } catch (TimeoutException e) {
- LOG.warn("Unregistering outbound queue took longer than 1 seconds for node {}", nodeId);
+ LOG.info("Unregister outbound queue successful.");
+ } catch (InterruptedException | TimeoutException | ExecutionException e) {
+ LOG.warn("Unregister outbound queue throws exception for node {} ", nodeId);
+ LOG.trace("Unregister outbound queue throws exception for node {} ", nodeId, e);
}
closeHandshakeContext();
final private KeyedInstanceIdentifier<Node, NodeKey> nodeII;
final private Short version;
final private BigInteger datapathId;
+ final private ServiceGroupIdentifier serviceGroupIdentifier;
DeviceInfoImpl(
final NodeId nodeId,
this.nodeII = nodeII;
this.version = version;
this.datapathId = datapathId;
+ this.serviceGroupIdentifier = ServiceGroupIdentifier.create(this.nodeId.getValue());
}
@Override
return datapathId;
}
+ @Override
+ public ServiceGroupIdentifier getServiceIdentifier() {
+ return this.serviceGroupIdentifier;
+ }
+
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o) {
+ return true;
+ }
+
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
DeviceInfoImpl that = (DeviceInfoImpl) o;
- if (!nodeId.equals(that.nodeId)) return false;
- if (!nodeII.equals(that.nodeII)) return false;
- if (!version.equals(that.version)) return false;
- return datapathId.equals(that.datapathId);
+ return (nodeId.equals(that.nodeId) &&
+ nodeII.equals(that.nodeII) &&
+ version.equals(that.version) &&
+ datapathId.equals(that.datapathId));
}