package com.sequenceiq.periscope.api.model;

import static com.google.common.collect.Sets.immutableEnumSet;

import java.util.Set;

public enum ActivityStatus {
    ACTIVITY_PENDING,
    METRICS_COLLECTION_SUCCESS,
    METRICS_COLLECTION_FAILED,

    MANDATORY_UPSCALE,
    MANDATORY_DOWNSCALE,

    SCHEDULE_BASED_UPSCALE,
    SCHEDULE_BASED_DOWNSCALE,

    UPSCALE_TRIGGER_SUCCESS,
    UPSCALE_TRIGGER_FAILED,

    DOWNSCALE_TRIGGER_SUCCESS,
    DOWNSCALE_TRIGGER_FAILED,

    SCALING_FLOW_IN_PROGRESS,
    SCALING_FLOW_SUCCESS,
    SCALING_FLOW_FAILED,
    UNKNOWN;

    public static Set<ActivityStatus> getStatusesApplicableForCleanup() {
        return immutableEnumSet(SCALING_FLOW_FAILED, SCALING_FLOW_SUCCESS, METRICS_COLLECTION_FAILED, UPSCALE_TRIGGER_FAILED,
                DOWNSCALE_TRIGGER_FAILED, MANDATORY_UPSCALE, MANDATORY_DOWNSCALE, UNKNOWN);
    }
}
