Class BackgroundProcessInfo

java.lang.Object
com.jalios.jstore.BasicStorable
com.jalios.jcms.Data
com.jalios.jcms.backgroundprocess.BackgroundProcessInfo
All Implemented Interfaces:
DBData, JcmsConstants, ImportConstants, MashupConstants, Storable, JaliosConstants, LangPropertyArgument, Serializable, Cloneable, Comparable<BasicStorable>

public class BackgroundProcessInfo extends Data implements DBData
Since:
jcms-10.0.8 / JCMS-9179
See Also:
  • Constructor Details

    • BackgroundProcessInfo

      public BackgroundProcessInfo()
      Default constructor.

      Inits uridLocation on current channel urid.

      Since:
      jcms-10.0.8
    • BackgroundProcessInfo

      public BackgroundProcessInfo(BackgroundProcessInfo other)
      Parameters:
      other - other instance to use
      Since:
      jcms-10.0.8
  • Method Details

    • canBeReadBy

      public boolean canBeReadBy(Member member, boolean searchInGroups, RightInfo rightInfo)
      Description copied from class: Data
      Checks if the specified member is authorized to read this Data.
      Overrides:
      canBeReadBy in class Data
      Parameters:
      member - the member to check (may be null for anonymous user)
      searchInGroups - set to true to check for read right authorization using Member's group(s).
      rightInfo - a RightInfo instance in which explanation of read right authorization acceptance or refusal will be indicated. Value is required and cannot be null.
      Returns:
      true if member is author, admin, or has backgroundprocess ACL.
      Since:
      jcms-10.0.8
    • isAuthor

      public boolean isAuthor(Member member)
      Check if given member is the process author
      Parameters:
      member - member to check
      Returns:
      true if member is author of the process
      Since:
      jcms-10.0.8
    • isCompleted

      public boolean isCompleted()
      Check if a completed status was specified by background process.
      Returns:
      true if completed status is specified, false otherwise.
      Since:
      jcms-10.0.8
    • getProgress

      public int getProgress()
      Retrieve the progress percentage of the corresponding BackgroundProcess
      Returns:
      a percentage value (from 0 to 100)
      Since:
      jcms-10.0.8
    • setProgress

      public void setProgress(Integer progress)
      Set the progress percentage of the corresponding BackgroundProcess
      Parameters:
      progress - a percentage value (from 0 to 100)
      Since:
      jcms-10.0.8
    • hasProgression

      public boolean hasProgression()
      Check if the corresponding BackgroundProcess has a positive progress
      Returns:
      true if process has a progression percentage
      Since:
      jcms-10.0.8
    • getLabelProp

      public String getLabelProp()
      Retrieve the I18N property key to use to provide the I18Ned label of the corresponding BackgroundProcess to the user.
      Returns:
      a property
      Since:
      jcms-10.0.8
    • setLabelProp

      public void setLabelProp(String prop)
      Set the I18N property key to use to provide the I18Ned label of the corresponding BackgroundProcess to the user.
      Parameters:
      prop - a property key
      Since:
      jcms-10.0.8
    • getLabel

      public String getLabel(String lang)
      Retrieve an I18Ned label of this BackgroundProcess, in the specified language.
      Parameters:
      lang - an ISO-639 code
      Returns:
      a label suitable for prestation to the user
      Since:
      jcms-10.0.8
    • getCurrentStep

      public int getCurrentStep()
      Returns:
      current step
      Since:
      jcms-10.0.8
    • setCurrentStep

      public void setCurrentStep(Integer currentStep)
      Parameters:
      currentStep - current step to set
      Since:
      jcms-10.0.8
    • getTotalStep

      public int getTotalStep()
      Returns:
      the total step
      Since:
      jcms-10.0.8
    • setTotalStep

      public void setTotalStep(Integer totalStep)
      Parameters:
      totalStep - total step to set
      Since:
      jcms-10.0.8
    • getEllapsedTime

      public Long getEllapsedTime()
      Returns:
      ellapsed time in millis
      Since:
      jcms-10.0.8
    • getEllapsedFriendlyTime

      public String getEllapsedFriendlyTime(Locale locale)
      Parameters:
      locale - locale to use for localization
      Returns:
      ellapsed time, formated as localized duration
      Since:
      jcms-10.0.8
    • getRemainingTime

      public Long getRemainingTime()
      Returns:
      estimated remaining time in millis, never null
      Since:
      jcms-10.0.8
    • getRemainingFriendlyTime

      protected String getRemainingFriendlyTime(Locale locale)
      Parameters:
      locale - locale to use for localization
      Returns:
      estimated remaining, formated as localized duration
      Since:
      jcms-10.0.8
    • getNotify

      public boolean getNotify()
      Returns:
      true if completion must be notified
      Since:
      jcms-10.0.8
    • setNotify

      public void setNotify(Boolean notify)
      Parameters:
      notify - weither completion must be notified
      Since:
      jcms-10.0.8
    • getCompletedStatus

      public BackgroundProcess.Status getCompletedStatus()
      Returns:
      the completed status
      Since:
      jcms-10.0.8
    • setCompletedStatus

      public void setCompletedStatus(BackgroundProcess.Status completedStatus)
      Parameters:
      completedStatus - the completed status to set
      Since:
      jcms-10.0.8
    • isCompletedStatusOk

      public boolean isCompletedStatusOk()
      Returns:
      true if status is OK
      Since:
      jcms-10.0.8
    • isCompletedStatusWarn

      public boolean isCompletedStatusWarn()
      Returns:
      true if status is WARN
      Since:
      jcms-10.0.8
    • isCompletedStatusFailed

      public boolean isCompletedStatusFailed()
      Returns:
      true if status is FAILED
      Since:
      jcms-10.0.8
    • getCompletedMessage

      public String getCompletedMessage()
      Returns:
      the completedMessage or empty string
      Since:
      jcms-10.0.8
    • getCompletedMessage

      public String getCompletedMessage(String userLang)
      Parameters:
      userLang - user lang
      Returns:
      the completed message
      Since:
      jcms-10.0.8
    • getCompletedMessage

      public String getCompletedMessage(String userLang, boolean useDefault)
      Parameters:
      userLang - user lang
      useDefault - weither if an empty completedMessage should return the default completed message
      Returns:
      the completed message
      Since:
      jcms-10.0.8
    • setCompletedMessage

      public void setCompletedMessage(String completedMessage)
      Parameters:
      completedMessage - the completedMessage to set
      Since:
      jcms-10.0.8
    • getRunningMessage

      public String getRunningMessage()
      Returns:
      the runningMessage or empty string
      Since:
      jcms-10.0.8
    • setRunningMessage

      public void setRunningMessage(String runningMessage)
      Parameters:
      runningMessage - the runningMessage to set
      Since:
      jcms-10.0.8
    • getDetailsMessage

      public String getDetailsMessage()
      Returns:
      the optionnal details message string
    • setDetailsMessage

      public void setDetailsMessage(String detailsMessage)
      Parameters:
      detailsMessage - the detailsMessage to set
      Since:
      jcms-10.0.8
    • getDomain

      public String getDomain()
      Returns:
      the domain
      Since:
      jcms-10.0.8
    • setDomain

      public void setDomain(String domain)
      Parameters:
      domain - the domain to set
      Since:
      jcms-10.0.8
    • getUridLocation

      public String getUridLocation()
      Returns:
      urid where process takes place
      Since:
      jcms-10.0.8
    • setUridLocation

      public void setUridLocation(String uridLocation)
      Parameters:
      uridLocation - urid to set where process takes place
      Since:
      jcms-10.0.8
    • toString

      public String toString()
      Overrides:
      toString in class Data
    • toString

      public String toString(org.apache.commons.lang3.builder.ToStringStyle style)