Interface WorkflowSharingManager<O extends Options>
- Type Parameters:
O- the type ofOptionsused to represent sharing configurations.
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
FieldsModifier and TypeFieldDescriptionstatic final StringPlaceholder ID used when a workflow has not yet been assigned a permanent ID. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears all internal state and cached sharing settings.fetchAccessControls(String workflowId) 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.getSharingSummary(String workflowId) Returns a summary of the current sharing state for the specified workflow.booleanDetermines whether sharing functionality is currently available.voidresetSharingToOriginal(String workflowId) Resets any changes to the workflow's sharing settings back to their original state.voidsaveSharing(O sharingOptions) Caches the specified sharing options locally.voidsaveSharingSettingsToServer(String workflowId) Persists the current workflow's sharing settings to the server, if they have been changed.
-
Field Details
-
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
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:
trueif sharing is currently supported,falseotherwise
-
clearEverything
void clearEverything()Clears all internal state and cached sharing settings. Typically used after settings are saved or discarded. -
resetSharingToOriginal
Resets any changes to the workflow's sharing settings back to their original state.- Parameters:
workflowId- the ID of the workflow to reset
-
saveSharing
Caches the specified sharing options locally. Use this method after modifying sharing settings viagetEditableOptions(String, String). Note: This does not persist changes to the server.- Parameters:
sharingOptions- the modified sharing options to store
-
saveSharingSettingsToServer
Persists the current workflow's sharing settings to the server, if they have been changed. This method may perform network requestsThis 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
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
SharingSummarythat 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
SharingSummarysummarizing the current sharing state, ornullif retrieval fails
-
getSharingSummary
Returns a summary of the current sharing state for the specified workflow.This method provides access to the latest known
SharingSummaryfor 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 calledsaveSharingSettingsToServer(String)In contrast,
fetchAccessControls(String)always triggers a new retrieval of sharing information from the server. UsefetchAccessControlswhen the sharing information is required.- Parameters:
workflowId- the ID of the workflow for which to retrieve sharing summary data- Returns:
- a
SharingSummarydescribing the current or cached sharing configuration.
-