-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
- Loading branch information
1 parent
c5b7d72
commit 0d77699
Showing
9 changed files
with
201 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/main/java/org/opensearch/flowframework/transport/GetWorkflowRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
package org.opensearch.flowframework.transport; | ||
|
||
import org.opensearch.action.ActionRequest; | ||
import org.opensearch.action.ActionRequestValidationException; | ||
import org.opensearch.common.Nullable; | ||
import org.opensearch.core.common.io.stream.StreamInput; | ||
import org.opensearch.core.common.io.stream.StreamOutput; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Transport Request to get a workflow or workflow status | ||
*/ | ||
public class GetWorkflowRequest extends ActionRequest { | ||
|
||
/** | ||
* The documentId of the workflow entry within the Global Context index | ||
*/ | ||
@Nullable | ||
private String workflowId; | ||
|
||
/** | ||
* The all parameter on the get request | ||
*/ | ||
private boolean all; | ||
|
||
/** | ||
* Instantiates a new GetWorkflowRequest | ||
* @param workflowId the documentId of the workflow | ||
* @param all whether the get request is looking for all fields in status | ||
*/ | ||
public GetWorkflowRequest(@Nullable String workflowId, boolean all) { | ||
this.workflowId = workflowId; | ||
this.all = all; | ||
} | ||
|
||
/** | ||
* Instantiates a new GetWorkflowRequest request | ||
* @param in The input stream to read from | ||
* @throws IOException If the stream cannot be read properly | ||
*/ | ||
public GetWorkflowRequest(StreamInput in) throws IOException { | ||
super(in); | ||
this.workflowId = in.readString(); | ||
this.all = in.readBoolean(); | ||
} | ||
|
||
/** | ||
* Gets the workflow Id of the request | ||
* @return the workflow Id | ||
*/ | ||
@Nullable | ||
public String getWorkflowId() { | ||
return this.workflowId; | ||
} | ||
|
||
/** | ||
* Gets the value of the all parameter | ||
* @return whether the all parameter was present or not in request | ||
*/ | ||
public boolean getAll() { | ||
return this.all; | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
super.writeTo(out); | ||
out.writeString(workflowId); | ||
out.writeBoolean(all); | ||
} | ||
|
||
@Override | ||
public ActionRequestValidationException validate() { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.