[jboss-cvs] JBossAS SVN: r111674 - in branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator: metrics and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jun 24 14:54:05 EDT 2011
Author: thauser at redhat.com
Date: 2011-06-24 14:54:05 -0400 (Fri, 24 Jun 2011)
New Revision: 111674
Added:
branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/
branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/ManagedBean.java
branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/MappedAttribute.java
branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/Mapping.java
branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/VarBind.java
branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/VarBindList.java
Log:
creating copies of agent classes that have modified fields.
Added: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/ManagedBean.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/ManagedBean.java (rev 0)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/ManagedBean.java 2011-06-24 18:54:05 UTC (rev 111674)
@@ -0,0 +1,127 @@
+/*
+ * 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.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * ManagedBean holding list of MappedAttributes
+ *
+ * @author Heiko W. Rupp <pilhuhn at user.sf.net>
+ * @version $Release:$
+ */
+public class ManagedBean {
+ private String name;
+ private String oidPrefix;
+ private String oidDefinition;
+ private String tableName;
+ private String rowName;
+ private String description;
+ private String status;
+ private List<MappedAttribute> attributes;
+
+ /**
+ * Default CTOR
+ * */
+ public ManagedBean() {
+ // empty
+ }
+
+ public List<MappedAttribute> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(List<MappedAttribute> attributes) {
+ this.attributes = attributes;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getOidPrefix() {
+ return oidPrefix;
+ }
+
+ public void setOidPrefix(String oid_prefix) {
+ this.oidPrefix = oid_prefix;
+ }
+
+ public String getOidDefinition()
+ {
+ return oidDefinition;
+ }
+
+ public void setOidDefinition(String oidDefinition)
+ {
+ this.oidDefinition = oidDefinition;
+ }
+
+ public String getTableName(){
+ return this.tableName;
+ }
+
+ public void setTableName(String tableName){
+ this.tableName = tableName;
+ }
+
+ public String getDesc(){
+ return this.description;
+ }
+
+ public void setDesc(String desc){
+ this.description = desc;
+ }
+
+ public String getRowName(){
+ return this.rowName;
+ }
+
+ public void setRowName(String rowName){
+ this.rowName = rowName;
+ }
+
+ public String getStatus(){
+ return this.status;
+ }
+
+ public void setStatus(String status){
+ this.status = status;
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("[name=").append(name);
+ buf.append(", oidPrefix=").append(oidPrefix);
+ buf.append(", attributes=").append(attributes);
+ buf.append("]");
+ return buf.toString();
+ }
+}
Added: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/MappedAttribute.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/MappedAttribute.java (rev 0)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/MappedAttribute.java 2011-06-24 18:54:05 UTC (rev 111674)
@@ -0,0 +1,164 @@
+/*
+ * 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.metrics;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * An attribute mapping, by default readonly, and a blank description
+ *
+ * @author <a href="mailto:hwr at pilhuhn.de">Heiko W. Rupp</a>
+ * @version $Revision: 111649 $
+ */
+public class MappedAttribute
+{
+ private String name;
+ private String oid;
+ private String mode;
+ private boolean isReadWrite = false;
+ private String mbName = ""; //the name of the mBean this MappedAttribute is associated with
+ private String snmpType = ""; //the type for the MIB we should use, if provided
+ private String oidPrefix = ""; // all of these metrics are useful in the MIB Generator
+ private String oidDefName = "";
+ private String maxAccess = "";
+ private String snmpDescription = "";
+ private String status = "";
+ private boolean isIndex = false;
+
+ public MappedAttribute() {
+ }
+
+ /** Attribute name */
+ public String getName() {
+ return name;
+ }
+
+ @XmlAttribute(name="name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /** Attribute oid */
+ public String getOid() {
+ return oid;
+ }
+
+ @XmlAttribute(name="oid")
+ public void setOid(String oid) {
+ this.oid = oid;
+ }
+
+ /** Attribute mode (ro/rw) */
+ public boolean isReadWrite() {
+ return isReadWrite;
+ }
+
+ /** Attribute mode (ro/rw) */
+ public String getMode() {
+ return mode;
+ }
+
+ @XmlAttribute(name="mode")
+ public void setMode(String mode) {
+ this.mode = mode;
+ if(mode != null && mode.equalsIgnoreCase("rw")) {
+ isReadWrite = true;
+ }
+ }
+
+ public String getMbean(){
+ return this.mbName;
+ }
+
+ @XmlAttribute(name="name")
+ public void setMbean(String mbName){
+ this.mbName = mbName;
+ }
+
+ public String getSnmpType(){
+ return this.snmpType;
+ }
+
+ public void setSnmpType(String snmpType){
+ this.snmpType=snmpType;
+ }
+
+ public String getOidPrefix(){
+ return this.oidPrefix;
+ }
+
+ public void setOidPrefix(String oidPrefix){
+ if (oidPrefix.charAt(0) == '.')
+ this.oidPrefix = oidPrefix.substring(1);
+ else
+ this.oidPrefix = oidPrefix;
+ }
+
+ public String getOidDefName(){
+ return this.oidDefName;
+ }
+
+ public void setOidDefName(String oidDefName){
+ this.oidDefName = oidDefName;
+ }
+
+ public String getMaxAccess(){
+ return this.maxAccess;
+ }
+
+ public void setMaxAccess(String maxAccess){
+ this.maxAccess = maxAccess;
+ }
+
+ public String getSnmpDesc(){
+ return this.description;
+ }
+
+ public void setSnmpDesc(String snmpDesc){
+ this.description = snmpDesc;
+ }
+
+ public String getStatus(){
+ return this.status;
+ }
+
+ public void setStatus(String status){
+ this.status = status;
+ }
+
+ public boolean isIndex(){
+ return this.isIndex;
+ }
+
+ public void setIsIndex(boolean b){
+ isIndex = b;
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("[name=").append(name);
+ buf.append(", oid=").append(oid);
+ buf.append(", rw=").append(isReadWrite);
+ buf.append("]");
+ return buf.toString();
+ }
+}
Added: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/Mapping.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/Mapping.java (rev 0)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/Mapping.java 2011-06-24 18:54:05 UTC (rev 111674)
@@ -0,0 +1,193 @@
+/*
+ * 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.metrics;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Simple POJO class to model XML data
+ *
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ *
+ * @version $Revision: 111649 $
+ */
+public class Mapping
+{
+ // Private Data --------------------------------------------------
+
+ private String notificationType;
+ private int generic;
+ private int specific;
+ private String enterprise;
+ private boolean inform;
+ private String securityName;
+ private VarBindList varBindList;
+ private String name;
+ private String oidDefName;
+ private String description;
+ private String status;
+
+ // Constructors -------------------------------------------------
+
+ /**
+ * Default CTOR
+ */
+ public Mapping() {
+ // empty
+ }
+
+ // Accessors/Modifiers -------------------------------------------
+
+ public String getEnterprise(){
+ return enterprise;
+ }
+
+ public int getGeneric() {
+ return generic;
+ }
+
+ public String getNotificationType() {
+ return notificationType;
+ }
+
+ public int getSpecific() {
+ return specific;
+ }
+
+ public VarBindList getVarBindList() {
+ return varBindList;
+ }
+
+
+
+ @XmlAttribute(name="enterprise")
+ public void setEnterprise(String enterprise) {
+ this.enterprise = enterprise;
+ }
+
+ @XmlAttribute(name="generic")
+ public void setGeneric(int generic) {
+ this.generic = generic;
+ }
+
+ @XmlAttribute(name="notification-type")
+ public void setNotificationType(String notificationType) {
+ this.notificationType = notificationType;
+ }
+
+
+ @XmlAttribute(name="specific")
+ public void setSpecific(int specific) {
+ this.specific = specific;
+ }
+
+ @XmlElement(name="var-bind-list")
+ public void setVarBindList(VarBindList varBindList) {
+ this.varBindList = varBindList;
+ }
+
+ /**
+ * @param inform
+ * the inform to set
+ */
+ @XmlAttribute(name="inform")
+ public void setInform(boolean inform) {
+ this.inform = inform;
+ }
+
+ /**
+ * @return the inform
+ */
+ public boolean isInform() {
+ return inform;
+ }
+
+ /**
+ * @param securityName
+ * the securityName to set
+ */
+ @XmlAttribute(name="security-name")
+ public void setSecurityName(String securityName) {
+ this.securityName = securityName;
+ }
+
+ public void setOidDef(String en){
+ this.oidDefName = en;
+ }
+
+ public String getOidDef(){
+ return this.oidDefName;
+ }
+
+ /**
+ * @return the securityName
+ */
+ public String getSecurityName() {
+ return securityName;
+ }
+
+
+
+ public void setName(String name){
+ this.name = name;
+ }
+
+ public String getName(){
+ return this.name;
+ }
+
+ public void setDesc(String desc){
+ description = desc;
+ }
+
+ public String getDesc(){
+ return this.description;
+ }
+
+ public void setStatus(String status){
+ this.status = status;
+ }
+
+ public String getStatus(){
+ return this.status;
+ }
+
+ // Object overrides ----------------------------------------------
+
+ public String toString()
+ {
+ StringBuffer sbuf = new StringBuffer(256);
+
+ sbuf.append('[')
+ .append("notificationType=").append(notificationType)
+ .append(", generic=").append(generic)
+ .append(", specific=").append(specific)
+ .append(", enterprise=").append(enterprise)
+ .append(", inform=").append(inform)
+ .append(", securityName=").append(securityName)
+ .append(", varBindList=").append(varBindList)
+ .append(']');
+
+ return sbuf.toString();
+ }
+}
Added: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/VarBind.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/VarBind.java (rev 0)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/VarBind.java 2011-06-24 18:54:05 UTC (rev 111674)
@@ -0,0 +1,92 @@
+/*
+ * 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.metrics;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * Simple POJO class to model XML data
+ *
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ *
+ * @version $Revision: 111649 $
+ */
+public class VarBind {
+ // Private Data --------------------------------------------------
+
+ private String tag;
+ private String oid;
+ private String type;
+
+ // Constructors -------------------------------------------------
+
+ /**
+ * Default CTOR
+ */
+ public VarBind() {
+ // empty
+ }
+
+ // Accessors/Modifiers -------------------------------------------
+
+ public String getOid() {
+ return oid;
+ }
+
+ public String getTag() {
+ return tag;
+ }
+
+ @XmlAttribute(name = "oid")
+ public void setOid(String oid) {
+ this.oid = oid;
+ }
+
+ @XmlAttribute(name = "tag")
+ public void setTag(String tag) {
+ this.tag = tag;
+ }
+
+ @XmlAttribute(name = "type")
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ // Object overrides ----------------------------------------------
+
+ public String toString() {
+ StringBuffer sbuf = new StringBuffer(256);
+
+ sbuf.append('[').append("tag=").append(tag).append(", oid=")
+ .append(oid).append(", type=")
+ .append(type).append(']');
+
+ return sbuf.toString();
+ }
+}
Added: branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/VarBindList.java
===================================================================
--- branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/VarBindList.java (rev 0)
+++ branches/snmp4j-int/varia/src/main/java/org/jboss/jmx/adaptor/snmp/generator/metrics/VarBindList.java 2011-06-24 18:54:05 UTC (rev 111674)
@@ -0,0 +1,86 @@
+/*
+ * 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.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Simple POJO class to model XML data
+ *
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ *
+ * @version $Revision: 111649 $
+ */
+public class VarBindList {
+ // Private Data --------------------------------------------------
+
+ private String wrapperClass = "org.jboss.jmx.adaptor.snmp.agent.NotificationWrapperSupport";
+ private List<VarBind> varBindList = new ArrayList<VarBind>();
+
+ // Constructors -------------------------------------------------
+
+ /**
+ * Default CTOR
+ */
+ public VarBindList() {
+ // empty
+ }
+
+ // Accessors/Modifiers -------------------------------------------
+
+ public String getWrapperClass() {
+ return wrapperClass;
+ }
+
+ public List<VarBind> getVarBindList() {
+ return varBindList;
+ }
+
+ @XmlAttribute(name = "wrapper-class")
+ public void setWrapperClass(String wrapperClass) {
+ this.wrapperClass = wrapperClass;
+ }
+
+ @XmlElement(name = "var-bind")
+ public void setVarBindList(List<VarBind> varBindList) {
+ this.varBindList = varBindList;
+ }
+
+ public void addVarBind(VarBind child) {
+ this.varBindList.add(child);
+ }
+
+ // Object overrides ----------------------------------------------
+
+ public String toString() {
+ StringBuffer sbuf = new StringBuffer(256);
+
+ sbuf.append('[').append("wrapperClass=").append(wrapperClass)
+ .append(", varBindList=").append(varBindList).append(']');
+
+ return sbuf.toString();
+ }
+}
More information about the jboss-cvs-commits
mailing list