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.List; 020 021 import org.apache.camel.api.management.ManagedAttribute; 022 import org.apache.camel.api.management.ManagedOperation; 023 024 public interface ManagedBacklogTracerMBean { 025 026 @ManagedAttribute(description = "Is tracing enabled") 027 boolean isEnabled(); 028 029 @ManagedAttribute(description = "Is tracing enabled") 030 void setEnabled(boolean enabled); 031 032 @ManagedAttribute(description = "Number of maximum traced messages in total to keep in the backlog (FIFO queue)") 033 int getBacklogSize(); 034 035 @ManagedAttribute(description = "Number of maximum traced messages in total to keep in the backlog (FIFO queue)") 036 void setBacklogSize(int backlogSize); 037 038 @ManagedAttribute(description = "Whether to remove traced message from backlog when dumping trace messages") 039 boolean isRemoveOnDump(); 040 041 @ManagedAttribute(description = "Whether to remove traced message from backlog when dumping trace messages") 042 void setRemoveOnDump(boolean removeOnDump); 043 044 @ManagedAttribute(description = "To filter tracing by nodes (pattern)") 045 void setTracePattern(String pattern); 046 047 @ManagedAttribute(description = "To filter tracing by nodes (pattern)") 048 String getTracePattern(); 049 050 @ManagedAttribute(description = "To filter tracing by predicate (uses simple language by default)") 051 void setTraceFilter(String predicate); 052 053 @ManagedAttribute(description = "To filter tracing by predicate (uses simple language by default)") 054 String getTraceFilter(); 055 056 @ManagedAttribute(description = "Number of total traced messages") 057 long getTraceCounter(); 058 059 @ManagedOperation(description = "Resets the trace counter") 060 void resetTraceCounter(); 061 062 @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.") 063 int getBodyMaxChars(); 064 065 @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.") 066 void setBodyMaxChars(int bodyMaxChars); 067 068 @ManagedAttribute(description = "Whether to include stream based message body in the trace message.") 069 boolean isBodyIncludeStreams(); 070 071 @ManagedAttribute(description = "Whether to include stream based message body in the trace message.") 072 void setBodyIncludeStreams(boolean bodyIncludeStreams); 073 074 @ManagedAttribute(description = "Whether to include file based message body in the trace message.") 075 boolean isBodyIncludeFiles(); 076 077 @ManagedAttribute(description = "Whether to include file based message body in the trace message.") 078 void setBodyIncludeFiles(boolean bodyIncludeFiles); 079 080 @ManagedOperation(description = "Dumps the traced messages for the given node or route") 081 List<BacklogTracerEventMessage> dumpTracedMessages(String nodeOrRouteId); 082 083 @ManagedOperation(description = "Dumps the traced messages for the given node or route in xml format") 084 String dumpTracedMessagesAsXml(String nodeOrRouteId); 085 086 @ManagedOperation(description = "Dumps all the traced messages") 087 List<BacklogTracerEventMessage> dumpAllTracedMessages(); 088 089 @ManagedOperation(description = "Dumps all the traced messages in xml format") 090 String dumpAllTracedMessagesAsXml(); 091 092 @ManagedOperation(description = "Clears the backlog") 093 void clear(); 094 095 }