[jboss-cvs] JBossAS SVN: r110496 - in branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp: config/manager and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 28 16:00:56 EST 2011


Author: thauser at redhat.com
Date: 2011-01-28 16:00:55 -0500 (Fri, 28 Jan 2011)
New Revision: 110496

Removed:
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/ComparableSnmpObjectId.java
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/ManagerRecord.java
Modified:
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerSupport.java
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/TrapFactorySupport.java
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/config/manager/Manager.java
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupService.java
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupServiceMBean.java
Log:
removal of old imports. Removal of unused classes (these classes were untouched and still exist in JBPAPP_5_1 branch for reference.)

Deleted: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/ComparableSnmpObjectId.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/ComparableSnmpObjectId.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/ComparableSnmpObjectId.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jmx.adaptor.snmp.agent;
-
-import org.opennms.protocols.snmp.SnmpObjectId;
-
-/**
- * Provide SnmpObjectIds that are Comparable to be used
- * in SortedSets etc.
- * @author <a href="mailto:hwr at pilhuhn.de">Heiko W. Rupp</a>
- * @version $Revision$
- */
-public class ComparableSnmpObjectId extends SnmpObjectId implements Comparable 
-{
-
-	public ComparableSnmpObjectId(String oid) 
-	{
-		super(oid);
-	}
-	
-	public ComparableSnmpObjectId(SnmpObjectId oid) 
-	{
-		super(oid);
-	}
-	
-	public ComparableSnmpObjectId(int[] identifiers)
-	{
-		super(identifiers);
-	}
-
-	/**
-	 * Compare to the passed object. Uses compare()
-	 * from the underlying snmp-library
-	 * @see SnmpObjectId.compare()
-	 * @param o Object to compare with (Usually a ComparableSnmpObjectId)
-	 * @return -1, if no SnmpObjectId passed in, the result of the underlying compare otherwise.
-	 */
-	public int compareTo(Object o) 
-	{
-		
-		if (o==null)
-			return -1;
-		
-		if (!(o instanceof SnmpObjectId))
-			return -1;
-		
-		return this.compare((SnmpObjectId)o);
-	}
-	
-	/**
-	 * This object is a leaf if the last part of the oid parts is a 0 (Zero)
-	 * @return true if the oid ends in 0 
-	 */
-	public boolean isLeaf() 
-	{
-		int[] ids = getIdentifiers();
-		if (ids.length==0) { // no data present (should not happen)
-			return false;
-		}
-		if (ids[ids.length-1]==0)
-		{
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Removes the last oid-component.
-	 * Example  .1.2.3.4.0 as input yields .1.2.3.4 as output
-	 * @return an oid with the last part removed.
-	 */
-	public ComparableSnmpObjectId removeLastPart()
-	{
-		int[] ids = getIdentifiers();
-		
-		int[] outs = new int[ids.length-1];
-		int len = ids.length-1;
-		for (int i = 0; i<len ; i++)
-		{
-			outs[i]=ids[i];
-		}
-		ComparableSnmpObjectId out = new ComparableSnmpObjectId(outs);
-		return out;
-	}
-	
-	/**
-	 * Build an oid where the second last component 
-	 * (after removing a  .0 of a leaf) is increased by 1.
-	 * The last component is removed, to the result actually forms
-	 * the root of a subtree, that is adjacent to the subtree this
-	 * object is in.
-	 * Example .1.2.3.4.0 -> .1.2.4 
-	 * Example .1.2.3.4.5 -> .1.2.4
-	 * @return
-	 */
-	public ComparableSnmpObjectId getNextArc()
-	{
-		ComparableSnmpObjectId cid = this;
-		if (isLeaf())
-		{
-			cid = removeLastPart();
-		}
-		cid = cid.removeLastPart(); 
-		
-		int[] ids = cid.getIdentifiers();
-		int[] ods = new int[ids.length];
-		System.arraycopy(ids,
-						0,
-						ods,
-						0,
-						ids.length);
-		
-		int len = ods.length-1;
-		ods[len]++;
-		
-		ComparableSnmpObjectId ret = new ComparableSnmpObjectId(ods);
-		return ret;
-	}
-	
-}

Deleted: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/ManagerRecord.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/ManagerRecord.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/ManagerRecord.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -1,242 +0,0 @@
-/*
- * Copyright (c) 2003,  Intracom S.A. - www.intracom.com
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * This package and its source code is available at www.jboss.org
-**/
-package org.jboss.jmx.adaptor.snmp.agent;
-
-import java.net.InetAddress;
-import java.net.SocketException;
-
-import org.jboss.logging.Logger;
-import org.opennms.protocols.snmp.SnmpHandler;
-import org.opennms.protocols.snmp.SnmpParameters;
-import org.opennms.protocols.snmp.SnmpPduPacket;
-import org.opennms.protocols.snmp.SnmpPeer;
-import org.opennms.protocols.snmp.SnmpSMI;
-import org.opennms.protocols.snmp.SnmpSession;
-import org.opennms.protocols.snmp.SnmpSyntax;
-
-/**
- * <tt>ManagerRecord</tt> is a class that is used as a key
- * to uniquely identify subscribing managers.
- *
- * @version $Revision$
- *
- * @author  <a href="mailto:spol at intracom.gr">Spyros Pollatos</a>
- * @author  <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
-**/
-class ManagerRecord implements SnmpHandler
-{
-   /** The logger object */
-   private static final Logger log = Logger.getLogger(ManagerRecord.class);
-   
-   /** SNMP parameter for number of retries */
-   private int retries = 10;
-   
-   /** SNMP parameter for timeout */
-   private int timeout = 5000;
-         
-   /** Subscription target IP address */
-   private InetAddress address;
-   
-   /** Subscription target port */
-   private int port;
-   
-   /** The local address to bind */
-   private InetAddress localAddress;
-   
-   /** The local port to use */
-   private int localPort;
-   
-   /** Subscription native SNMP version */
-   private int version;
-   
-   /** The read community string*/
-   private final String readCommunity = "public";
-   
-   /** The session to the manager*/
-   private transient SnmpSession session;
-
-   /**
-    * Creates key for the specified values. <P>
-    *
-    * @param address the manager's IP adddress
-    * @param port the manager listening port
-    * @param localAddress the local address to bind
-    * @param localPort the local port to bind
-    * @param version the session's native SNMP version        
-   **/ 
-   public ManagerRecord(InetAddress address, int port,
-                        InetAddress localAddress, int localPort, int version)
-      throws BadSnmpVersionException
-   {
-      this.address = address;
-      this.port = port;
-      this.localAddress = localAddress;
-      this.localPort = localPort;
-      
-      switch (version) {
-         case SnmpAgentService.SNMPV1:
-         case SnmpAgentService.SNMPV2:
-            this.version = version;
-            break;
-            
-         default:    
-            throw new BadSnmpVersionException("Bad SNMP Version: " + version);    
-      }
-   }
-      
-   /**
-    *
-   **/
-   public InetAddress getAddress()
-   {
-      return this.address;
-   }
-
-   /**
-    *
-   **/        
-   public int getPort()
-   {
-      return this.port;
-   }
-
-   /**
-    * 
-    */
-   public InetAddress getLocalAddress()
-   {
-      return this.localAddress;
-   }
-   
-   /**
-    *
-   **/
-   public int getLocalPort()
-   {
-      return this.localPort;
-   }
-   
-   /**
-    *
-   **/        
-   public int getVersion()
-   {
-      return this.version;
-   }
-        
-   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);
-   }
-        
-   /**
-    * Close the session to the manager
-   **/ 
-   public void closeSession()
-   {
-      this.session.close();
-   }
-        
-   /**
-    * Returns the session to the manager
-   **/ 
-   public SnmpSession getSession()
-   {
-      return this.session;
-   }        
-                
-   /**
-    * Comparison operator. Keys are considered equal if all address, port
-    * and version are identical
-    *
-    * @param o the key to be compared with
-   **/              
-   public boolean equals(Object o)
-   {
-      if (!(o instanceof ManagerRecord))
-         return false;
-            
-      ManagerRecord other = (ManagerRecord)o;
-            
-      return (this.port == other.port &&
-              this.address.equals(other.address) &&
-              this.version == other.version);
-   }
-
-   /**
-    * Hash generator
-   **/                      
-   public int hashCode()
-   {
-      return toString().hashCode();    
-   }    
-        
-   /**
-    *
-   **/                              
-   public String toString()
-   {
-      return new String(this.address + ":" + this.port +
-                        " (" + this.version + ")" );    
-   }
-        
-   /**
-    * Stubs to be filled in if we are not only to send traps
-   **/
-   public void snmpInternalError(SnmpSession session, int err, SnmpSyntax pdu)
-   {
-      log.error("ManagerRecord::snmpInternalError, code: " + err);
-   }
-        
-   public void snmpTimeoutError(SnmpSession session, SnmpSyntax pdu)
-   {
-      log.error("ManagerRecord::snmpTimeoutError");
-   }
-    
-   public void snmpReceivedPdu(SnmpSession session, int cmd, SnmpPduPacket pdu)
-   {
-      log.error("ManagerRecord::snmpReceivedPdu");
-   }
-        
-} // class ManagerRecord    

