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.Experimental;
020import org.apache.camel.api.management.ManagedAttribute;
021import org.apache.camel.api.management.ManagedOperation;
022import org.apache.camel.spi.RouteError;
023
024public interface ManagedRouteMBean extends ManagedPerformanceCounterMBean {
025
026    @ManagedAttribute(description = "Route ID")
027    String getRouteId();
028
029    @ManagedAttribute(description = "Route Description")
030    String getDescription();
031
032    @ManagedAttribute(description = "Route Endpoint URI", mask = true)
033    String getEndpointUri();
034
035    @ManagedAttribute(description = "Route State")
036    String getState();
037
038    @ManagedAttribute(description = "Route Uptime [human readable text]")
039    String getUptime();
040
041    @ManagedAttribute(description = "Route Uptime [milliseconds]")
042    long getUptimeMillis();
043
044    /**
045     * @deprecated use {@link #getExchangesInflight()}
046     */
047    @ManagedAttribute(description = "Current number of inflight Exchanges")
048    @Deprecated
049    Integer getInflightExchanges();
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 = "Dumps the route as XML")
108    String dumpRouteAsXml() throws Exception;
109
110    @ManagedOperation(description = "Dumps the route as XML")
111    String dumpRouteAsXml(boolean resolvePlaceholders) throws Exception;
112
113    @ManagedOperation(description = "Updates the route from XML")
114    void updateRouteFromXml(String xml) throws Exception;
115
116    @ManagedOperation(description = "Dumps the routes stats as XML")
117    String dumpRouteStatsAsXml(boolean fullStats, boolean includeProcessors) throws Exception;
118
119    @ManagedOperation(description = "Reset counters")
120    void reset(boolean includeProcessors) throws Exception;
121
122    @ManagedOperation(description = "Returns the JSON representation of all the static and dynamic endpoints defined in this route")
123    String createRouteStaticEndpointJson();
124
125    @ManagedOperation(description = "Returns the JSON representation of all the static endpoints (and possible dynamic) defined in this route")
126    String createRouteStaticEndpointJson(boolean includeDynamic);
127
128    @ManagedAttribute(description = "Oldest inflight exchange duration")
129    Long getOldestInflightDuration();
130
131    @ManagedAttribute(description = "Oldest inflight exchange id")
132    String getOldestInflightExchangeId();
133
134    @Experimental
135    @ManagedAttribute(description = "Route controller")
136    Boolean getHasRouteController();
137
138    @Experimental
139    @ManagedAttribute(description = "Last error")
140    RouteError getLastError();
141}