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