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 @ManagedOperation(description = "Enable the debugger") 042 void enableDebugger(); 043 044 @ManagedOperation(description = "Disable the debugger") 045 void disableDebugger(); 046 047 @ManagedOperation(description = "Add a breakpoint at the given node id") 048 void addBreakpoint(String nodeId); 049 050 @ManagedOperation(description = "Add a conditional breakpoint at the given node id") 051 void addConditionalBreakpoint(String nodeId, String language, String predicate); 052 053 @ManagedOperation(description = "Remote the breakpoint from the given node id (will resume suspend breakpoint first)") 054 void removeBreakpoint(String nodeId); 055 056 @ManagedOperation(description = "Remote all breakpoints (will resume all suspend breakpoints first and exists single step mode)") 057 void removeAllBreakpoints(); 058 059 @ManagedOperation(description = "Resume running from the suspended breakpoint at the given node id") 060 void resumeBreakpoint(String nodeId); 061 062 @ManagedOperation(description = "Updates the message body (uses same type as old body) on the suspended breakpoint at the given node id") 063 void setMessageBodyOnBreakpoint(String nodeId, Object body); 064 065 @ManagedOperation(description = "Updates the message body (with a new type) on the suspended breakpoint at the given node id") 066 void setMessageBodyOnBreakpoint(String nodeId, Object body, String type); 067 068 @ManagedOperation(description = "Removes the message body on the suspended breakpoint at the given node id") 069 void removeMessageBodyOnBreakpoint(String nodeId); 070 071 @ManagedOperation(description = "Updates/adds the message header (uses same type as old header value) on the suspended breakpoint at the given node id") 072 void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value); 073 074 @ManagedOperation(description = "Removes the message header on the suspended breakpoint at the given node id") 075 void removeMessageHeaderOnBreakpoint(String nodeId, String headerName); 076 077 @ManagedOperation(description = "Updates/adds the message header (with a new type) on the suspended breakpoint at the given node id") 078 void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value, String type); 079 080 @ManagedOperation(description = "Resume running any suspended breakpoints, and exits step mode") 081 void resumeAll(); 082 083 @ManagedOperation(description = "Starts single step debugging from the suspended breakpoint at the given node id") 084 void stepBreakpoint(String nodeId); 085 086 @ManagedAttribute(description = "Suspended mode will suspend all exchanges until a remote debugger is attached") 087 boolean isSuspendedMode(); 088 089 @ManagedAttribute(description = "Whether currently in step mode") 090 boolean isSingleStepMode(); 091 092 @ManagedOperation(description = "Steps to next node in step mode") 093 void step(); 094 095 @ManagedOperation(description = "Return the node ids which has breakpoints") 096 Set<String> breakpoints(); 097 098 @ManagedOperation(description = "Return the node ids which is currently suspended") 099 Set<String> suspendedBreakpointNodeIds(); 100 101 @ManagedOperation(description = "Disables a breakpoint") 102 void disableBreakpoint(String nodeId); 103 104 @ManagedOperation(description = "Enables a breakpoint which has been disabled") 105 void enableBreakpoint(String nodeId); 106 107 @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.") 108 int getBodyMaxChars(); 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 void setBodyMaxChars(int bodyMaxChars); 112 113 @ManagedAttribute(description = "Fallback Timeout in seconds when block the message processing in Camel") 114 long getFallbackTimeout(); 115 116 @ManagedAttribute(description = "Fallback Timeout in seconds when block the message processing in Camel") 117 void setFallbackTimeout(long fallbackTimeout); 118 119 @ManagedAttribute(description = "Whether to include stream based message body in the trace message") 120 boolean isBodyIncludeStreams(); 121 122 @ManagedAttribute(description = "Whether to include stream based message body in the trace message") 123 void setBodyIncludeStreams(boolean bodyIncludeStreams); 124 125 @ManagedAttribute(description = "Whether to include file based message body in the trace message.") 126 boolean isBodyIncludeFiles(); 127 128 @ManagedAttribute(description = "Whether to include file based message body in the trace message.") 129 void setBodyIncludeFiles(boolean bodyIncludeFiles); 130 131 @ManagedAttribute(description = "Whether to include exchange properties in the trace message.") 132 boolean isIncludeExchangeProperties(); 133 134 @ManagedAttribute(description = "Whether to include exchange properties in the trace message.") 135 void setIncludeExchangeProperties(boolean includeExchangeProperties); 136 137 @ManagedOperation(description = "Dumps the messages in XML format from the suspended breakpoint at the given node.") 138 String dumpTracedMessagesAsXml(String nodeId); 139 140 @ManagedOperation(description = "Dumps the messages in XML format from the suspended breakpoint at the given node.") 141 @Deprecated 142 String dumpTracedMessagesAsXml(String nodeId, boolean includeExchangeProperties); 143 144 @ManagedOperation(description = "Dumps the messages in JSon format from the suspended breakpoint at the given node.") 145 String dumpTracedMessagesAsJSon(String nodeId); 146 147 @ManagedAttribute(description = "Number of total debugged messages") 148 long getDebugCounter(); 149 150 @ManagedOperation(description = "Resets the debug counter") 151 void resetDebugCounter(); 152 153 @ManagedOperation(description = "Used for validating if a given breakpoint condition (predicate) is valid or not") 154 String validateConditionalBreakpoint(String language, String predicate); 155 156 @ManagedOperation(description = "Evaluates the expression at a given breakpoint node id") 157 Object evaluateExpressionAtBreakpoint(String nodeId, String language, String expression, String resultType); 158 159 @ManagedOperation(description = "Evaluates the expression at a given breakpoint node id and returns the result as String") 160 String evaluateExpressionAtBreakpoint(String nodeId, String language, String expression); 161 162 @ManagedOperation(description = "Updates/adds the exchange property (uses same type as old exchange property value) on the suspended breakpoint at the given node id") 163 void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value); 164 165 @ManagedOperation(description = "Removes the exchange property on the suspended breakpoint at the given node id") 166 void removeExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName); 167 168 @ManagedOperation(description = "Updates/adds the exchange property (with a new type) on the suspended breakpoint at the given node id") 169 void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value, String type); 170 171 @ManagedOperation(description = "Returns the message history at the given node id as XML") 172 String messageHistoryOnBreakpointAsXml(String nodeId); 173 174 @ManagedOperation(description = "Attach the debugger") 175 void attach(); 176 177 @ManagedOperation(description = "Detach the debugger") 178 void detach(); 179}