All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.yadaframework.persistence.entity.YadaJobState Maven / Gradle / Ivy

There is a newer version: 0.7.7.R4
Show newest version
package net.yadaframework.persistence.entity;

import java.util.Locale;

import org.springframework.context.MessageSource;

import net.yadaframework.core.YadaLocalEnum;

/**
 * The localized state of a YadaJob:
 * 
    *
  • ACTIVE: the job is waiting to be run
  • *
  • RUNNING: the job is running
  • *
  • PAUSED: scheduling on this job has been paused (by the user) and the job should not run
  • *
  • COMPLETED: the job has completed its purpose and should not run again
  • *
  • DISABLED: the job has been disabled because of errors
  • *
* */ public enum YadaJobState implements YadaLocalEnum { // In messages.properties: // yada.jobstate.ACTIVE = Active // yada.jobstate.RUNNING = Running // yada.jobstate.PAUSED = Paused // yada.jobstate.COMPLETED = Completed // yada.jobstate.DISABLED = Disabled ACTIVE("yada.jobstate.ACTIVE"), RUNNING("yada.jobstate.RUNNING"), PAUSED("yada.jobstate.PAUSED"), COMPLETED("yada.jobstate.COMPLETED"), DISABLED("yada.jobstate.DISABLED"); private String messageKey; private YadaPersistentEnum yadaPersistentEnum; private YadaJobState(String messageKey) { this.messageKey = messageKey; } public YadaPersistentEnum toYadaPersistentEnum() { return yadaPersistentEnum; } // TODO fix generics public void setYadaPersistentEnum(YadaPersistentEnum yadaPersistentEnum) { this.yadaPersistentEnum = yadaPersistentEnum; } /** * Return the localized text for this enum * @param messageSource * @param locale * @return */ public String toString(MessageSource messageSource, Locale locale) { return messageSource.getMessage(messageKey, null, locale); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy