001: /*
002: * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package sun.management;
027:
028: /**
029: * Configuration Error thrown by a management agent.
030: */
031: public class AgentConfigurationError extends Error {
032: public static final String AGENT_EXCEPTION = "agent.err.exception";
033: public static final String CONFIG_FILE_NOT_FOUND = "agent.err.configfile.notfound";
034: public static final String CONFIG_FILE_OPEN_FAILED = "agent.err.configfile.failed";
035: public static final String CONFIG_FILE_CLOSE_FAILED = "agent.err.configfile.closed.failed";
036: public static final String CONFIG_FILE_ACCESS_DENIED = "agent.err.configfile.access.denied";
037: public static final String EXPORT_ADDRESS_FAILED = "agent.err.exportaddress.failed";
038: public static final String AGENT_CLASS_NOT_FOUND = "agent.err.agentclass.notfound";
039: public static final String AGENT_CLASS_FAILED = "agent.err.agentclass.failed";
040: public static final String AGENT_CLASS_PREMAIN_NOT_FOUND = "agent.err.premain.notfound";
041: public static final String AGENT_CLASS_ACCESS_DENIED = "agent.err.agentclass.access.denied";
042: public static final String AGENT_CLASS_INVALID = "agent.err.invalid.agentclass";
043: public static final String INVALID_JMXREMOTE_PORT = "agent.err.invalid.jmxremote.port";
044: public static final String PASSWORD_FILE_NOT_SET = "agent.err.password.file.notset";
045: public static final String PASSWORD_FILE_NOT_READABLE = "agent.err.password.file.not.readable";
046: public static final String PASSWORD_FILE_READ_FAILED = "agent.err.password.file.read.failed";
047: public static final String PASSWORD_FILE_NOT_FOUND = "agent.err.password.file.notfound";
048: public static final String ACCESS_FILE_NOT_SET = "agent.err.access.file.notset";
049: public static final String ACCESS_FILE_NOT_READABLE = "agent.err.access.file.not.readable";
050: public static final String ACCESS_FILE_READ_FAILED = "agent.err.access.file.read.failed";
051: public static final String ACCESS_FILE_NOT_FOUND = "agent.err.access.file.notfound";
052: public static final String PASSWORD_FILE_ACCESS_NOT_RESTRICTED = "agent.err.password.file.access.notrestricted";
053: public static final String CONNECTOR_SERVER_IO_ERROR = "agent.err.connector.server.io.error";
054: public static final String INVALID_OPTION = "agent.err.invalid.option";
055: public static final String INVALID_SNMP_PORT = "agent.err.invalid.snmp.port";
056: public static final String INVALID_SNMP_TRAP_PORT = "agent.err.invalid.snmp.trap.port";
057: public static final String UNKNOWN_SNMP_INTERFACE = "agent.err.unknown.snmp.interface";
058: public static final String SNMP_ACL_FILE_NOT_SET = "agent.err.acl.file.notset";
059: public static final String SNMP_ACL_FILE_NOT_FOUND = "agent.err.acl.file.notfound";
060: public static final String SNMP_ACL_FILE_NOT_READABLE = "agent.err.acl.file.not.readable";
061: public static final String SNMP_ACL_FILE_READ_FAILED = "agent.err.acl.file.read.failed";
062: public static final String SNMP_ACL_FILE_ACCESS_NOT_RESTRICTED = "agent.err.acl.file.access.notrestricted";
063: public static final String SNMP_ADAPTOR_START_FAILED = "agent.err.snmp.adaptor.start.failed";
064: public static final String SNMP_MIB_INIT_FAILED = "agent.err.snmp.mib.init.failed";
065:
066: private final String error;
067: private final String[] params;
068:
069: public AgentConfigurationError(String error) {
070: super ();
071: this .error = error;
072: this .params = null;
073: }
074:
075: public AgentConfigurationError(String error, Throwable cause) {
076: super (cause);
077: this .error = error;
078: this .params = null;
079: }
080:
081: public AgentConfigurationError(String error, String... params) {
082: super ();
083: this .error = error;
084: this .params = new String[params.length];
085: for (int i = 0; i < params.length; i++) {
086: this .params[i] = params[i];
087: }
088: }
089:
090: public AgentConfigurationError(String error, Throwable cause,
091: String... params) {
092: super (cause);
093: this .error = error;
094: this .params = new String[params.length];
095: for (int i = 0; i < params.length; i++) {
096: this .params[i] = params[i];
097: }
098: }
099:
100: public String getError() {
101: return error;
102: }
103:
104: public String[] getParams() {
105: return params;
106: }
107: }
|