Class PluginsUpdateStepResult

  • All Implemented Interfaces:
    Serializable

    public final class PluginsUpdateStepResult
    extends Object
    implements Serializable
    Represents the result of an entire plugin update operation, which may have updated many plugins from different system and client scopes.
    Since:
    8.0.0
    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Method Detail

      • getError

        public Throwable getError()
        Gets the cause of the failure when the update was unsuccessful. This may return null when there is no known cause.
        Returns:
        When not successful, the cause of the failure, if known.
      • getRequestedScopes

        public Set<WorkspaceScope> getRequestedScopes()
        Gets the scopes for which a plugin update was requested.
        Returns:
        All scopes for which an update was requested.
      • getScopedResults

        public Map<WorkspaceScope,​ScopedPluginUpdateResult> getScopedResults()
        Gets the map from each scope to the result of the plugin update for that scope. Note that not all requested scopes might be present in this map.
        Returns:
        Map from each scope the result of that scope.
      • isSuccess

        public boolean isSuccess()
        Gets whether the plugin update step was successful. Note that this only returns false when the update step failed in its entirety. Even when this returns true, individual scope results may be unsuccessful.
        Returns:
        Whether the update step was successful.
      • empty

        public static PluginsUpdateStepResult empty()
        Gets an empty successful with no scopes and no results.
        Returns:
        An update result with no scopes and no results.
      • forFailure

        public static PluginsUpdateStepResult forFailure​(Set<WorkspaceScope> requestedScopes,
                                                         Throwable error)
        Creates a new result for a failed plugin update step. This should only be used when the entire update operation failed, not when a single plugin failed to update.
        Parameters:
        requestedScopes - All scopes for which an update was requested.
        error - Cause of the failure.
        Returns:
        A new result for a failed plugin update step.
      • forSuccess

        public static PluginsUpdateStepResult forSuccess​(Set<WorkspaceScope> requestedScopes,
                                                         Map<WorkspaceScope,​ScopedPluginUpdateResult> scopedResults)
        Creates a new result for a successful plugin update step.
        Parameters:
        requestedScopes - All scopes for which an update was requested.
        scopedResults - A map between each scope and the result for that scope.
        Returns:
        A new result for a successful plugin update step.