@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_availableCapabilities == null) ? 0 : _availableCapabilities.hashCode()); result = prime * result + ((_connectedMessage == null) ? 0 : _connectedMessage.hashCode()); result = prime * result + ((_connectionStatus == null) ? 0 : _connectionStatus.hashCode()); result = prime * result + ((_host == null) ? 0 : _host.hashCode()); result = prime * result + ((_passThrough == null) ? 0 : _passThrough.hashCode()); result = prime * result + ((_port == null) ? 0 : _port.hashCode()); result = prime * result + ((_unavailableCapabilities == null) ? 0 : _unavailableCapabilities.hashCode()); hash = result; hashValid = true; return result; }
private boolean isHostAddressPresent(final Host address) { return address.getDomainName() != null || address.getIpAddress() != null && (address.getIpAddress().getIpv4Address() != null || address.getIpAddress().getIpv6Address() != null); }
return false; } else if(!_host.equals(other.getHost())) { return false;
return false; } else if(!_address.equals(other.getAddress())) { return false;
result = prime * result + ((_address == null) ? 0 : _address.hashCode()); result = prime * result + ((_betweenAttemptsTimeoutMillis == null) ? 0 : _betweenAttemptsTimeoutMillis.hashCode()); result = prime * result + ((_bindingRegistry == null) ? 0 : _bindingRegistry.hashCode());
return false; } else if(!_sourceHost.equals(other.getSourceHost())) { return false;
private InetSocketAddress getSocketAddress() { if(getAddress().getDomainName() != null) { return new InetSocketAddress(getAddress().getDomainName().getValue(), getPort().getValue()); } else { final IpAddress ipAddress = getAddress().getIpAddress(); final String ip = ipAddress.getIpv4Address() != null ? ipAddress.getIpv4Address().getValue() : ipAddress.getIpv6Address().getValue(); return new InetSocketAddress(ip, getPort().getValue()); } }
@Override public Session toManagementSession() { SessionBuilder builder = new SessionBuilder(); builder.setSessionId(getSessionId()); builder.setSourceHost(new Host(new DomainName(header.getAddress()))); Preconditions.checkState(DateAndTime.PATTERN_CONSTANTS.size() == 1); String formattedDateTime = formatDateTime(loginTime); Matcher matcher = dateTimePattern.matcher(formattedDateTime); Preconditions.checkState(matcher.matches(), "Formatted datetime %s does not match pattern %s", formattedDateTime, dateTimePattern); builder.setLoginTime(new DateAndTime(formattedDateTime)); builder.setInBadRpcs(new ZeroBasedCounter32(inRpcFail)); builder.setInRpcs(new ZeroBasedCounter32(inRpcSuccess)); builder.setOutRpcErrors(new ZeroBasedCounter32(outRpcError)); builder.setUsername(header.getUserName()); builder.setTransport(getTransportForString(header.getTransport())); builder.setOutNotifications(new ZeroBasedCounter32(0L)); builder.setKey(new SessionKey(getSessionId())); Session1Builder builder1 = new Session1Builder(); builder1.setSessionIdentifier(header.getSessionIdentifier()); builder.addAugmentation(Session1.class, builder1.build()); return builder.build(); }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_inBadRpcs == null) ? 0 : _inBadRpcs.hashCode()); result = prime * result + ((_inRpcs == null) ? 0 : _inRpcs.hashCode()); result = prime * result + ((_key == null) ? 0 : _key.hashCode()); result = prime * result + ((_loginTime == null) ? 0 : _loginTime.hashCode()); result = prime * result + ((_outNotifications == null) ? 0 : _outNotifications.hashCode()); result = prime * result + ((_outRpcErrors == null) ? 0 : _outRpcErrors.hashCode()); result = prime * result + ((_sessionId == null) ? 0 : _sessionId.hashCode()); result = prime * result + ((_sourceHost == null) ? 0 : _sourceHost.hashCode()); result = prime * result + ((_transport == null) ? 0 : _transport.hashCode()); result = prime * result + ((_username == null) ? 0 : _username.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); hash = result; hashValid = true; return result; }