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 = "Is this route created from a route template (or Kamelet)")
038    boolean isCreatedByRouteTemplate();
039
040    @ManagedAttribute(description = "Is this route created from a Kamelet")
041    boolean isCreatedByKamelet();
042
043    @ManagedAttribute(description = "Route Properties")
044    TabularData getRouteProperties();
045
046    @ManagedAttribute(description = "Route Description")
047    String getDescription();
048
049    @ManagedAttribute(description = "Route Auto Startup")
050    Boolean getAutoStartup();
051
052    @ManagedAttribute(description = "Route Source Location")
053    String getSourceLocation();
054
055    @ManagedAttribute(description = "Route Source Location (Short)")
056    String getSourceLocationShort();
057
058    @ManagedAttribute(description = "Route Configuration ID")
059    String getRouteConfigurationId();
060
061    @ManagedAttribute(description = "Route Endpoint URI", mask = true)
062    String getEndpointUri();
063
064    @ManagedAttribute(description = "Route State")
065    String getState();
066
067    @ManagedAttribute(description = "Route Uptime [human readable text]")
068    String getUptime();
069
070    @ManagedAttribute(description = "Route Uptime [milliseconds]")
071    long getUptimeMillis();
072
073    @ManagedAttribute(description = "Camel ID")
074    String getCamelId();
075
076    @ManagedAttribute(description = "Camel ManagementName")
077    String getCamelManagementName();
078
079    @ManagedAttribute(description = "Tracing")
080    Boolean getTracing();
081
082    @ManagedAttribute(description = "Tracing")
083    void setTracing(Boolean tracing);
084
085    @ManagedAttribute(description = "Message History")
086    Boolean getMessageHistory();
087
088    @ManagedAttribute(description = "Whether security mask for Logging is enabled")
089    Boolean getLogMask();
090
091    @ManagedAttribute(description = "Route Policy List")
092    String getRoutePolicyList();
093
094    @ManagedAttribute(description = "Average load (inflight messages, not cpu) over the last minute")
095    String getLoad01();
096
097    @ManagedAttribute(description = "Average load (inflight messages, not cpu) over the last five minutes")
098    String getLoad05();
099
100    @ManagedAttribute(description = "Average load (inflight messages, not cpu) over the last fifteen minutes")
101    String getLoad15();
102
103    @ManagedAttribute(description = "Throughput message/second")
104    String getThroughput();
105
106    @ManagedOperation(description = "Start route")
107    void start() throws Exception;
108
109    @ManagedOperation(description = "Stop route")
110    void stop() throws Exception;
111
112    @ManagedOperation(description = "Stop and marks the route as failed (health-check reporting as DOWN)")
113    void stopAndFail() throws Exception;
114
115    @ManagedOperation(description = "Stop route (using timeout in seconds)")
116    void stop(long timeout) throws Exception;
117
118    @ManagedOperation(description = "Stop route, abort stop after timeout (in seconds)")
119    boolean stop(Long timeout, Boolean abortAfterTimeout) throws Exception;
120
121    @ManagedOperation(description = "Remove route (must be stopped)")
122    boolean remove() throws Exception;
123
124    @ManagedOperation(description = "Restarts route (1 second delay before starting)")
125    void restart() throws Exception;
126
127    @ManagedOperation(description = "Restarts route (using delay in seconds before starting)")
128    void restart(long delay) throws Exception;
129
130    @ManagedOperation(description = "Dumps the route as XML")
131    String dumpRouteAsXml() throws Exception;
132
133    @ManagedOperation(description = "Dumps the route as XML")
134    String dumpRouteAsXml(boolean resolvePlaceholders) throws Exception;
135
136    @ManagedOperation(description = "Dumps the route as XML")
137    String dumpRouteAsXml(boolean resolvePlaceholders, boolean generatedIds) throws Exception;
138
139    @ManagedOperation(description = "Dumps the route as YAML")
140    String dumpRouteAsYaml() throws Exception;
141
142    @ManagedOperation(description = "Dumps the route as YAML")
143    String dumpRouteAsYaml(boolean resolvePlaceholders) throws Exception;
144
145    @ManagedOperation(description = "Dumps the route as YAML")
146    String dumpRouteAsYaml(boolean resolvePlaceholders, boolean uriAsParameters) throws Exception;
147
148    @ManagedOperation(description = "Dumps the route as YAML")
149    String dumpRouteAsYaml(boolean resolvePlaceholders, boolean uriAsParameters, boolean generatedIds) throws Exception;
150
151    @ManagedOperation(description = "Dumps the route stats as XML")
152    String dumpRouteStatsAsXml(boolean fullStats, boolean includeProcessors) throws Exception;
153
154    @ManagedOperation(description = "Dumps the route stats as JSon")
155    String dumpRouteStatsAsJSon(boolean fullStats, boolean includeProcessors) throws Exception;
156
157    @ManagedOperation(description = "Dumps the route and steps stats as XML")
158    String dumpStepStatsAsXml(boolean fullStats) throws Exception;
159
160    @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")
161    String dumpRouteSourceLocationsAsXml() throws Exception;
162
163    @ManagedOperation(description = "Reset counters")
164    void reset(boolean includeProcessors) throws Exception;
165
166    @ManagedAttribute(description = "Oldest inflight exchange duration")
167    Long getOldestInflightDuration();
168
169    @ManagedAttribute(description = "Oldest inflight exchange id")
170    String getOldestInflightExchangeId();
171
172    @ManagedAttribute(description = "Is using route controller")
173    Boolean getHasRouteController();
174
175    @ManagedAttribute(description = "Last error")
176    RouteError getLastError();
177
178    @ManagedOperation(description = "IDs for the processors that are part of this route")
179    Collection<String> processorIds() throws Exception;
180
181    @ManagedOperation(description = "Updates the route from XML")
182    void updateRouteFromXml(String xml) throws Exception;
183
184    @ManagedAttribute(description = "Whether update route from XML is enabled")
185    boolean isUpdateRouteEnabled();
186
187    @ManagedAttribute(description = "Whether the consumer connects to remote or local systems")
188    boolean isRemoteEndpoint();
189
190}