Package org.snmp4j.transport

Examples of org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread


    listenAddress =
        GenericAddress.parse(System.getProperty("snmp4j.listenAddress",
                                                "udp:0.0.0.0/162"));
    TransportMapping transport;
    if (listenAddress instanceof UdpAddress) {
      transport = new DefaultUdpTransportMapping((UdpAddress)listenAddress);
    }
    else {
      transport = new DefaultTcpTransportMapping((TcpAddress)listenAddress);
    }
    snmp = new Snmp(dispatcher, transport);
View Full Code Here


        Snmp snmp;
        try {
            OctetString community1 = new OctetString(community);
            String host = ipAddress + "/" + port;
            Address tHost = new UdpAddress(host);
            TransportMapping transport = new DefaultUdpTransportMapping();
            transport.listen();
            CommunityTarget comtarget = new CommunityTarget();
            comtarget.setCommunity(community1);
            comtarget.setVersion(SnmpConstants.version1);
            comtarget.setAddress(tHost);
            comtarget.setRetries(2);
View Full Code Here

    public void SNMP_SET(String ipAddress, int port, String strOID, String value, String community) {
        ipAddress = ipAddress + "/" + port;
        Address tHost = GenericAddress.parse(ipAddress);
        Snmp snmp;
        try {
            TransportMapping transport = new DefaultUdpTransportMapping();
            snmp = new Snmp(transport);
            transport.listen();
            CommunityTarget target = new CommunityTarget();
            target.setCommunity(new OctetString(community));
            target.setAddress(tHost);
            target.setRetries(2);
            target.setTimeout(5000);
View Full Code Here

        Snmp snmp;
        try {
            OctetString community1 = new OctetString(community);
            String host = ipAddress + "/" + port;
            Address tHost = new UdpAddress(host);
            TransportMapping transport = new DefaultUdpTransportMapping();
            transport.listen();
            CommunityTarget comtarget = new CommunityTarget();
            comtarget.setCommunity(community1);
            comtarget.setVersion(SnmpConstants.version1);
            comtarget.setAddress(tHost);
            comtarget.setRetries(2);
View Full Code Here

    public void SNMP_SET(String ipAddress, int port, String strOID, String value, String community) {
        ipAddress = ipAddress + "/" + port;
        Address tHost = GenericAddress.parse(ipAddress);
        Snmp snmp;
        try {
            TransportMapping transport = new DefaultUdpTransportMapping();
            snmp = new Snmp(transport);
            transport.listen();
            CommunityTarget target = new CommunityTarget();
            target.setCommunity(new OctetString(community));
            target.setAddress(tHost);
            target.setRetries(2);
            target.setTimeout(5000);
View Full Code Here

        Snmp snmp;
        try {
            OctetString community1 = new OctetString(community);
            String host = ipAddress + "/" + port;
            Address tHost = new UdpAddress(host);
            TransportMapping transport = new DefaultUdpTransportMapping();
            transport.listen();
            CommunityTarget comtarget = new CommunityTarget();
            comtarget.setCommunity(community1);
            comtarget.setVersion(SnmpConstants.version1);
            comtarget.setAddress(tHost);
            comtarget.setRetries(2);
View Full Code Here

        // load connection data only if the endpoint is enabled
        if (LOG.isInfoEnabled()) {
            LOG.info("Starting trap consumer on " + this.endpoint.getAddress());
        }
        this.listenGenericAddress = GenericAddress.parse(this.endpoint.getAddress());
        this.transport = new DefaultUdpTransportMapping((UdpAddress)this.listenGenericAddress);
        this.snmp = new Snmp(transport);
        this.snmp.addCommandResponder(this);
       
        // listen to the transport
        this.transport.listen();
View Full Code Here

    protected void doStart() throws Exception {
        super.doStart();

        LOG.debug("Activating oid poller");
        this.targetAddress = GenericAddress.parse(this.endpoint.getAddress());
        this.transport = new DefaultUdpTransportMapping();
        this.snmp = new Snmp(this.transport);
        this.usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0);
        SecurityModels.getInstance().addSecurityModel(usm);

        // setting up target
View Full Code Here

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

        this.snmp = new Snmp(transport);
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

TOP

Related Classes of org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread

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.