import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/**
- *
- */
public class ConnectionContextImpl implements ConnectionContext {
private final ConnectionAdapter connectionAdapter;
private List<PortStatusMessage> portStatusMessages = new ArrayList<>();
/**
- * @param connectionAdapter
+ * Constructor.
+ *
+ * @param connectionAdapter - connection adapter
*/
public ConnectionContextImpl(final ConnectionAdapter connectionAdapter) {
this.connectionAdapter = connectionAdapter;
private void closeHandshakeContext() {
LOG.debug("Trying closing handshake context for node {}", getSafeNodeIdForLOG());
if (handshakeContext != null) {
- try {
- handshakeContext.close();
- } catch (Exception e) {
- LOG.error("handshake context closing failed:{} ", e);
- } finally {
- handshakeContext = null;
- }
+ handshakeContext.close();
+ handshakeContext = null;
}
}
private void disconnectDevice(final boolean propagate,
final boolean forced) {
- final String device = Objects.nonNull(nodeId) ? nodeId.getValue() : getConnectionAdapter().getRemoteAddress().toString();
+ final String device =
+ Objects.nonNull(nodeId) ? nodeId.getValue() : getConnectionAdapter().getRemoteAddress().toString();
final short auxiliaryId = Optional
.ofNullable(getFeatures())
.flatMap(features -> Optional
}
/**
- * This method returns safe nodeId for logging
+ * Get safe nodeId for logging.
+ *
* @return string value od nodeId or string "null"
*/
@Override
}
@Override
- public void setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> outboundQueueHandlerRegistration) {
+ public void setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider>
+ outboundQueueHandlerRegistration) {
this.outboundQueueHandlerRegistration = outboundQueueHandlerRegistration;
}
}
@Override
- public boolean equals(Object o) {
- if (this == o) {
+ public boolean equals(Object object) {
+ if (this == object) {
return true;
}
- if (o == null || getClass() != o.getClass()) {
+ if (object == null || getClass() != object.getClass()) {
return false;
}
- ConnectionContextImpl that = (ConnectionContextImpl) o;
+ ConnectionContextImpl that = (ConnectionContextImpl) object;
if (!connectionAdapter.equals(that.connectionAdapter)) {
return false;
}
@Override
- public boolean equals(Object o) {
- if (this == o) {
+ public boolean equals(Object object) {
+ if (this == object) {
return true;
}
- if (o == null || getClass() != o.getClass()) {
+ if (object == null || getClass() != object.getClass()) {
return false;
}
- DeviceInfoImpl that = (DeviceInfoImpl) o;
+ DeviceInfoImpl that = (DeviceInfoImpl) object;
- return (nodeId.equals(that.nodeId) &&
- nodeII.equals(that.nodeII) &&
- version.equals(that.version) &&
- datapathId.equals(that.datapathId));
+ return (nodeId.equals(that.nodeId)
+ && nodeII.equals(that.nodeII)
+ && version.equals(that.version)
+ && datapathId.equals(that.datapathId));
}