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     */
017    package org.apache.camel.api.management.mbean;
018    
019    import java.util.Set;
020    
021    import org.apache.camel.api.management.ManagedAttribute;
022    import org.apache.camel.api.management.ManagedOperation;
023    
024    public interface ManagedBacklogDebuggerMBean {
025    
026        @ManagedAttribute(description = "Logging Level")
027        String getLoggingLevel();
028    
029        @ManagedAttribute(description = "Logging Level")
030        void setLoggingLevel(String level);
031    
032        @ManagedAttribute(description = "Is debugger enabled")
033        boolean isEnabled();
034    
035        @ManagedOperation(description = "Enable the debugger")
036        void enableDebugger();
037    
038        @ManagedOperation(description = "Disable the debugger")
039        void disableDebugger();
040    
041        @ManagedOperation(description = "Add a breakpoint at the given node id")
042        void addBreakpoint(String nodeId);
043    
044        @ManagedOperation(description = "Add a conditional breakpoint at the given node id")
045        void addConditionalBreakpoint(String nodeId, String language, String predicate);
046    
047        @ManagedOperation(description = "Remote the breakpoint from the given node id (will resume suspend breakpoint first)")
048        void removeBreakpoint(String nodeId);
049    
050        @ManagedOperation(description = "Remote all breakpoints (will resume all suspend breakpoints first and exists single step mode)")
051        void removeAllBreakpoints();
052    
053        @ManagedOperation(description = "Resume running from the suspended breakpoint at the given node id")
054        void resumeBreakpoint(String nodeId);
055    
056        @ManagedOperation(description = "Updates the message body (uses same type as old body) on the suspended breakpoint at the given node id")
057        void setMessageBodyOnBreakpoint(String nodeId, Object body);
058    
059        @ManagedOperation(description = "Updates the message body (with a new type) on the suspended breakpoint at the given node id")
060        void setMessageBodyOnBreakpoint(String nodeId, Object body, String type);
061    
062        @ManagedOperation(description = "Removes the message body on the suspended breakpoint at the given node id")
063        void removeMessageBodyOnBreakpoint(String nodeId);
064    
065        @ManagedOperation(description = "Updates/adds the message header (uses same type as old header value) on the suspended breakpoint at the given node id")
066        void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value);
067    
068        @ManagedOperation(description = "Removes the message header on the suspended breakpoint at the given node id")
069        void removeMessageHeaderOnBreakpoint(String nodeId, String headerName);
070    
071        @ManagedOperation(description = "Updates/adds the message header (with a new type) on the suspended breakpoint at the given node id")
072        void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value, String type);
073    
074        @ManagedOperation(description = "Resume running any suspended breakpoints, and exits step mode")
075        void resumeAll();
076    
077        @ManagedOperation(description = "Starts single step debugging from the suspended breakpoint at the given node id")
078        void stepBreakpoint(String nodeId);
079    
080        @ManagedAttribute(description = "Whether currently in step mode")
081        boolean isSingleStepMode();
082    
083        @ManagedOperation(description = "Steps to next node in step mode")
084        void step();
085    
086        @ManagedOperation(description = "Return the node ids which has breakpoints")
087        Set<String> getBreakpoints();
088    
089        @ManagedOperation(description = "Return the node ids which is currently suspended")
090        Set<String> getSuspendedBreakpointNodeIds();
091    
092        @ManagedOperation(description = "Disables a breakpoint")
093        void disableBreakpoint(String nodeId);
094    
095        @ManagedOperation(description = "Enables a breakpoint which has been disabled")
096        void enableBreakpoint(String nodeId);
097    
098        @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.")
099        int getBodyMaxChars();
100    
101        @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.")
102        void setBodyMaxChars(int bodyMaxChars);
103    
104        @ManagedAttribute(description = "Whether to include stream based message body in the trace message.")
105        boolean isBodyIncludeStreams();
106    
107        @ManagedAttribute(description = "Whether to include stream based message body in the trace message.")
108        void setBodyIncludeStreams(boolean bodyIncludeStreams);
109    
110        @ManagedAttribute(description = "Whether to include file based message body in the trace message.")
111        boolean isBodyIncludeFiles();
112    
113        @ManagedAttribute(description = "Whether to include file based message body in the trace message.")
114        void setBodyIncludeFiles(boolean bodyIncludeFiles);
115    
116        @ManagedOperation(description = "Dumps the messages in xml format from the suspended breakpoint at the given node")
117        String dumpTracedMessagesAsXml(String nodeId);
118    
119        @ManagedAttribute(description = "Number of total debugged messages")
120        long getDebugCounter();
121    
122        @ManagedOperation(description = "Resets the debug counter")
123        void resetDebugCounter();
124    
125    }