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 ManagedSupervisingRouteControllerMBean extends ManagedRouteControllerMBean {
027
028    @ManagedAttribute(description = "Whether supervising is enabled")
029    boolean isEnabled();
030
031    @ManagedAttribute(description = "The number of threads used by the scheduled thread pool that are used for restarting routes")
032    int getThreadPoolSize();
033
034    @ManagedAttribute(description = "Initial delay in milli seconds before the route controller starts")
035    long getInitialDelay();
036
037    @ManagedAttribute(description = "Backoff delay in millis when restarting a route that failed to startup")
038    long getBackOffDelay();
039
040    @ManagedAttribute(description = "Backoff maximum delay in millis when restarting a route that failed to startup")
041    long getBackOffMaxDelay();
042
043    @ManagedAttribute(description = "Backoff maximum elapsed time in millis, after which the backoff should be considered exhausted and no more attempts should be made")
044    long getBackOffMaxElapsedTime();
045
046    @ManagedAttribute(description = "Backoff maximum number of attempts to restart a route that failed to startup")
047    long getBackOffMaxAttempts();
048
049    @ManagedAttribute(description = "Backoff multiplier to use for exponential backoff")
050    double getBackOffMultiplier();
051
052    @ManagedAttribute(description = "Pattern for filtering routes to be included as supervised")
053    String getIncludeRoutes();
054
055    @ManagedAttribute(description = "Pattern for filtering routes to be excluded as supervised")
056    String getExcludeRoutes();
057
058    @ManagedAttribute(description = "Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up.")
059    boolean isUnhealthyOnExhausted();
060
061    @ManagedAttribute(description = "Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff)")
062    boolean isUnhealthyOnRestarting();
063
064    @ManagedAttribute(description = "Number of routes controlled by the controller")
065    int getNumberOfControlledRoutes();
066
067    @ManagedAttribute(description = "Number of routes which have failed to startup and are currently managed to be restarted")
068    int getNumberOfRestartingRoutes();
069
070    @ManagedAttribute(description = "Number of routes which have failed all attempts to startup and are now exhausted")
071    int getNumberOfExhaustedRoutes();
072
073    @ManagedAttribute(description = "Exhausted routes")
074    Collection<String> getExhaustedRoutes();
075
076    @ManagedAttribute(description = "Routes that are restarting or scheduled to restart")
077    Collection<String> getRestartingRoutes();
078
079    @ManagedOperation(description = "Lists detailed status about all the routes (incl failure details for routes failed to start)")
080    TabularData routeStatus(boolean exhausted, boolean restarting, boolean includeStacktrace);
081
082    @ManagedOperation(description = "Starts all routes")
083    void startRoutes();
084
085}