Message represents data collected during application runtime. It will be sent to back-end system asynchronous for further processing. Super interface of Event , Heartbeat and Transaction . @see com.dianping.cat.message.Transaction @see com.dia
| 36 | * @author Frankie Wu |
| 37 | */ |
| 38 | public interface Message { |
| 39 | public static final String SUCCESS = "0"; |
| 40 | |
| 41 | /** |
| 42 | * add one or multiple key-value pairs to the message. |
| 43 | * |
| 44 | * @param keyValuePairs |
| 45 | * key-value pairs like 'a=1&b=2&...' |
| 46 | */ |
| 47 | public void addData(String keyValuePairs); |
| 48 | |
| 49 | /** |
| 50 | * add one key-value pair to the message. |
| 51 | * |
| 52 | * @param key |
| 53 | * @param value |
| 54 | */ |
| 55 | public void addData(String key, Object value); |
| 56 | |
| 57 | /** |
| 58 | * Complete the message construction. |
| 59 | */ |
| 60 | public void complete(); |
| 61 | |
| 62 | /** |
| 63 | * @return key value pairs data |
| 64 | */ |
| 65 | public Object getData(); |
| 66 | |
| 67 | /** |
| 68 | * Message name. |
| 69 | * |
| 70 | * @return message name |
| 71 | */ |
| 72 | public String getName(); |
| 73 | |
| 74 | /** |
| 75 | * Get the message status. |
| 76 | * |
| 77 | * @return message status. "0" means success, otherwise error code. |
| 78 | */ |
| 79 | public String getStatus(); |
| 80 | |
| 81 | /** |
| 82 | * The time stamp the message was created. |
| 83 | * |
| 84 | * @return message creation time stamp in milliseconds |
| 85 | */ |
| 86 | public long getTimestamp(); |
| 87 | |
| 88 | /** |
| 89 | * Message type. |
| 90 | * |
| 91 | * <p> |
| 92 | * Typical message types are: |
| 93 | * <ul> |
| 94 | * <li>URL: maps to one method of an action</li> |
| 95 | * <li>Service: maps to one method of service call</li> |
no outgoing calls
no test coverage detected