Search in sources :

Example 6 with SnmpV3User

use of org.opennms.netmgt.snmp.SnmpV3User in project opennms by OpenNMS.

the class TrapdConfigFactory method update.

@Override
public void update(TrapdConfig config) {
    m_config.setSnmpTrapAddress(config.getSnmpTrapAddress());
    m_config.setSnmpTrapPort(config.getSnmpTrapPort());
    m_config.setNewSuspectOnTrap(config.getNewSuspectOnTrap());
    m_config.setQueueSize(config.getQueueSize());
    m_config.setBatchSize(config.getBatchSize());
    m_config.setBatchInterval(config.getBatchIntervalMs());
    m_config.setThreads(config.getNumThreads());
    m_config.setIncludeRawMessage(config.isIncludeRawMessage());
    final List<Snmpv3User> snmpv3Users = config.getSnmpV3Users().stream().map(u -> {
        Snmpv3User newUser = new Snmpv3User();
        newUser.setEngineId(u.getEngineId());
        newUser.setSecurityName(u.getSecurityName());
        newUser.setAuthProtocol(u.getAuthProtocol());
        newUser.setAuthPassphrase(u.getAuthPassPhrase());
        newUser.setPrivacyProtocol(u.getPrivProtocol());
        newUser.setPrivacyPassphrase(u.getPrivPassPhrase());
        return newUser;
    }).collect(Collectors.toList());
    m_config.setSnmpv3User(snmpv3Users);
}
Also used : TrapdConfiguration(org.opennms.netmgt.config.trapd.TrapdConfiguration) SnmpV3User(org.opennms.netmgt.snmp.SnmpV3User) ConfigFileConstants(org.opennms.core.utils.ConfigFileConstants) FileSystemResource(org.springframework.core.io.FileSystemResource) IOException(java.io.IOException) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) Collectors(java.util.stream.Collectors) File(java.io.File) ArrayList(java.util.ArrayList) List(java.util.List) Snmpv3User(org.opennms.netmgt.config.trapd.Snmpv3User) JaxbUtils(org.opennms.core.xml.JaxbUtils) InputStream(java.io.InputStream) Snmpv3User(org.opennms.netmgt.config.trapd.Snmpv3User)

Aggregations

SnmpV3User (org.opennms.netmgt.snmp.SnmpV3User)6 IOException (java.io.IOException)3 Test (org.junit.Test)2 SnmpAgentConfig (org.opennms.netmgt.snmp.SnmpAgentConfig)2 File (java.io.File)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Before (org.junit.Before)1 ConfigFileConstants (org.opennms.core.utils.ConfigFileConstants)1 JaxbUtils (org.opennms.core.xml.JaxbUtils)1 Snmpv3User (org.opennms.netmgt.config.trapd.Snmpv3User)1 TrapdConfiguration (org.opennms.netmgt.config.trapd.TrapdConfiguration)1 Snmp (org.snmp4j.Snmp)1 UsmUser (org.snmp4j.security.UsmUser)1 UdpAddress (org.snmp4j.smi.UdpAddress)1 DefaultUdpTransportMapping (org.snmp4j.transport.DefaultUdpTransportMapping)1