class DefaultAppScaleManager implements AppScaleManager {

    static Optional<AutoScalePolicyException> extractAutoScalePolicyException(Throwable exception) {
        Throwable e = exception;

        while (e != null) {
            if (AutoScalePolicyException.class.isAssignableFrom(e.getClass())) {
                return Optional.of((AutoScalePolicyException) e);
            }
            e = e.getCause();
        }

        return Optional.empty();
    }

    @Inject public  DefaultAppScaleManager(AppScalePolicyStore appScalePolicyStore, CloudAlarmClient cloudAlarmClient,
                                  AppAutoScalingClient applicationAutoScalingClient,
                                  V3JobOperations v3JobOperations,
                                  Registry registry,
                                  AppScaleManagerConfiguration appScaleManagerConfiguration,
                                  TitusRuntime titusRuntime);
    private  DefaultAppScaleManager(AppScalePolicyStore appScalePolicyStore, CloudAlarmClient cloudAlarmClient,
                                   AppAutoScalingClient applicationAutoScalingClient,
                                   V3JobOperations v3JobOperations,
                                   Registry registry,
                                   AppScaleManagerConfiguration appScaleManagerConfiguration,
                                   ExecutorService awsInteractionExecutor,
                                   TitusRuntime titusRuntime);
    @VisibleForTesting public  DefaultAppScaleManager(AppScalePolicyStore appScalePolicyStore, CloudAlarmClient cloudAlarmClient,
                                  AppAutoScalingClient applicationAutoScalingClient,
                                  V3JobOperations v3JobOperations,
                                  Registry registry,
                                  AppScaleManagerConfiguration appScaleManagerConfiguration,
                                  Scheduler awsInteractionScheduler,
                                  TitusRuntime titusRuntime);

}