[jboss-cvs] JBossAS SVN: r111630 - branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 14 13:33:09 EDT 2011


Author: thauser at redhat.com
Date: 2011-06-14 13:33:08 -0400 (Tue, 14 Jun 2011)
New Revision: 111630

Removed:
   branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/ParserBindings.java
Log:


Deleted: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/ParserBindings.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/ParserBindings.java	2011-06-14 13:39:08 UTC (rev 111629)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/ParserBindings.java	2011-06-14 17:33:08 UTC (rev 111630)
@@ -1,113 +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.generator;
-
-import java.util.ArrayList;
-
-import org.jboss.jmx.adaptor.snmp.config.attribute.AttributeMappings;
-import org.jboss.jmx.adaptor.snmp.config.attribute.ManagedBean;
-import org.jboss.jmx.adaptor.snmp.config.attribute.MappedAttribute;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * Parse the mapping of JMX mbean attributes to SNMP OIDs
- * 
- *      </mbean>
- * 
- * @author <a href="mailto:tom.hauser at gmail.com>Tom Hauser</a>
- * @version $Revision: 111505 $
- */
-public class ParserBindings implements ObjectModelFactory
-{
-	
-	public Object newRoot(Object root, UnmarshallingContext ctx,
-			String namespaceURI, String localName, Attributes attrs)
-   {
-	   if (!localName.equals("attribute-mappings"))
-      {
-	      throw new IllegalStateException("Unexpected root " + localName + ". Expected <attribute-mappings>");
-		}
-	   return new AttributeMappings();
-	}
-
-	public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
-   {
-	   return root;
-	}
-
-	public void setValue(AttributeMappings mappings, UnmarshallingContext navigator,
-		      String namespaceUri, String localName, String value)
-	{
-	}	
-	
-	public Object newChild(AttributeMappings mappings, UnmarshallingContext navigator,
-			String namespaceUri, String localName, Attributes attrs)
-	{
-		if ("mbean".equals(localName))
-      {
-			String name = attrs.getValue("name");
-			String oidPrefix = attrs.getValue("oid-prefix");
-			ManagedBean child = new ManagedBean();
-			child.setName(name);
-			child.setOidPrefix(oidPrefix);
-			return child;
-		}
-		return null;
-	}
-	
-	public void addChild(AttributeMappings mappings, ManagedBean mbean,
-			UnmarshallingContext navigator, String namespaceURI, String localName) 
-	{
-		mappings.addMonitoredMBean(mbean);
-	}
-	
-	public Object newChild(ManagedBean mbean, UnmarshallingContext navigator,
-			String namespaceUri, String localName, Attributes attrs)
-	{
-		
-		MappedAttribute attribute = null;
-		if ("attribute".equals(localName)) {
-			String oid = attrs.getValue("oid");
-			String name = attrs.getValue("name");
-			String mode = attrs.getValue("mode");
-			String snmpType = attrs.getValue("snmp-type");
-			attribute = new MappedAttribute();
-			if ("rw".equalsIgnoreCase(mode))
-            attribute.setReadWrite(true);
-			attribute.setName(name);
-			attribute.setOid(oid);
-			attribute.setSnmpType(snmpType);
-		}
-		return attribute;
-	}
-	
-	public void addChild(ManagedBean mbean, MappedAttribute attribute,
-			UnmarshallingContext navigator, String namespaceURI, String localName)
-	{
-		if (mbean.getAttributes() == null)
-         mbean.setAttributes(new ArrayList());
-		
-		mbean.getAttributes().add(attribute);
-	}
-}



More information about the jboss-cvs-commits mailing list