Interface WorkflowSharingManager<O extends Options>

Type Parameters:
O - the type of Options used to represent sharing configurations.

public interface WorkflowSharingManager<O extends Options>
Interface for managing sharing settings of workflows in the application.

Implementations of this interface are responsible for handling retrieval, modification, and persistence of workflow sharing configurations.

This interface acts primarily as a type indicator.

Since:
API 4.202520 (Geneious 2025.2.0)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Placeholder ID used when a workflow has not yet been assigned a permanent ID.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all internal state and cached sharing settings.
    Retrieves a summary of the current access control settings for the specified workflow.
    getEditableOptions(String workflowId, String workflowName)
    Retrieves a mutable copy of the current sharing options for the specified workflow.
    Returns a summary of the current sharing state for the specified workflow.
    boolean
    Determines whether sharing functionality is currently available.
    void
    Resets any changes to the workflow's sharing settings back to their original state.
    void
    saveSharing(O sharingOptions)
    Caches the specified sharing options locally.
    void
    Persists the current workflow's sharing settings to the server, if they have been changed.
  • Field Details

    • WORKFLOW_ID_PLACE_HOLDER

      static final String WORKFLOW_ID_PLACE_HOLDER
      Placeholder ID used when a workflow has not yet been assigned a permanent ID. Used for workflows that are being created but not saved to the cloud yet.
      See Also:
  • Method Details

    • getEditableOptions

      O getEditableOptions(String workflowId, String workflowName)
      Retrieves a mutable copy of the current sharing options for the specified workflow. This allows clients to view or modify sharing settings before saving.
      Parameters:
      workflowId - the unique ID of the workflow (cloud or local)
      workflowName - the name of the workflow, used in display or metadata
      Returns:
      an editable instance of the sharing options object
    • isCloudAvailable

      boolean isCloudAvailable()
      Determines whether sharing functionality is currently available. This depends on the user being logged in or connected to the associated service.
      Returns:
      true if sharing is currently supported, false otherwise
    • clearEverything

      void clearEverything()
      Clears all internal state and cached sharing settings. Typically used after settings are saved or discarded.
    • resetSharingToOriginal

      void resetSharingToOriginal(String workflowId)
      Resets any changes to the workflow's sharing settings back to their original state.
      Parameters:
      workflowId - the ID of the workflow to reset
    • saveSharing

      void saveSharing(O sharingOptions)
      Caches the specified sharing options locally. Use this method after modifying sharing settings via getEditableOptions(String, String). Note: This does not persist changes to the server.
      Parameters:
      sharingOptions - the modified sharing options to store
    • saveSharingSettingsToServer

      void saveSharingSettingsToServer(String workflowId)
      Persists the current workflow's sharing settings to the server, if they have been changed. This method may perform network requests

      This method ensures that sharing permissions (organization, groups, users) configured via getEditableOptions(String, String) are saved remotely. If no changes have been made since the last fetch or save, no request is sent.

      If the workflow has not been assigned a cloud ID yet (i.e., only a placeholder ID is available for a new Workflow), the method will attempt to map it to the real ID before saving. If this mapping fails, the save is aborted.

      Parameters:
      workflowId - the ID of the workflow to update
    • fetchAccessControls

      SharingSummary fetchAccessControls(String workflowId)
      Retrieves a summary of the current access control settings for the specified workflow.

      This method fetches the sharing information from the persisted storage and returns a SharingSummary that indicates whether the workflow is shared with the organization, groups, and/or individual users.

      If the sharing information cannot be retrieved (for example, due to a network error), this method returns null.

      Parameters:
      workflowId - the unique identifier of the workflow for which to fetch sharing information
      Returns:
      a SharingSummary summarizing the current sharing state, or null if retrieval fails
    • getSharingSummary

      SharingSummary getSharingSummary(String workflowId)
      Returns a summary of the current sharing state for the specified workflow.

      This method provides access to the latest known SharingSummary for the given workflow. Returns the cached sharing information for the workflow. This may differ from what's in the persisted storage if the user has not yet called saveSharingSettingsToServer(String)

      In contrast, fetchAccessControls(String) always triggers a new retrieval of sharing information from the server. Use fetchAccessControls when the sharing information is required.

      Parameters:
      workflowId - the ID of the workflow for which to retrieve sharing summary data
      Returns:
      a SharingSummary describing the current or cached sharing configuration.