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.List; 020 021import org.apache.camel.api.management.ManagedAttribute; 022import org.apache.camel.api.management.ManagedOperation; 023import org.apache.camel.spi.BacklogTracerEventMessage; 024 025public interface ManagedBacklogTracerMBean { 026 027 @ManagedAttribute(description = "Camel ID") 028 String getCamelId(); 029 030 @ManagedAttribute(description = "Camel ManagementName") 031 String getCamelManagementName(); 032 033 @ManagedAttribute(description = "Is tracing standby") 034 boolean isStandby(); 035 036 @ManagedAttribute(description = "Is tracing enabled") 037 boolean isEnabled(); 038 039 @ManagedAttribute(description = "Is tracing enabled") 040 void setEnabled(boolean enabled); 041 042 @ManagedAttribute(description = "Number of maximum traced messages in total to keep in the backlog (FIFO queue)") 043 int getBacklogSize(); 044 045 @ManagedAttribute(description = "Number of maximum traced messages in total to keep in the backlog (FIFO queue)") 046 void setBacklogSize(int backlogSize); 047 048 @ManagedAttribute(description = "Whether to remove traced message from backlog when dumping trace messages") 049 boolean isRemoveOnDump(); 050 051 @ManagedAttribute(description = "Whether to remove traced message from backlog when dumping trace messages") 052 void setRemoveOnDump(boolean removeOnDump); 053 054 @ManagedAttribute(description = "To filter tracing by nodes (pattern)") 055 void setTracePattern(String pattern); 056 057 @ManagedAttribute(description = "To filter tracing by nodes (pattern)") 058 String getTracePattern(); 059 060 @ManagedAttribute(description = "To filter tracing by predicate (uses simple language by default)") 061 void setTraceFilter(String predicate); 062 063 @ManagedAttribute(description = "To filter tracing by predicate (uses simple language by default)") 064 String getTraceFilter(); 065 066 @ManagedAttribute(description = "Number of total traced messages") 067 long getTraceCounter(); 068 069 @ManagedOperation(description = "Resets the trace counter") 070 void resetTraceCounter(); 071 072 @ManagedAttribute(description = "Number of traced messages in the backlog") 073 long getQueueSize(); 074 075 @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.") 076 int getBodyMaxChars(); 077 078 @ManagedAttribute(description = "Number of maximum chars in the message body in the trace message. Use zero or negative value to have unlimited size.") 079 void setBodyMaxChars(int bodyMaxChars); 080 081 @ManagedAttribute(description = "Whether to include stream based message body in the trace message.") 082 boolean isBodyIncludeStreams(); 083 084 @ManagedAttribute(description = "Whether to include stream based message body in the trace message.") 085 void setBodyIncludeStreams(boolean bodyIncludeStreams); 086 087 @ManagedAttribute(description = "Whether to include file based message body in the trace message.") 088 boolean isBodyIncludeFiles(); 089 090 @ManagedAttribute(description = "Whether to include file based message body in the trace message.") 091 void setBodyIncludeFiles(boolean bodyIncludeFiles); 092 093 @ManagedAttribute(description = "Whether to include exchange properties in the trace message.") 094 boolean isIncludeExchangeProperties(); 095 096 @ManagedAttribute(description = "Whether to include exchange properties in the trace message.") 097 void setIncludeExchangeProperties(boolean includeExchangeProperties); 098 099 @ManagedAttribute(description = "Whether to include exchange variables in the trace message.") 100 boolean isIncludeExchangeVariables(); 101 102 @ManagedAttribute(description = "Whether to include exchange variables in the trace message.") 103 void setIncludeExchangeVariables(boolean includeExchangeVariables); 104 105 @ManagedAttribute(description = "Whether tracing routes created from Rest DSL.") 106 boolean isTraceRests(); 107 108 @ManagedAttribute(description = "Whether tracing routes created from route templates or kamelets.") 109 boolean isTraceTemplates(); 110 111 @ManagedOperation(description = "Dumps the traced messages for the given node or route") 112 List<BacklogTracerEventMessage> dumpTracedMessages(String nodeOrRouteId); 113 114 @ManagedOperation(description = "Dumps the traced messages for the given node or route in xml format") 115 String dumpTracedMessagesAsXml(String nodeOrRouteId); 116 117 @ManagedOperation(description = "Dumps all the traced messages") 118 List<BacklogTracerEventMessage> dumpAllTracedMessages(); 119 120 @ManagedOperation(description = "Dumps all the traced messages in xml format") 121 String dumpAllTracedMessagesAsXml(); 122 123 @ManagedOperation(description = "Clears the backlog") 124 void clear(); 125 126}