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 = "Whether currently in step mode")
087    boolean isSingleStepMode();
088
089    @ManagedOperation(description = "Steps to next node in step mode")
090    void step();
091
092    /**
093     * @deprecated use {@link #breakpoints()}
094     */
095    @ManagedOperation(description = "Return the node ids which has breakpoints")
096    @Deprecated
097    Set<String> getBreakpoints();
098
099    @ManagedOperation(description = "Return the node ids which has breakpoints")
100    Set<String> breakpoints();
101
102    /**
103     * @deprecated use {@link #suspendedBreakpointNodeIds()}
104     */
105    @ManagedOperation(description = "Return the node ids which is currently suspended")
106    @Deprecated
107    Set<String> getSuspendedBreakpointNodeIds();
108
109    @ManagedOperation(description = "Return the node ids which is currently suspended")
110    Set<String> suspendedBreakpointNodeIds();
111
112    @ManagedOperation(description = "Disables a breakpoint")
113    void disableBreakpoint(String nodeId);
114
115    @ManagedOperation(description = "Enables a breakpoint which has been disabled")
116    void enableBreakpoint(String nodeId);
117
118    @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.")
119    int getBodyMaxChars();
120
121    @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.")
122    void setBodyMaxChars(int bodyMaxChars);
123
124    @ManagedAttribute(description = "Fallback Timeout in seconds when block the message processing in Camel")
125    long getFallbackTimeout();
126
127    @ManagedAttribute(description = "Fallback Timeout in seconds when block the message processing in Camel")
128    void setFallbackTimeout(long fallbackTimeout);
129
130    @ManagedAttribute(description = "Whether to include stream based message body in the trace message")
131    boolean isBodyIncludeStreams();
132
133    @ManagedAttribute(description = "Whether to include stream based message body in the trace message")
134    void setBodyIncludeStreams(boolean bodyIncludeStreams);
135
136    @ManagedAttribute(description = "Whether to include file based message body in the trace message.")
137    boolean isBodyIncludeFiles();
138
139    @ManagedAttribute(description = "Whether to include file based message body in the trace message.")
140    void setBodyIncludeFiles(boolean bodyIncludeFiles);
141
142    /**
143     * @deprecated use {@link #dumpTracedMessagesAsXml(String, boolean)}
144     */
145    @ManagedOperation(description = "Dumps the messages in xml format from the suspended breakpoint at the given node")
146    @Deprecated
147    String dumpTracedMessagesAsXml(String nodeId);
148
149    @ManagedOperation(description = "Dumps the messages in xml format from the suspended breakpoint at the given node, optionally including the exchange properties")
150    String dumpTracedMessagesAsXml(String nodeId, boolean includeExchangeProperties);
151
152    @ManagedAttribute(description = "Number of total debugged messages")
153    long getDebugCounter();
154
155    @ManagedOperation(description = "Resets the debug counter")
156    void resetDebugCounter();
157
158    @ManagedOperation(description = "Used for validating if a given breakpoint condition (predicate) is valid or not")
159    String validateConditionalBreakpoint(String language, String predicate);
160
161    @ManagedOperation(description = "Evaluates the expression at a given breakpoint node id")
162    Object evaluateExpressionAtBreakpoint(String nodeId, String language, String expression, String resultType);
163
164    @ManagedOperation(description = "Evaluates the expression at a given breakpoint node id and returns the result as String")
165    String evaluateExpressionAtBreakpoint(String nodeId, String language, String expression);
166
167    @ManagedOperation(description = "Updates/adds the exchange property (uses same type as old exchange property  value) on the suspended breakpoint at the given node id")
168    void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value);
169
170    @ManagedOperation(description = "Removes the exchange property on the suspended breakpoint at the given node id")
171    void removeExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName);
172
173    @ManagedOperation(description = "Updates/adds the exchange property (with a new type) on the suspended breakpoint at the given node id")
174    void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value, String type);
175
176    @ManagedOperation(description = "Returns the message history at the given node id as XML")
177    String messageHistoryOnBreakpointAsXml(String nodeId);
178
179    @ManagedOperation(description = "Attach the debugger")
180    void attach();
181
182    @ManagedOperation(description = "Detach the debugger")
183    void detach();
184}