Interface OperationStatus

  • All Superinterfaces:
    org.eclipse.core.runtime.IStatus

    public interface OperationStatus
    extends org.eclipse.core.runtime.IStatus
    Describes the execution state of the owning Operation.

    This interface is not intended to be implemented by clients.

    Since:
    3.5.1
    See Also:
    Operation.getStatus(), StatusWriter
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  OperationStatus.State
      Reflects the execution state of an Operation.
    • Field Summary

      • Fields inherited from interface org.eclipse.core.runtime.IStatus

        CANCEL, ERROR, INFO, OK, WARNING
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(org.eclipse.core.runtime.IStatus status)
      Adds the given child status to this parent status.
      OperationStatus addError​(String message, Throwable exception, org.eclipse.emf.ecore.EObject... relatedObjects)
      Creates a new status of severity ERROR as a child of this status.
      OperationStatus addError​(String message, org.eclipse.emf.ecore.EObject... relatedObjects)
      Creates a new status of severity ERROR as a child of this status.
      OperationStatus addInfo​(String message, org.eclipse.emf.ecore.EObject... relatedObjects)
      Creates a new status of severity INFO as a child of this status.
      OperationStatus addWarning​(String message, Throwable exception, org.eclipse.emf.ecore.EObject... relatedObjects)
      Creates a new status of severity WARNING as a child of this status.
      OperationStatus addWarning​(String message, org.eclipse.emf.ecore.EObject... relatedObjects)
      Creates a new status of severity WARNING as a child of this status.
      long getOperationDuration()
      Returns the duration in milliseconds of the owning Operation execution.
      long getOperationEnd()
      Returns the time in milliseconds at which the owning Operation execution has terminated.
      long getOperationStart()
      Returns the time in milliseconds at which the owning Operation execution has started.
      OperationStatus getParent()
      Returns the parent status which owns this status, if any.
      Collection<org.eclipse.emf.ecore.EObject> getRelatedObjects()
      Returns an unmodifiable list of related model elements.
      OperationStatus.State getState()
      Returns the execution state of the owning operation
      • Methods inherited from interface org.eclipse.core.runtime.IStatus

        getChildren, getCode, getException, getMessage, getPlugin, getSeverity, isMultiStatus, isOK, matches
    • Method Detail

      • getState

        OperationStatus.State getState()
        Returns the execution state of the owning operation
        Returns:
        the execution state.
      • getParent

        OperationStatus getParent()
        Returns the parent status which owns this status, if any.
        Returns:
        the parent status, or null if none.
      • getRelatedObjects

        Collection<org.eclipse.emf.ecore.EObject> getRelatedObjects()
        Returns an unmodifiable list of related model elements. The related model elements can be set when creating an instance of OperationStatus.
        Returns:
        an unmodifiable list of related model elements.
        Since:
        3.6.0
        See Also:
        addError(String, EObject...)
      • add

        void add​(org.eclipse.core.runtime.IStatus status)
        Adds the given child status to this parent status. This method might be called when running the owning Operation, to log additional information useful for a developer for post-execution analysis.
        Parameters:
        status - the new child status
        See Also:
        Operation.run(org.eclipse.core.runtime.IProgressMonitor)
      • addInfo

        OperationStatus addInfo​(String message,
                                org.eclipse.emf.ecore.EObject... relatedObjects)
        Creates a new status of severity INFO as a child of this status.

        Associating one or more related model elements enables to review problems by inspecting the model in the log generated on main operation completion, rather than navigating only in the execution flow.

        Parameters:
        message - the message associated with the status to create.
        relatedObjects - an optional list of related model elements.
        Returns:
        the created status.
        Since:
        3.6.0
      • addWarning

        OperationStatus addWarning​(String message,
                                   org.eclipse.emf.ecore.EObject... relatedObjects)
        Creates a new status of severity WARNING as a child of this status.

        Associating one or more related model elements enables to review problems by inspecting the model in the log generated on main operation completion, rather than navigating only in the execution flow.

        Parameters:
        message - the message associated with the status to create.
        relatedObjects - an optional list of related model elements.
        Returns:
        the created status.
        Since:
        3.6.0
      • addWarning

        OperationStatus addWarning​(String message,
                                   Throwable exception,
                                   org.eclipse.emf.ecore.EObject... relatedObjects)
        Creates a new status of severity WARNING as a child of this status.

        Associating one or more related model elements enables to review problems by inspecting the model in the log generated on main operation completion, rather than navigating only in the execution flow.

        Parameters:
        message - the message associated with the status to create.
        exception - the exception associated with the status to create.
        relatedObjects - an optional list of related model elements.
        Returns:
        the created status.
        Since:
        3.6.0
      • addError

        OperationStatus addError​(String message,
                                 org.eclipse.emf.ecore.EObject... relatedObjects)
        Creates a new status of severity ERROR as a child of this status.

        Associating one or more related model elements enables to review problems by inspecting the model in the log generated on main operation completion, rather than navigating only in the execution flow.

        Parameters:
        message - the message associated with the status to create.
        relatedObjects - an optional list of related model elements.
        Returns:
        the created status.
        Since:
        3.6.0
      • addError

        OperationStatus addError​(String message,
                                 Throwable exception,
                                 org.eclipse.emf.ecore.EObject... relatedObjects)
        Creates a new status of severity ERROR as a child of this status.

        Associating one or more related model elements enables to review problems by inspecting the model in the log generated on main operation completion, rather than navigating only in the execution flow.

        Parameters:
        message - the message associated with the status to create.
        exception - the exception associated with the status to create.
        relatedObjects - an optional list of related model elements.
        Returns:
        the created status.
        Since:
        3.6.0
      • getOperationStart

        long getOperationStart()
        Returns the time in milliseconds at which the owning Operation execution has started.
        Returns:
        the time in milliseconds at which the owning Operation execution has started, or 0 if the execution isn't started.
        See Also:
        System.currentTimeMillis()
      • getOperationEnd

        long getOperationEnd()
        Returns the time in milliseconds at which the owning Operation execution has terminated.
        Returns:
        the time in milliseconds at which the owning Operation execution has terminated, or 0 if the execution isn't terminated.
        See Also:
        System.currentTimeMillis()
      • getOperationDuration

        long getOperationDuration()
        Returns the duration in milliseconds of the owning Operation execution.
        Returns:
        the duration in milliseconds of the owning Operation execution.