Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 1 | /** |
| 2 | * Copyright 2012, Big Switch Networks, Inc. |
| 3 | * Originally created by David Erickson, Stanford University |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | * not use this file except in compliance with the License. You may obtain |
| 7 | * a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | * License for the specific language governing permissions and limitations |
| 15 | * under the License. |
| 16 | **/ |
| 17 | |
| 18 | package net.floodlightcontroller.core.annotations; |
| 19 | |
| 20 | import java.lang.annotation.ElementType; |
| 21 | import java.lang.annotation.Target; |
| 22 | |
| 23 | /** |
| 24 | * Annotation used to document log messages. This can be used to generate |
| 25 | * documentation on syslog output. |
| 26 | * @author readams |
| 27 | */ |
| 28 | @Target({ElementType.TYPE, ElementType.METHOD}) |
| 29 | public @interface LogMessageDoc { |
| 30 | public static final String NO_ACTION = "No action is required."; |
| 31 | public static final String UNKNOWN_ERROR = "An unknown error occured"; |
| 32 | public static final String GENERIC_ACTION = |
| 33 | "Examine the returned error or exception and take " + |
| 34 | "appropriate action."; |
| 35 | public static final String CHECK_SWITCH = |
| 36 | "Check the health of the indicated switch. " + |
| 37 | "Test and troubleshoot IP connectivity."; |
| 38 | public static final String CHECK_CONTROLLER = |
| 39 | "Verify controller system health, CPU usage, and memory. " + |
| 40 | "Rebooting the controller node may help if the controller " + |
| 41 | "node is in a distressed state."; |
| 42 | public static final String REPORT_CONTROLLER_BUG = |
| 43 | "This is likely a defect in the controller. Please report this " + |
| 44 | "issue. Restarting the controller or switch may help to " + |
| 45 | "alleviate."; |
| 46 | public static final String REPORT_SWITCH_BUG = |
| 47 | "This is likely a defect in the switch. Please report this " + |
| 48 | "issue. Restarting the controller or switch may help to " + |
| 49 | "alleviate."; |
| 50 | |
| 51 | /** |
| 52 | * The log level for the log message |
| 53 | * @return the log level as a tring |
| 54 | */ |
| 55 | String level() default "INFO"; |
| 56 | /** |
| 57 | * The message that will be printed |
| 58 | * @return the message |
| 59 | */ |
| 60 | String message() default UNKNOWN_ERROR; |
| 61 | /** |
| 62 | * An explanation of the meaning of the log message |
| 63 | * @return the explanation |
| 64 | */ |
| 65 | String explanation() default UNKNOWN_ERROR; |
| 66 | /** |
| 67 | * The recommendated action associated with the log message |
| 68 | * @return the recommendation |
| 69 | */ |
| 70 | String recommendation() default NO_ACTION; |
| 71 | } |