public String toString() { StringBuffer buff = new StringBuffer("AgentConfig["); buff.append("Address: "+getAddress()); buff.append(", ProxyForAddress: "+getProxyFor()); buff.append(", Port: "+getPort()); buff.append(", Community: "+getReadCommunity()); buff.append(", Timeout: "+getTimeout()); buff.append(", Retries: "+getRetries()); buff.append(", MaxVarsPerPdu: "+getMaxVarsPerPdu()); buff.append(", MaxRepetitions: "+getMaxRepetitions()); buff.append(", Max request size: "+getMaxRequestSize()); buff.append(", Version: "+versionToString(getVersion())); if (getVersion() == VERSION3) { buff.append(", Security level: "+getSecurityLevel()); buff.append(", Security name: "+getSecurityName()); buff.append(", auth-passphrase: "+getAuthPassPhrase()); buff.append(", auth-protocol: "+getAuthProtocol()); buff.append(", priv-passprhase: "+getPrivPassPhrase()); buff.append(", priv-protocol: "+getPrivProtocol()); } buff.append("]"); return buff.toString(); }
System.out.println("ProxyForAddress: " + InetAddrUtils.str(agent.getProxyFor())); System.out.println("Port: " + agent.getPort()); System.out.println("Timeout: " + agent.getTimeout());
&& Objects.equals(getProxyFor(), other.getProxyFor()) && Objects.equals(getPort(), other.getPort()) && Objects.equals(getTimeout(), other.getTimeout())
@Override public int hashCode() { int hash = Objects.hash(getAddress(), getProxyFor(), getPort(), getTimeout(), getRetries(), getMaxVarsPerPdu(), getMaxRepetitions(), getMaxRequestSize(), getVersion(), getSecurityLevel(), getSecurityName(), getAuthPassPhrase(), getAuthProtocol(), getPrivPassPhrase(), getPrivProtocol(), getContextName(), getEngineId(), getContextEngineId(), getEnterpriseId(), getReadCommunity(), getWriteCommunity()); return hash; }
if (config.getMaxRequestSize() >= 1) m_maxRequestSize = Integer.valueOf(config.getMaxRequestSize()); if (config.getProxyFor() != null) { // switch proxy and address m_proxyHost = InetAddressUtils.str(config.getAddress());
if (config.getMaxRequestSize() >= 1) m_maxRequestSize = Integer.valueOf(config.getMaxRequestSize()); if (config.getProxyFor() != null) { // switch proxy and address m_proxyHost = InetAddressUtils.str(config.getAddress());
/** * <p>getAgentConfig</p> * * @return a {@link org.opennms.netmgt.snmp.SnmpAgentConfig} object. */ public SnmpAgentConfig getAgentConfig() { SnmpAgentConfig agentConfig = getCollectionAgent().getAgentConfig(); agentConfig.setPort(m_snmpCollection.getSnmpPort(agentConfig.getPort())); agentConfig.setRetries(m_snmpCollection.getSnmpRetries(agentConfig.getRetries())); agentConfig.setTimeout(m_snmpCollection.getSnmpTimeout(agentConfig.getTimeout())); agentConfig.setReadCommunity(m_snmpCollection.getSnmpReadCommunity(agentConfig.getReadCommunity())); agentConfig.setWriteCommunity(m_snmpCollection.getSnmpWriteCommunity(agentConfig.getWriteCommunity())); agentConfig.setProxyFor(m_snmpCollection.getSnmpProxyFor(agentConfig.getProxyFor())); agentConfig.setVersion(m_snmpCollection.getSnmpVersion(agentConfig.getVersion())); agentConfig.setMaxVarsPerPdu(m_snmpCollection.getSnmpMaxVarsPerPdu(agentConfig.getMaxVarsPerPdu())); agentConfig.setMaxRepetitions(m_snmpCollection.getSnmpMaxRepetitions(agentConfig.getMaxRepetitions())); agentConfig.setMaxRequestSize(m_snmpCollection.getSnmpMaxRequestSize(agentConfig.getMaxRequestSize())); agentConfig.setSecurityName(m_snmpCollection.getSnmpSecurityName(agentConfig.getSecurityName())); agentConfig.setAuthPassPhrase(m_snmpCollection.getSnmpAuthPassPhrase(agentConfig.getAuthPassPhrase())); agentConfig.setAuthProtocol(m_snmpCollection.getSnmpAuthProtocol(agentConfig.getAuthProtocol())); agentConfig.setPrivPassPhrase(m_snmpCollection.getSnmpPrivPassPhrase(agentConfig.getPrivPassPhrase())); agentConfig.setPrivProtocol(m_snmpCollection.getSnmpPrivProtocol(agentConfig.getPrivProtocol())); return agentConfig; }