001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Nam Nguyen
028: */
029:
030: package com.caucho.server.snmp;
031:
032: import com.caucho.server.snmp.types.SnmpValue;
033:
034: public class MbeanAttributeInfo {
035: private String _owner;
036: private String _name;
037:
038: private String _oid;
039: private int _type = SnmpValue.INTEGER;
040:
041: public static final int INTEGER = SnmpValue.INTEGER;
042: public static final int OCTET_STRING = SnmpValue.OCTET_STRING;
043: public static final int GAUGE = SnmpValue.GAUGE;
044: public static final int COUNTER = SnmpValue.COUNTER;
045: public static final int TIME_TICKS = SnmpValue.TIME_TICKS;
046:
047: public MbeanAttributeInfo() {
048: }
049:
050: public MbeanAttributeInfo(String owner, String name) {
051: _owner = owner;
052: _name = name;
053: }
054:
055: public MbeanAttributeInfo(String owner, String name, int type) {
056: _owner = owner;
057: _name = name;
058: _type = type;
059: }
060:
061: public String getOwner() {
062: return _owner;
063: }
064:
065: public void setOwner(String owner) {
066: _owner = owner;
067: }
068:
069: public String getName() {
070: return _name;
071: }
072:
073: public void setName(String name) {
074: _name = name;
075: }
076:
077: public int getType() {
078: return _type;
079: }
080:
081: public void setType(int type) {
082: _type = type;
083: }
084:
085: public String getOid() {
086: return _oid;
087: }
088:
089: public void setOid(String oid) {
090: _oid = oid;
091: }
092:
093: public boolean equals(Object obj) {
094: if (obj instanceof MbeanAttributeInfo) {
095: MbeanAttributeInfo attr = (MbeanAttributeInfo) obj;
096:
097: return _owner.equals(attr.getOwner())
098: && _name.equals(attr.getName());
099: } else
100: return false;
101: }
102:
103: public String toString() {
104: return "MbeanAttribute[" + _owner + "," + _name + "," + _oid
105: + SnmpValue.typeName(_type) + "]";
106: }
107: }
|