Package org.opennms.protocols.snmp

Examples of org.opennms.protocols.snmp.SnmpPeer


       
   public void openSession()
      throws SocketException
   {
      // Create the SNMP session to the manager
      SnmpPeer peer = new SnmpPeer(this.address, this.port, this.localAddress, this.localPort);
      peer.setRetries(this.retries);
      peer.setTimeout(this.timeout);
           
      SnmpParameters parameters = peer.getParameters();
           
      switch(this.version) {               
         case SnmpAgentService.SNMPV1:
            parameters.setVersion(SnmpSMI.SNMPV1);
            break;
        
         case SnmpAgentService.SNMPV2:
            parameters.setVersion(SnmpSMI.SNMPV2);
            break;
         default:
            parameters.setVersion(SnmpSMI.SNMPV1);
      }
           
      parameters.setReadCommunity(this.readCommunity);
      peer.setParameters(parameters);
           
      this.session = new SnmpSession(peer);
      this.session.setDefaultHandler(this);
   }
View Full Code Here


      // cater for possible global -b option, if no override has been specified
      InetAddress address = this.bindAddress != null ? this.bindAddress :
            toInetAddress(System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS));
     
      // the listening address
      SnmpPeer peer = new SnmpPeer(address, this.port);
     
      // set community strings and protocol version
      peer.getParameters().setReadCommunity(this.readCommunity);
      peer.getParameters().setWriteCommunity(this.writeCommunity);
      peer.getParameters().setVersion(this.snmpVersion == SNMPV2 ? SnmpSMI.SNMPV2 : SnmpSMI.SNMPV1);
     
      // Instantiate and initialize the RequestHandler implementation
      requestHandler = (RequestHandler)Class.forName(
         this.requestHandlerClassName, true, this.getClass().getClassLoader()).newInstance();
      requestHandler.initialize(this.requestHandlerResName, this.getServer(), this.log, this.clock);
View Full Code Here

      // cater for possible global -b option, if no override has been specified
      InetAddress address = this.bindAddress != null ? this.bindAddress :
            toInetAddress(System.getProperty(ServerConfig.SERVER_BIND_ADDRESS));
     
      // the listening address
      SnmpPeer peer = new SnmpPeer(address, this.port);
     
      // set community strings and protocol version
      peer.getParameters().setReadCommunity(this.readCommunity);
      peer.getParameters().setWriteCommunity(this.writeCommunity);
      peer.getParameters().setVersion(this.snmpVersion == SNMPV2 ? SnmpSMI.SNMPV2 : SnmpSMI.SNMPV1);
     
      // Instantiate and initialize the RequestHandler implementation
      requestHandler = (RequestHandler)Class.forName(
         this.requestHandlerClassName, true, this.getClass().getClassLoader()).newInstance();
      requestHandler.initialize(this.requestHandlerResName, this.getServer(), this.log, this.clock);
View Full Code Here

TOP

Related Classes of org.opennms.protocols.snmp.SnmpPeer

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.