Class BackgroundProcessInfo

    • Constructor Detail

      • 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 Detail

      • 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​(java.lang.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 java.lang.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​(java.lang.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 java.lang.String getLabel​(java.lang.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​(java.lang.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​(java.lang.Integer totalStep)
        Parameters:
        totalStep - total step to set
        Since:
        jcms-10.0.8
      • getEllapsedTime

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

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

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

        protected java.lang.String getRemainingFriendlyTime​(java.util.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​(java.lang.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 java.lang.String getCompletedMessage()
        Returns:
        the completedMessage or empty string
        Since:
        jcms-10.0.8
      • getCompletedMessage

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

        public java.lang.String getCompletedMessage​(java.lang.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​(java.lang.String completedMessage)
        Parameters:
        completedMessage - the completedMessage to set
        Since:
        jcms-10.0.8
      • getRunningMessage

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

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

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

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

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

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

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

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

        public java.lang.String toString()
        Overrides:
        toString in class Data
      • toString

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