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.Collection;
020
021import javax.management.openmbean.TabularData;
022
023import org.apache.camel.api.management.ManagedAttribute;
024import org.apache.camel.api.management.ManagedOperation;
025
026public interface ManagedRouteMBean extends ManagedPerformanceCounterMBean {
027
028    @ManagedAttribute(description = "Route ID")
029    String getRouteId();
030
031    @ManagedAttribute(description = "Node Prefix ID")
032    String getNodePrefixId();
033
034    @ManagedAttribute(description = "Route Group")
035    String getRouteGroup();
036
037    @ManagedAttribute(description = "Route Properties")
038    TabularData getRouteProperties();
039
040    @ManagedAttribute(description = "Route Description")
041    String getDescription();
042
043    @ManagedAttribute(description = "Route Source Location")
044    String getSourceLocation();
045
046    @ManagedAttribute(description = "Route Source Location (Short)")
047    String getSourceLocationShort();
048
049    @ManagedAttribute(description = "Route Configuration ID")
050    String getRouteConfigurationId();
051
052    @ManagedAttribute(description = "Route Endpoint URI", mask = true)
053    String getEndpointUri();
054
055    @ManagedAttribute(description = "Route State")
056    String getState();
057
058    @ManagedAttribute(description = "Route Uptime [human readable text]")
059    String getUptime();
060
061    @ManagedAttribute(description = "Route Uptime [milliseconds]")
062    long getUptimeMillis();
063
064    @ManagedAttribute(description = "Camel ID")
065    String getCamelId();
066
067    @ManagedAttribute(description = "Camel ManagementName")
068    String getCamelManagementName();
069
070    @ManagedAttribute(description = "Tracing")
071    Boolean getTracing();
072
073    @ManagedAttribute(description = "Tracing")
074    void setTracing(Boolean tracing);
075
076    @ManagedAttribute(description = "Message History")
077    Boolean getMessageHistory();
078
079    @ManagedAttribute(description = "Whether security mask for Logging is enabled")
080    Boolean getLogMask();
081
082    @ManagedAttribute(description = "Route Policy List")
083    String getRoutePolicyList();
084
085    @ManagedAttribute(description = "Average load over the last minute")
086    String getLoad01();
087
088    @ManagedAttribute(description = "Average load over the last five minutes")
089    String getLoad05();
090
091    @ManagedAttribute(description = "Average load over the last fifteen minutes")
092    String getLoad15();
093
094    @ManagedAttribute(description = "Throughput message/second")
095    String getThroughput();
096
097    @ManagedOperation(description = "Start route")
098    void start() throws Exception;
099
100    @ManagedOperation(description = "Stop route")
101    void stop() throws Exception;
102
103    @ManagedOperation(description = "Stop and marks the route as failed (health-check reporting as DOWN)")
104    void stopAndFail() throws Exception;
105
106    @ManagedOperation(description = "Stop route (using timeout in seconds)")
107    void stop(long timeout) throws Exception;
108
109    @ManagedOperation(description = "Stop route, abort stop after timeout (in seconds)")
110    boolean stop(Long timeout, Boolean abortAfterTimeout) 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 = "Dumps the route as XML")
128    String dumpRouteAsXml(boolean resolvePlaceholders, boolean generatedIds) throws Exception;
129
130    @ManagedOperation(description = "Dumps the route as YAML")
131    String dumpRouteAsYaml() throws Exception;
132
133    @ManagedOperation(description = "Dumps the route as YAML")
134    String dumpRouteAsYaml(boolean resolvePlaceholders) throws Exception;
135
136    @ManagedOperation(description = "Dumps the route as YAML")
137    String dumpRouteAsYaml(boolean resolvePlaceholders, boolean uriAsParameters) throws Exception;
138
139    @ManagedOperation(description = "Dumps the route as YAML")
140    String dumpRouteAsYaml(boolean resolvePlaceholders, boolean uriAsParameters, boolean generatedIds) throws Exception;
141
142    @ManagedOperation(description = "Dumps the route stats as XML")
143    String dumpRouteStatsAsXml(boolean fullStats, boolean includeProcessors) throws Exception;
144
145    @ManagedOperation(description = "Dumps the route and steps stats as XML")
146    String dumpStepStatsAsXml(boolean fullStats) throws Exception;
147
148    @ManagedOperation(description = "Dumps the route with mappings between node ids and their source location/line-number (currently only XML and YAML routes supported) as XML")
149    String dumpRouteSourceLocationsAsXml() throws Exception;
150
151    @ManagedOperation(description = "Reset counters")
152    void reset(boolean includeProcessors) throws Exception;
153
154    @ManagedAttribute(description = "Oldest inflight exchange duration")
155    Long getOldestInflightDuration();
156
157    @ManagedAttribute(description = "Oldest inflight exchange id")
158    String getOldestInflightExchangeId();
159
160    @ManagedAttribute(description = "Is using route controller")
161    Boolean getHasRouteController();
162
163    @ManagedAttribute(description = "Last error")
164    RouteError getLastError();
165
166    @ManagedOperation(description = "IDs for the processors that are part of this route")
167    Collection<String> processorIds() throws Exception;
168}