class DefaultAppScaleManager implements AppScaleManager {

    @Override
    public Observable<String> createAutoScalingPolicy(AutoScalingPolicy autoScalingPolicy) {
        if (autoScalingPolicy.getJobId() == null || autoScalingPolicy.getPolicyConfiguration() == null) {
            return Observable.error(AutoScalePolicyException.invalidScalingPolicy(autoScalingPolicy.getRefId(),
                    String.format("JobID Or PolicyConfiguration missing for %s", autoScalingPolicy.getRefId())));
        }

        return appScalePolicyStore.storePolicy(autoScalingPolicy)
                .map(policyRefId -> {
                    addScalableTargetIfNew(autoScalingPolicy.getJobId());
                    AutoScalingPolicy newPolicy = AutoScalingPolicy.newBuilder().withAutoScalingPolicy(autoScalingPolicy).withRefId(policyRefId).build();
                    sendCreatePolicyAction(newPolicy);
                    metrics.reportPolicyStatusTransition(newPolicy, PolicyStatus.Pending);
                    return policyRefId;
                });
    }

    @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);

}