J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | package sun.management; |
| 27 | |
| 28 | /** |
| 29 | * Configuration Error thrown by a management agent. |
| 30 | */ |
| 31 | public class AgentConfigurationError extends Error { |
| 32 | public static final String AGENT_EXCEPTION = |
| 33 | "agent.err.exception"; |
| 34 | public static final String CONFIG_FILE_NOT_FOUND = |
| 35 | "agent.err.configfile.notfound"; |
| 36 | public static final String CONFIG_FILE_OPEN_FAILED = |
| 37 | "agent.err.configfile.failed"; |
| 38 | public static final String CONFIG_FILE_CLOSE_FAILED = |
| 39 | "agent.err.configfile.closed.failed"; |
| 40 | public static final String CONFIG_FILE_ACCESS_DENIED = |
| 41 | "agent.err.configfile.access.denied"; |
| 42 | public static final String EXPORT_ADDRESS_FAILED = |
| 43 | "agent.err.exportaddress.failed"; |
| 44 | public static final String AGENT_CLASS_NOT_FOUND = |
| 45 | "agent.err.agentclass.notfound"; |
| 46 | public static final String AGENT_CLASS_FAILED = |
| 47 | "agent.err.agentclass.failed"; |
| 48 | public static final String AGENT_CLASS_PREMAIN_NOT_FOUND = |
| 49 | "agent.err.premain.notfound"; |
| 50 | public static final String AGENT_CLASS_ACCESS_DENIED = |
| 51 | "agent.err.agentclass.access.denied"; |
| 52 | public static final String AGENT_CLASS_INVALID = |
| 53 | "agent.err.invalid.agentclass"; |
| 54 | public static final String INVALID_JMXREMOTE_PORT = |
| 55 | "agent.err.invalid.jmxremote.port"; |
| 56 | public static final String PASSWORD_FILE_NOT_SET = |
| 57 | "agent.err.password.file.notset"; |
| 58 | public static final String PASSWORD_FILE_NOT_READABLE = |
| 59 | "agent.err.password.file.not.readable"; |
| 60 | public static final String PASSWORD_FILE_READ_FAILED = |
| 61 | "agent.err.password.file.read.failed"; |
| 62 | public static final String PASSWORD_FILE_NOT_FOUND = |
| 63 | "agent.err.password.file.notfound"; |
| 64 | public static final String ACCESS_FILE_NOT_SET = |
| 65 | "agent.err.access.file.notset"; |
| 66 | public static final String ACCESS_FILE_NOT_READABLE = |
| 67 | "agent.err.access.file.not.readable"; |
| 68 | public static final String ACCESS_FILE_READ_FAILED = |
| 69 | "agent.err.access.file.read.failed"; |
| 70 | public static final String ACCESS_FILE_NOT_FOUND = |
| 71 | "agent.err.access.file.notfound"; |
| 72 | public static final String PASSWORD_FILE_ACCESS_NOT_RESTRICTED = |
| 73 | "agent.err.password.file.access.notrestricted"; |
| 74 | public static final String FILE_ACCESS_NOT_RESTRICTED = |
| 75 | "agent.err.file.access.not.restricted"; |
| 76 | public static final String FILE_NOT_FOUND = |
| 77 | "agent.err.file.not.found"; |
| 78 | public static final String FILE_NOT_READABLE = |
| 79 | "agent.err.file.not.readable"; |
| 80 | public static final String FILE_NOT_SET = |
| 81 | "agent.err.file.not.set"; |
| 82 | public static final String FILE_READ_FAILED = |
| 83 | "agent.err.file.read.failed"; |
| 84 | public static final String CONNECTOR_SERVER_IO_ERROR = |
| 85 | "agent.err.connector.server.io.error"; |
| 86 | public static final String INVALID_OPTION = |
| 87 | "agent.err.invalid.option"; |
| 88 | public static final String INVALID_SNMP_PORT = |
| 89 | "agent.err.invalid.snmp.port"; |
| 90 | public static final String INVALID_SNMP_TRAP_PORT = |
| 91 | "agent.err.invalid.snmp.trap.port"; |
| 92 | public static final String UNKNOWN_SNMP_INTERFACE = |
| 93 | "agent.err.unknown.snmp.interface"; |
| 94 | public static final String SNMP_ACL_FILE_NOT_SET = |
| 95 | "agent.err.acl.file.notset"; |
| 96 | public static final String SNMP_ACL_FILE_NOT_FOUND = |
| 97 | "agent.err.acl.file.notfound"; |
| 98 | public static final String SNMP_ACL_FILE_NOT_READABLE = |
| 99 | "agent.err.acl.file.not.readable"; |
| 100 | public static final String SNMP_ACL_FILE_READ_FAILED = |
| 101 | "agent.err.acl.file.read.failed"; |
| 102 | public static final String SNMP_ACL_FILE_ACCESS_NOT_RESTRICTED = |
| 103 | "agent.err.acl.file.access.notrestricted"; |
| 104 | public static final String SNMP_ADAPTOR_START_FAILED = |
| 105 | "agent.err.snmp.adaptor.start.failed"; |
| 106 | public static final String SNMP_MIB_INIT_FAILED = |
| 107 | "agent.err.snmp.mib.init.failed"; |
| 108 | |
| 109 | private final String error; |
| 110 | private final String[] params; |
| 111 | |
| 112 | public AgentConfigurationError(String error) { |
| 113 | super(); |
| 114 | this.error = error; |
| 115 | this.params = null; |
| 116 | } |
| 117 | |
| 118 | public AgentConfigurationError(String error, Throwable cause) { |
| 119 | super(cause); |
| 120 | this.error = error; |
| 121 | this.params = null; |
| 122 | } |
| 123 | |
| 124 | public AgentConfigurationError(String error, String... params) { |
| 125 | super(); |
| 126 | this.error = error; |
| 127 | this.params = new String[params.length]; |
| 128 | for (int i = 0; i < params.length; i++) { |
| 129 | this.params[i] = params[i]; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | public AgentConfigurationError(String error, Throwable cause, String... params) { |
| 134 | super(cause); |
| 135 | this.error = error; |
| 136 | this.params = new String[params.length]; |
| 137 | for (int i = 0; i < params.length; i++) { |
| 138 | this.params[i] = params[i]; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | public String getError() { |
| 143 | return error; |
| 144 | } |
| 145 | |
| 146 | public String[] getParams() { |
| 147 | return params; |
| 148 | } |
| 149 | } |