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