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