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