Search in sources :

Example 1 with Snmpv3User

use of org.opennms.netmgt.config.trapd.Snmpv3User in project opennms by OpenNMS.

the class TrapListenerTest method createUser.

private static Snmpv3User createUser(String authProtocol, String autoPassPhrase, String engineId, String privatcyProtocol, String privacyPassPhrase, String securityName) {
    Snmpv3User user = new Snmpv3User();
    user.setAuthProtocol(authProtocol);
    user.setAuthPassphrase(autoPassPhrase);
    user.setEngineId(engineId);
    user.setPrivacyPassphrase(privacyPassPhrase);
    user.setPrivacyProtocol(privatcyProtocol);
    user.setSecurityName(securityName);
    return user;
}
Also used : Snmpv3User(org.opennms.netmgt.config.trapd.Snmpv3User)

Example 2 with Snmpv3User

use of org.opennms.netmgt.config.trapd.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.config.trapd.Snmpv3User)2 File (java.io.File)1 IOException (java.io.IOException)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 ConfigFileConstants (org.opennms.core.utils.ConfigFileConstants)1 JaxbUtils (org.opennms.core.xml.JaxbUtils)1 TrapdConfiguration (org.opennms.netmgt.config.trapd.TrapdConfiguration)1 SnmpV3User (org.opennms.netmgt.snmp.SnmpV3User)1 FileSystemResource (org.springframework.core.io.FileSystemResource)1