Class OrchestratorManager
- java.lang.Object
-
- org.gcube.portal.social.networking.orchestrator.OrchestratorManager
-
public class OrchestratorManager extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddUserToGroup(String user, String group)Schedules the asynchronous addition of a user to a group by invoking the 'user-group_created' workflow.static OrchestratorManagergetInstance()Returns the singleton instance of the OrchestratorManager.Map<String,Object>getWorkflowStatus(String workflowId)Retrieves the status of a specific workflow from the Conductor server.StringremoveUserFromGroup(String user, String group)Schedules the asynchronous removal of a user from a group by invoking the 'user-group_deleted' workflow.
-
-
-
Method Detail
-
getInstance
public static OrchestratorManager getInstance()
Returns the singleton instance of the OrchestratorManager.- Returns:
- the singleton instance
-
addUserToGroup
public String addUserToGroup(String user, String group) throws Exception
Schedules the asynchronous addition of a user to a group by invoking the 'user-group_created' workflow. The success of this method indicates that the operation has been successfully scheduled, not that it has been executed.- Parameters:
user- The username to add.group- The group to add the user to.- Throws:
Exception- if scheduling the operation fails.
-
removeUserFromGroup
public String removeUserFromGroup(String user, String group) throws Exception
Schedules the asynchronous removal of a user from a group by invoking the 'user-group_deleted' workflow. The success of this method indicates that the operation has been successfully scheduled, not that it has been executed.- Parameters:
user- The username to remove.group- The group to remove the user from.- Throws:
Exception- if scheduling the operation fails.
-
getWorkflowStatus
public Map<String,Object> getWorkflowStatus(String workflowId) throws Exception
Retrieves the status of a specific workflow from the Conductor server.- Parameters:
workflowId- The ID of the workflow to retrieve.- Returns:
- A map representing the JSON response from the Conductor server.
- Throws:
Exception- if the API call fails.
-
-