-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added createComponent to Extension interface (#146)
* Added createComponent to Extension interface and created BaseExtension abstract class Signed-off-by: Ryan Bogan <[email protected]> * Fixed minor error Signed-off-by: Ryan Bogan <[email protected]> * Changed create component arguments Signed-off-by: Ryan Bogan <[email protected]> * Addressed PR Comments Signed-off-by: Ryan Bogan <[email protected]> * Fixed minor errors Signed-off-by: Ryan Bogan <[email protected]> * Return consumed params and content from extensions (#169) * Remove duplicate copies of registries in handlers Signed-off-by: Daniel Widdis <[email protected]> * Move ExtensionRestResponse to OpenSearch Signed-off-by: Daniel Widdis <[email protected]> * Add a POST request to parse content Signed-off-by: Daniel Widdis <[email protected]> * Add a DELETE request corresponding to the POST Signed-off-by: Daniel Widdis <[email protected]> * Add consumed params and content to Extension Responses Signed-off-by: Daniel Widdis <[email protected]> * Update tests and OpenAPI spec Signed-off-by: Daniel Widdis <[email protected]> Signed-off-by: Daniel Widdis <[email protected]> * Fixed minor errors Signed-off-by: Ryan Bogan <[email protected]> * Addressed PR Comments Signed-off-by: Ryan Bogan <[email protected]> Signed-off-by: Ryan Bogan <[email protected]> Signed-off-by: Daniel Widdis <[email protected]> Co-authored-by: Daniel Widdis <[email protected]>
- Loading branch information
Showing
8 changed files
with
90 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* 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.sdk; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.opensearch.cluster.service.ClusterService; | ||
import org.opensearch.threadpool.ThreadPool; | ||
|
||
/** | ||
* An abstract class that provides sample methods required by extensions | ||
*/ | ||
public abstract class BaseExtension implements Extension { | ||
/** | ||
* A client to make requests to the system | ||
*/ | ||
protected SDKClient client; | ||
|
||
/** | ||
* A service to allow watching and updating cluster state | ||
*/ | ||
protected ClusterService clusterService; | ||
|
||
/** | ||
* A service to allow retrieving an executor to run an async action | ||
*/ | ||
protected ThreadPool threadPool; | ||
|
||
/** | ||
* Empty constructor to fulfill abstract class requirements | ||
*/ | ||
protected BaseExtension() { | ||
|
||
} | ||
|
||
/** | ||
* Returns components added by this extension. | ||
* | ||
* @param client A client to make requests to the system | ||
* @param clusterService A service to allow watching and updating cluster state | ||
* @param threadPool A service to allow retrieving an executor to run an async action | ||
* @return A collection of objects | ||
*/ | ||
public Collection<Object> createComponents(SDKClient client, ClusterService clusterService, ThreadPool threadPool) { | ||
this.client = client; | ||
this.clusterService = clusterService; | ||
this.threadPool = threadPool; | ||
|
||
return Collections.emptyList(); | ||
} | ||
} |
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
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