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 org.apache.camel.api.management.ManagedAttribute;
020import org.apache.camel.api.management.ManagedOperation;
021
022public interface ManagedRouteMBean extends ManagedPerformanceCounterMBean {
023
024    @ManagedAttribute(description = "Route ID")
025    String getRouteId();
026
027    @ManagedAttribute(description = "Route Description")
028    String getDescription();
029
030    @ManagedAttribute(description = "Route Endpoint URI", mask = true)
031    String getEndpointUri();
032
033    @ManagedAttribute(description = "Route State")
034    String getState();
035
036    @ManagedAttribute(description = "Route Uptime")
037    String getUptime();
038
039    /**
040     * @deprecated use {@link #getExchangesInflight()}
041     */
042    @ManagedAttribute(description = "Current number of inflight Exchanges")
043    @Deprecated
044    Integer getInflightExchanges();
045
046    @ManagedAttribute(description = "Camel ID")
047    String getCamelId();
048
049    @ManagedAttribute(description = "Camel ManagementName")
050    String getCamelManagementName();
051
052    @ManagedAttribute(description = "Tracing")
053    Boolean getTracing();
054
055    @ManagedAttribute(description = "Tracing")
056    void setTracing(Boolean tracing);
057
058    @ManagedAttribute(description = "Message History")
059    Boolean getMessageHistory();
060
061    @ManagedAttribute(description = "Route Policy List")
062    String getRoutePolicyList();
063
064    @ManagedAttribute(description = "Average load over the last minute")
065    String getLoad01();
066
067    @ManagedAttribute(description = "Average load over the last five minutes")
068    String getLoad05();
069
070    @ManagedAttribute(description = "Average load over the last fifteen minutes")
071    String getLoad15();
072
073    @ManagedOperation(description = "Start route")
074    void start() throws Exception;
075
076    @ManagedOperation(description = "Stop route")
077    void stop() throws Exception;
078
079    @ManagedOperation(description = "Stop route (using timeout in seconds)")
080    void stop(long timeout) throws Exception;
081
082    @ManagedOperation(description = "Stop route, abort stop after timeout (in seconds)")
083    boolean stop(Long timeout, Boolean abortAfterTimeout) throws Exception;
084
085    /**
086     * @deprecated will be removed in the near future. Use stop and remove instead
087     */
088    @ManagedOperation(description = "Shutdown route")
089    @Deprecated
090    void shutdown() throws Exception;
091
092    /**
093     * @deprecated will be removed in the near future. Use stop and remove instead
094     */
095    @ManagedOperation(description = "Shutdown route (using timeout in seconds)")
096    @Deprecated
097    void shutdown(long timeout) throws Exception;
098
099    @ManagedOperation(description = "Remove route (must be stopped)")
100    boolean remove() throws Exception;
101
102    @ManagedOperation(description = "Dumps the route as XML")
103    String dumpRouteAsXml() throws Exception;
104
105    @ManagedOperation(description = "Dumps the route as XML")
106    String dumpRouteAsXml(boolean resolvePlaceholders) throws Exception;
107
108    @ManagedOperation(description = "Updates the route from XML")
109    void updateRouteFromXml(String xml) throws Exception;
110
111    @ManagedOperation(description = "Dumps the routes stats as XML")
112    String dumpRouteStatsAsXml(boolean fullStats, boolean includeProcessors) throws Exception;
113
114    @ManagedOperation(description = "Reset counters")
115    void reset(boolean includeProcessors) throws Exception;
116
117    @ManagedOperation(description = "Returns the JSON representation of all the static and dynamic endpoints defined in this route")
118    String createRouteStaticEndpointJson();
119
120    @ManagedOperation(description = "Returns the JSON representation of all the static endpoints (and possible dynamic) defined in this route")
121    String createRouteStaticEndpointJson(boolean includeDynamic);
122
123    @ManagedAttribute(description = "Oldest inflight exchange duration")
124    Long getOldestInflightDuration();
125
126    @ManagedAttribute(description = "Oldest inflight exchange id")
127    String getOldestInflightExchangeId();
128
129
130}