001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.camel.api.management.mbean; 018 019import java.util.Set; 020 021import org.apache.camel.api.management.ManagedAttribute; 022import org.apache.camel.api.management.ManagedOperation; 023 024public interface ManagedBacklogDebuggerMBean { 025 026 @ManagedAttribute(description = "Camel ID") 027 String getCamelId(); 028 029 @ManagedAttribute(description = "Camel ManagementName") 030 String getCamelManagementName(); 031 032 @ManagedAttribute(description = "Logging Level") 033 String getLoggingLevel(); 034 035 @ManagedAttribute(description = "Logging Level") 036 void setLoggingLevel(String level); 037 038 @ManagedAttribute(description = "Is debugger enabled") 039 boolean isEnabled(); 040 041 @ManagedAttribute(description = "Is debugger standby") 042 boolean isStandby(); 043 044 @ManagedOperation(description = "Enable the debugger") 045 void enableDebugger(); 046 047 @ManagedOperation(description = "Disable the debugger") 048 void disableDebugger(); 049 050 @ManagedOperation(description = "Add a breakpoint at the given node id") 051 void addBreakpoint(String nodeId); 052 053 @ManagedOperation(description = "Add a conditional breakpoint at the given node id") 054 void addConditionalBreakpoint(String nodeId, String language, String predicate); 055 056 @ManagedOperation(description = "Remote the breakpoint from the given node id (will resume suspend breakpoint first)") 057 void removeBreakpoint(String nodeId); 058 059 @ManagedOperation(description = "Remote all breakpoints (will resume all suspend breakpoints first and exists single step mode)") 060 void removeAllBreakpoints(); 061 062 @ManagedOperation(description = "Resume running from the suspended breakpoint at the given node id") 063 void resumeBreakpoint(String nodeId); 064 065 @ManagedOperation(description = "Updates the message body (uses same type as old body) on the suspended breakpoint at the given node id") 066 void setMessageBodyOnBreakpoint(String nodeId, Object body); 067 068 @ManagedOperation(description = "Updates the message body (with a new type) on the suspended breakpoint at the given node id") 069 void setMessageBodyOnBreakpoint(String nodeId, Object body, String type); 070 071 @ManagedOperation(description = "Removes the message body on the suspended breakpoint at the given node id") 072 void removeMessageBodyOnBreakpoint(String nodeId); 073 074 @ManagedOperation(description = "Updates/adds the message header (uses same type as old header value) on the suspended breakpoint at the given node id") 075 void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value); 076 077 @ManagedOperation(description = "Removes the message header on the suspended breakpoint at the given node id") 078 void removeMessageHeaderOnBreakpoint(String nodeId, String headerName); 079 080 @ManagedOperation(description = "Updates/adds the message header (with a new type) on the suspended breakpoint at the given node id") 081 void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value, String type); 082 083 @ManagedOperation(description = "Resume running any suspended breakpoints, and exits step mode") 084 void resumeAll(); 085 086 @ManagedOperation(description = "Starts single step debugging from the suspended breakpoint at the given node id") 087 void stepBreakpoint(String nodeId); 088 089 @ManagedAttribute(description = "Suspended mode will suspend all exchanges until a remote debugger is attached") 090 boolean isSuspendedMode(); 091 092 @ManagedAttribute(description = "Whether currently in step mode") 093 boolean isSingleStepMode(); 094 095 @ManagedOperation(description = "Steps to next node in step mode") 096 void step(); 097 098 @ManagedOperation(description = "Return the node ids which has breakpoints") 099 Set<String> breakpoints(); 100 101 @ManagedOperation(description = "Return the node ids which is currently suspended") 102 Set<String> suspendedBreakpointNodeIds(); 103 104 @ManagedOperation(description = "Disables a breakpoint") 105 void disableBreakpoint(String nodeId); 106 107 @ManagedOperation(description = "Enables a breakpoint which has been disabled") 108 void enableBreakpoint(String nodeId); 109 110 @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.") 111 int getBodyMaxChars(); 112 113 @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.") 114 void setBodyMaxChars(int bodyMaxChars); 115 116 @ManagedAttribute(description = "Fallback Timeout in seconds when block the message processing in Camel") 117 long getFallbackTimeout(); 118 119 @ManagedAttribute(description = "Fallback Timeout in seconds when block the message processing in Camel") 120 void setFallbackTimeout(long fallbackTimeout); 121 122 @ManagedAttribute(description = "Whether to include stream based message body in the trace message") 123 boolean isBodyIncludeStreams(); 124 125 @ManagedAttribute(description = "Whether to include stream based message body in the trace message") 126 void setBodyIncludeStreams(boolean bodyIncludeStreams); 127 128 @ManagedAttribute(description = "Whether to include file based message body in the trace message.") 129 boolean isBodyIncludeFiles(); 130 131 @ManagedAttribute(description = "Whether to include file based message body in the trace message.") 132 void setBodyIncludeFiles(boolean bodyIncludeFiles); 133 134 @ManagedAttribute(description = "Whether to include exchange properties in the trace message.") 135 boolean isIncludeExchangeProperties(); 136 137 @ManagedAttribute(description = "Whether to include exchange properties in the trace message.") 138 void setIncludeExchangeProperties(boolean includeExchangeProperties); 139 140 @ManagedAttribute(description = "Whether to include exchange variables in the trace message.") 141 boolean isIncludeExchangeVariables(); 142 143 @ManagedAttribute(description = "Whether to include exchange variables in the trace message.") 144 void setIncludeExchangeVariables(boolean includeExchangeVariables); 145 146 @ManagedOperation(description = "Dumps the messages in XML format from the suspended breakpoint at the given node.") 147 String dumpTracedMessagesAsXml(String nodeId); 148 149 @ManagedOperation(description = "Dumps the messages in XML format from the suspended breakpoint at the given node.") 150 @Deprecated(since = "4.2.0") 151 String dumpTracedMessagesAsXml(String nodeId, boolean includeExchangeProperties); 152 153 @ManagedOperation(description = "Dumps the messages in JSon format from the suspended breakpoint at the given node.") 154 String dumpTracedMessagesAsJSon(String nodeId); 155 156 @ManagedAttribute(description = "Number of total debugged messages") 157 long getDebugCounter(); 158 159 @ManagedOperation(description = "Resets the debug counter") 160 void resetDebugCounter(); 161 162 @ManagedOperation(description = "Used for validating if a given breakpoint condition (predicate) is valid or not") 163 String validateConditionalBreakpoint(String language, String predicate); 164 165 @ManagedOperation(description = "Evaluates the expression at a given breakpoint node id") 166 Object evaluateExpressionAtBreakpoint(String nodeId, String language, String expression, String resultType); 167 168 @ManagedOperation(description = "Evaluates the expression at a given breakpoint node id and returns the result as String") 169 String evaluateExpressionAtBreakpoint(String nodeId, String language, String expression); 170 171 @ManagedOperation(description = "Updates/adds the exchange property (uses same type as old exchange property value) on the suspended breakpoint at the given node id") 172 void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value); 173 174 @ManagedOperation(description = "Updates/adds the exchange property (with a new type) on the suspended breakpoint at the given node id") 175 void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value, String type); 176 177 @ManagedOperation(description = "Removes the exchange property on the suspended breakpoint at the given node id") 178 void removeExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName); 179 180 @ManagedOperation(description = "Updates/adds the exchange variable (uses same type as old variableName value) on the suspended breakpoint at the given node id") 181 void setExchangeVariableOnBreakpoint(String nodeId, String variableName, Object value); 182 183 @ManagedOperation(description = "Updates/adds the exchange variable (with a new type) on the suspended breakpoint at the given node id") 184 void setExchangeVariableOnBreakpoint(String nodeId, String variableName, Object value, String type); 185 186 @ManagedOperation(description = "Removes the exchange variable on the suspended breakpoint at the given node id") 187 void removeExchangeVariableOnBreakpoint(String nodeId, String variableName); 188 189 @ManagedOperation(description = "Returns the message history at the given node id as XML") 190 String messageHistoryOnBreakpointAsXml(String nodeId); 191 192 @ManagedOperation(description = "Attach the debugger") 193 void attach(); 194 195 @ManagedOperation(description = "Detach the debugger") 196 void detach(); 197}