package eu.dnetlib.espas.sosservice.cxs;

/***
 Enumeration of possible phases of job execution
 */
@SuppressWarnings("UnusedDeclaration")
public enum ExecutionPhase {
    /***
     The first phase a job is entered into - this is where a job is being set up but no request to run has occurred.
     */
    PENDING("PENDING"),
    /***
     An job has been accepted for execution but is waiting in a queue
     */
    QUEUED("QUEUED"),
    /***
     An job is running
     */
    EXECUTING("EXECUTING"),
    /***
     An job has completed successfully
     */
    COMPLETED("COMPLETED"),
    /***
     Some form of error has occurred
     */
    ERROR("ERROR"),
    /***
     The job is in an unknown state.
     */
    UNKNOWN("UNKNOWN"),
    /***
     The job is HELD pending execution and will not automatically be executed - can occur after a PHASE=RUN request has been made (cf PENDING).
     */
    HELD("HELD"),
    /***
     The job has been suspended by the system during execution
     */
    SUSPENDED("SUSPENDED"),
    /***
     The job has been aborted, either by user request or by the server because of lack or overuse of resources.
     */
    ABORTED("ABORTED");

    private String name;

    ExecutionPhase(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return this.name;
    }
}
