|
| 1 | +/* |
| 2 | + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. |
| 3 | + * |
| 4 | + * WSO2 LLC. licenses this file to you under the Apache License, |
| 5 | + * Version 2.0 (the "License"); you may not use this file except |
| 6 | + * in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, |
| 12 | + * software distributed under the License is distributed on an |
| 13 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | + * KIND, either express or implied. See the License for the |
| 15 | + * specific language governing permissions and limitations |
| 16 | + * under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +package org.wso2.carbon.apimgt.api.model; |
| 20 | + |
| 21 | +import org.wso2.carbon.apimgt.api.APIManagementException; |
| 22 | + |
| 23 | + |
| 24 | +/** |
| 25 | + * This Interface is providing functionality of external gateway specific core operations. |
| 26 | + * You can implement deploy/undeploy API methods by implementing this interface. |
| 27 | + */ |
| 28 | +public interface GatewayDeployer { |
| 29 | + |
| 30 | + /** |
| 31 | + * Initialize the external gateway deployer |
| 32 | + * |
| 33 | + * @throws APIManagementException if error occurs when initializing the external gateway deployer |
| 34 | + */ |
| 35 | + void init(GatewayConfiguration configuration) throws APIManagementException; |
| 36 | + |
| 37 | + /** |
| 38 | + * This method returns the type of Gateway |
| 39 | + * @return gateway type |
| 40 | + */ |
| 41 | + String getType(); |
| 42 | + |
| 43 | + /** |
| 44 | + * Deploy API artifact to provided environment in the external gateway |
| 45 | + * |
| 46 | + * @param api API to be deployed into in the external gateway |
| 47 | + * @param externalReference reference artifact |
| 48 | + * @throws APIManagementException if error occurs when deploying APIs to in the external gateway |
| 49 | + */ |
| 50 | + String deploy(API api, String externalReference) throws APIManagementException; |
| 51 | + |
| 52 | + /** |
| 53 | + * Undeploy API artifact from provided environment |
| 54 | + * |
| 55 | + * @param externalReference reference artifact |
| 56 | + * @throws APIManagementException if error occurs when un-deploying APIs from external gateway |
| 57 | + */ |
| 58 | + boolean undeploy(String externalReference) throws APIManagementException; |
| 59 | + |
| 60 | + /** |
| 61 | + * This method returns the validation result of a given API with the external gateway |
| 62 | + * |
| 63 | + * @return List<String> validation result |
| 64 | + */ |
| 65 | + GatewayAPIValidationResult validateApi(API api) throws APIManagementException; |
| 66 | + |
| 67 | + /** |
| 68 | + * This method returns the resolved API execution URL by replacing all placeholders appropriately |
| 69 | + * |
| 70 | + * @return String api execution url |
| 71 | + */ |
| 72 | + String getAPIExecutionURL(String externalReference) throws APIManagementException; |
| 73 | + |
| 74 | + /** |
| 75 | + * This method returns refined API by manipulating the API object according to the external gateway requirements |
| 76 | + * |
| 77 | + * @return API api object |
| 78 | + */ |
| 79 | + void transformAPI(API api) throws APIManagementException; |
| 80 | +} |
0 commit comments