Modified: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -44,7 +44,6 @@
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.Unmarshaller;
 import org.jboss.xb.binding.UnmarshallerFactory;
-//import org.opennms.protocols.snmp.*;
 import org.snmp4j.PDU;
 import org.snmp4j.PDUv1;
 import org.snmp4j.ScopedPDU;
@@ -202,7 +201,7 @@
 			log.trace("requestID=" + pdu.getRequestID() + ", elementCount="
 					+ pdu.size());
 		}
-		if (pdu != null){
+	//	if (pdu != null){ this is already checked in SnmpRequest.
 			int counter = 1; 
 			int nonRepeaters = pdu.getNonRepeaters();
 			if (nonRepeaters<0)
@@ -211,18 +210,18 @@
 			int maxRepetitions = pdu.getMaxRepetitions();
 			if (maxRepetitions<0)
 				maxRepetitions=0;
-			Vector<VariableBinding> it = pdu.getVariableBindings();
+			Vector<VariableBinding> vbList = pdu.getVariableBindings();
 			VariableBinding vb = null;
 			Variable var = null;
 			
-			if (it.size() == 0){ // we were given an empty list in the PDU
+			if (vbList.size() == 0){ // we were given an empty list in the PDU
 				log.debug("snmpReceivedGetBulk: No VariableBindings in received PDU");
 				makeErrorPdu(response, pdu, counter, PDU.genErr);
 				return response;
 			}
 
-			for (int i=0; i < Math.min(nonRepeaters, it.size());i++){
-				vb = (VariableBinding)it.get(i);
+			for (int i=0; i < Math.min(nonRepeaters, vbList.size());i++){
+				vb = (VariableBinding)vbList.get(i);
 				OID oid = vb.getOid();
 				OID noid = null;
 				
@@ -238,8 +237,7 @@
 				try {
 					var = getValueFor(noid);
 				} 
-				catch (NoSuchInstanceException e) {
-					// getBulk allows Null values and errors in it's return. 
+				catch (NoSuchInstanceException e){ 
 					// this won't happen because of using getnext;
 					log.debug("snmpReceivedGetBulk: An instance of an OID didn't exist.");
 					response.add(new VariableBinding(oid, Null.noSuchInstance));
@@ -255,8 +253,8 @@
 			}
 			
 			// for the remaining it.size() bindings, we perform maxRepetitions successive getNext calls
-			for (int i = nonRepeaters; i < it.size(); i++){
-				vb = (VariableBinding)it.get(i);
+			for (int i = nonRepeaters; i < vbList.size(); i++){
+				vb = (VariableBinding)vbList.get(i);
 				OID oid = vb.getOid();
 				OID noid = null;
 				try {
@@ -288,13 +286,14 @@
 						noid = getNextOid(noid);
 					} 
 					catch (EndOfMibViewException e) {
+						// doing more repetitions here is a waste of time. 
 						response.add(new VariableBinding(noid, Null.endOfMibView));
 						break;
 					}
 				}
 			}
 			counter++;		
-		}	
+	//	}	
 		return response;
    	}
    	   

Modified: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerSupport.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerSupport.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerSupport.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -26,11 +26,6 @@
 import javax.management.MBeanServer;
 
 import org.jboss.logging.Logger;
-//import org.opennms.protocols.snmp.SnmpAgentSession;
-//import org.opennms.protocols.snmp.SnmpObjectId;
-//import org.opennms.protocols.snmp.SnmpPduRequest;
-//import org.opennms.protocols.snmp.SnmpSyntax;
-//import org.opennms.protocols.snmp.SnmpVarBind;
 import org.snmp4j.PDU;
 import org.snmp4j.Snmp;
 import org.snmp4j.smi.OctetString;

Modified: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -28,9 +28,6 @@
 
 import org.jboss.bootstrap.api.as.config.JBossASServerConfig;
 import org.jboss.system.ListenerServiceMBeanSupport;
-//import org.opennms.protocols.snmp.SnmpAgentSession;
-//import org.opennms.protocols.snmp.SnmpPeer;
-//import org.opennms.protocols.snmp.SnmpSMI;
 
 //SNMP4J IMPORTS
 import org.snmp4j.AbstractTarget;
@@ -593,59 +590,14 @@
          this.requestHandlerClassName, true, this.getClass().getClassLoader()).newInstance();
       requestHandler.initialize(this.requestHandlerResName, this.getServer(), this.log, this.clock);
 	   
+      //TODO: for v3 support we need to have this Snmp object have a USM (user security model) associated with it
+      // as well as the appropriate MP. 
+      
 	   //Snmp snmp = new Snmp(new DefaultTcpTransportMapping(new TcpAddress(this.bindAddress, this.port)));
        Snmp snmp = new Snmp(new DefaultUdpTransportMapping(new UdpAddress(this.bindAddress, this.port)));
        SnmpRequest request = new SnmpRequest(requestHandler, log);
 	   snmp.addCommandResponder(request);
 	   snmp.listen();
-	  /********************************************************************
-	   * 
-	   * ORIG!!!! 
-	   * 
-	   ********************************************************************/	  
-	   
-      // 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);
-      
-      /********************************************************************
-       * 
-       * START OF MINE!!!! 
-       * 
-       ********************************************************************/
-      
-//      TcpAddress tcpAddr = new TcpAddress(address, this.port);
-//      DefaultTcpTransportMapping tcpMapping = new DefaultTcpTransportMapping(tcpAddr);
-//      Snmp snmpPeer = new Snmp(tcpMapping);      
-//      
-      /********************************************************************
-       * 
-       * END OF MINE!!!! 
-       * 
-       ********************************************************************/
-    
-      /********************************************************************
-       * 
-       * ORIG!!!! 
-       * 
-       ********************************************************************/
-      
-//      // 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 the AgentSession with an optional thread pool
-//      this.agentSession = this.numberOfThreads > 1
-//         ? new SnmpAgentSession(requestHandler, peer, this.numberOfThreads)
-//         : new SnmpAgentSession(requestHandler, peer);
    }
    
    /**
@@ -660,102 +612,4 @@
          return InetAddress.getByName(host);
    }
 
-//	@Override
-//	public void processPdu(CommandResponderEvent event) {
-//		PDU pdu = event.getPDU();
-//
-//		if (pdu == null)
-//			return;
-//		
-//		int type = pdu.getType();
-//		//switch based on pdu.getType() == ___
-//		PDU response = null;
-//		try{
-//			switch (type) {
-//			case PDU.GET:
-//				response = requestHandler.snmpReceivedGet(pdu, false);
-////				Address address = event.getPeerAddress();
-////				Snmp snmp = new Snmp(new DefaultTcpTransportMapping((TcpAddress)address));
-//				break;
-//			case PDU.GETBULK:
-//				//TODO maybe make a method called snmpReceivedGetBulk in requesthandler 
-//				// requestHandler.snmpReceivedGet(pdu);
-//				break;
-//			case PDU.GETNEXT:
-//				response = requestHandler.snmpReceivedGet(pdu, true);
-//				break;
-//			case PDU.SET:
-//				response = requestHandler.snmpReceivedSet(pdu);
-//				break;
-//			default:
-//				log.warn("Invalid PDU type: " + PDU.getTypeString(type));
-//				return;
-//			}
-//			if (response != null) {
-//				sendResponse(event, response);
-//			}
-//		} catch (Exception e){
-//			log.debug("Snmp request failed: "+ PDU.getTypeString(pdu.getType()));
-//		}
-//		
-//	}
-	
-//	private void sendResponse(CommandResponderEvent requestEvent, PDU response) {
-//		//MessageDispatcher disp = requestEvent.getMessageDispatcher();
-//		try {
-//			if (response.getBERLength() > requestEvent.getMaxSizeResponsePDU()) {
-//				// response is tooBig
-//				if (response.getType() != PDU.REPORT) {
-//					if (requestEvent.getPDU().getType() == PDU.GETBULK) {
-//						while ((response.size() > 0) &&
-//						   (response.getBERLength() >
-//						    requestEvent.getMaxSizeResponsePDU())) 
-//						{
-//							response.trim();
-//						}
-//					}
-//					else {
-//						response.clear();
-//						response.setRequestID(requestEvent.getPDU().getRequestID());
-//						response.setErrorStatus(PDU.tooBig);
-//					}
-//				}
-//				if (response.getBERLength() > requestEvent.getMaxSizeResponsePDU()) {
-//					//still too big and can't send a response
-//					return;
-//				}
-//			}
-////---start of my addition -- Mar 29
-//
-//
-////--end of my addition
-//
-//			StatusInformation status = new StatusInformation();
-//			StateReference stateRef = requestEvent.getStateReference();
-//			if (stateRef == null) {
-//				log.warn("No state reference available for requestEvent="+	
-//			    requestEvent+". Cannot return response="+response);
-//			}
-//			else {
-//				stateRef.setTransportMapping(requestEvent.getTransportMapping());
-//				int resp = requestEvent.getMessageDispatcher().returnResponsePdu(requestEvent.getMessageProcessingModel(),
-//				               requestEvent.getSecurityModel(),
-//				               requestEvent.getSecurityName(),
-//				               requestEvent.getSecurityLevel(),
-//				               response,
-//				               requestEvent.getMaxSizeResponsePDU(),
-//				               //requestEvent.getStateReference(),
-//				               stateRef,
-//				               status);
-//				log.info("Response was OK? : "+resp +" Constant: "+SnmpConstants.SNMP_MP_OK);
-//				log.info("Returned response for requestID: " + 
-//						requestEvent.getPDU().getRequestID().toString() + 
-//						"to peer: "+requestEvent.getPeerAddress().toString());
-//			}
-//		}
-//		catch (MessageException ex) {
-//			log.error("Failed to send response to request "+requestEvent, ex);
-//		}
-//	}
-
 }

Modified: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -37,9 +37,6 @@
 import org.jboss.xb.binding.MappingObjectModelFactory;
 import org.jboss.xb.binding.Unmarshaller;
 import org.jboss.xb.binding.UnmarshallerFactory;
-//import org.opennms.protocols.snmp.SnmpIPAddress;
-//import org.opennms.protocols.snmp.SnmpPduPacket;
-//import org.opennms.protocols.snmp.SnmpPduTrap;
 
 import org.snmp4j.CommunityTarget;
 import org.snmp4j.PDUv1;

Modified: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/TrapFactorySupport.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/TrapFactorySupport.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/TrapFactorySupport.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -40,9 +40,6 @@
 import org.jboss.xb.binding.Unmarshaller;
 import org.jboss.xb.binding.UnmarshallerFactory;
 import org.jboss.xb.binding.UnmarshallingContext;
-//import org.opennms.protocols.snmp.SnmpPduPacket;
-//import org.opennms.protocols.snmp.SnmpPduRequest;
-//import org.opennms.protocols.snmp.SnmpPduTrap;
 import org.snmp4j.PDU;
 import org.snmp4j.PDUv1;
 import org.snmp4j.ScopedPDU;

Modified: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/config/manager/Manager.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/config/manager/Manager.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/config/manager/Manager.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -23,7 +23,11 @@
 
 /**
  * Simple POJO class to model XML data
+ * We need to have additional fields in this class for possible v3 support. 
+ * A User Name and Password for the USM need to be added. see RFC-3414.
+ * Without this being added to the manager, v3 PDUs (ScopedPDU) will never be accepted by the agent.
  * 
+ * 
  * @author  <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  * 
  * @version $Revision$

Modified: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupService.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupService.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupService.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -27,11 +27,7 @@
 import org.jboss.system.ServiceMBeanSupport;
 import org.jboss.system.server.ServerConfigLocator;
 import org.jboss.system.server.ServerInfoMBean;
-//import org.opennms.protocols.snmp.SnmpObjectId;
-//import org.opennms.protocols.snmp.SnmpTimeTicks;
 import org.snmp4j.smi.OID;
-// TODO: make a better representation of the time, similar to SnmpTimeTicks, 0m 0w 0d 0h 0s 00ms
-// maybe even extend timeticks and simply override it's toString method;
 import org.snmp4j.smi.TimeTicks;
 
 /**

Modified: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupServiceMBean.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupServiceMBean.java	2011-01-28 20:52:30 UTC (rev 110495)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupServiceMBean.java	2011-01-28 21:00:55 UTC (rev 110496)
@@ -25,8 +25,6 @@
 
 import org.jboss.mx.util.ObjectNameFactory;
 import org.jboss.system.ServiceMBean;
-//import org.opennms.protocols.snmp.SnmpObjectId;
-//import org.opennms.protocols.snmp.SnmpTimeTicks;
 import org.snmp4j.smi.OID;
 import org.snmp4j.smi.TimeTicks;
 



More information about the jboss-cvs-commits mailing list