Package org.snmp4j.transport

Examples of org.snmp4j.transport.DefaultUdpTransportMapping


    /* Test an invalid security name */
    final UsmUser invalidUser = new UsmUser(new OctetString("invalidName"),
        V3AUTHPROTO, V3AUTHPASS, V3PRIVPROTO, V3PRIVPASS);
    final SNMPv3<UdpAddress> invalidV3Client = new StandardSNMPv3<UdpAddress>(
        invalidUser, new OctetString(),
        new DefaultUdpTransportMapping());
    response = invalidV3Client
        .getSync(this.address, SnmpConstants.sysDescr);
    Assert.assertNotNull(response);
    Assert.assertFalse(ResponseEvents.extractBindings(response)
        .containsKey(SnmpConstants.sysDescr));
View Full Code Here


        // either tcp or udp
        if ("tcp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultTcpTransportMapping();
        } else if ("udp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultUdpTransportMapping();
        } else {
            throw new IllegalArgumentException("Unknown protocol: " + endpoint.getProtocol());
        }

        this.snmp = new Snmp(this.transport);
View Full Code Here

        }
    }

    private Snmp createSnmpConnection() {
        try {
            return new Snmp(new DefaultUdpTransportMapping());
        } catch (IOException e) {
            throw new NotificationFailedException("Sending notification via SNMP trap failed.", e);
        }
    }
View Full Code Here

        _target = new CommunityTarget();
        _target.setCommunity(new OctetString(community));
        _target.setVersion(SnmpConstants.version2c);
        _target.setAddress(new UdpAddress(address));
        try {
            _snmp = new Snmp(new DefaultUdpTransportMapping());
        } catch (IOException e) {
            _snmp = null;
            throw new CloudRuntimeException(" Error in crearting snmp object, " + e.getMessage());
        }
    }
View Full Code Here

      } catch (Exception e) {
      }
    }// end reading

    try {
      transport = new DefaultUdpTransportMapping();
      transport.listen();
    } catch (IOException e) {
    }
    // Create Target Address object
    CommunityTarget comtarget = new CommunityTarget();
View Full Code Here

      if (snmp != null) {
        snmp.close();
        snmp = null;
      }

      transport = new DefaultUdpTransportMapping(address);

      // add all security protocols
      SecurityProtocols.getInstance().addDefaultProtocols();
      SecurityProtocols.getInstance().addPrivacyProtocol(new Priv3DES());
View Full Code Here

TOP

Related Classes of org.snmp4j.transport.DefaultUdpTransportMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.