blob: 6b5d6b8b659ed244735058e511dce08e12468b85 [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001/**
Ray Milkey269ffb92014-04-03 14:43:30 -07002 * 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 **/
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080017
18package net.floodlightcontroller.core.annotations;
19
20import java.lang.annotation.ElementType;
21import java.lang.annotation.Target;
22
23/**
24 * Annotation used to document log messages. This can be used to generate
25 * documentation on syslog output.
Ray Milkey269ffb92014-04-03 14:43:30 -070026 *
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080027 * @author readams
28 */
29@Target({ElementType.TYPE, ElementType.METHOD})
30public @interface LogMessageDoc {
31 public static final String NO_ACTION = "No action is required.";
32 public static final String UNKNOWN_ERROR = "An unknown error occured";
Ray Milkey269ffb92014-04-03 14:43:30 -070033 public static final String GENERIC_ACTION =
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080034 "Examine the returned error or exception and take " +
Ray Milkey269ffb92014-04-03 14:43:30 -070035 "appropriate action.";
36 public static final String CHECK_SWITCH =
37 "Check the health of the indicated switch. " +
38 "Test and troubleshoot IP connectivity.";
39 public static final String CHECK_CONTROLLER =
40 "Verify controller system health, CPU usage, and memory. " +
41 "Rebooting the controller node may help if the controller " +
42 "node is in a distressed state.";
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080043 public static final String REPORT_CONTROLLER_BUG =
44 "This is likely a defect in the controller. Please report this " +
Ray Milkey269ffb92014-04-03 14:43:30 -070045 "issue. Restarting the controller or switch may help to " +
46 "alleviate.";
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080047 public static final String REPORT_SWITCH_BUG =
48 "This is likely a defect in the switch. Please report this " +
Ray Milkey269ffb92014-04-03 14:43:30 -070049 "issue. Restarting the controller or switch may help to " +
50 "alleviate.";
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080051
52 /**
53 * The log level for the log message
Ray Milkey269ffb92014-04-03 14:43:30 -070054 *
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080055 * @return the log level as a tring
56 */
57 String level() default "INFO";
Ray Milkey269ffb92014-04-03 14:43:30 -070058
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080059 /**
60 * The message that will be printed
Ray Milkey269ffb92014-04-03 14:43:30 -070061 *
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080062 * @return the message
63 */
64 String message() default UNKNOWN_ERROR;
Ray Milkey269ffb92014-04-03 14:43:30 -070065
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080066 /**
67 * An explanation of the meaning of the log message
Ray Milkey269ffb92014-04-03 14:43:30 -070068 *
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080069 * @return the explanation
70 */
71 String explanation() default UNKNOWN_ERROR;
Ray Milkey269ffb92014-04-03 14:43:30 -070072
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080073 /**
74 * The recommendated action associated with the log message
Ray Milkey269ffb92014-04-03 14:43:30 -070075 *
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080076 * @return the recommendation
77 */
78 String recommendation() default NO_ACTION;
79}