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