|
32 | 32 | import com.toshiba.mwcloud.gs.tools.webapi.dto.GWPutRowOutput; |
33 | 33 | import com.toshiba.mwcloud.gs.tools.webapi.dto.GWQueryOutput; |
34 | 34 | import com.toshiba.mwcloud.gs.tools.webapi.dto.GWQueryParams; |
| 35 | +import com.toshiba.mwcloud.gs.tools.webapi.dto.GWSQLInput; |
| 36 | +import com.toshiba.mwcloud.gs.tools.webapi.dto.GWSQLOutput; |
35 | 37 | import com.toshiba.mwcloud.gs.tools.webapi.dto.GWSortCondition; |
36 | 38 | import com.toshiba.mwcloud.gs.tools.webapi.dto.GWTQLInput; |
37 | 39 | import com.toshiba.mwcloud.gs.tools.webapi.dto.GWTQLOutput; |
@@ -265,4 +267,28 @@ public void deleteRows(String authorization, String cluster, String database, St |
265 | 267 | */ |
266 | 268 | public void createContainer(String authorization, String cluster, String database, GWContainerInfo gwContainerInfo) throws GSException; |
267 | 269 |
|
| 270 | + /** |
| 271 | + * Execute multiple SQLs. |
| 272 | + * |
| 273 | + * <br><br> |
| 274 | + * <b>Processing flow:</b> |
| 275 | + * <ol> |
| 276 | + * <li>Check authorization</li> |
| 277 | + * <li>Call function {@link GWUser#getUserfromAuthorization(String)} to get {@link GWUser} from authorization</li> |
| 278 | + * <li>Call function {@link GridStoreUtils#getGridStore(String, String, String, String)} to get the information of the target cluster</li> |
| 279 | + * <li>Call function checkAuthentication(GridStore) to check the authentication</li> |
| 280 | + * <li>If the size of {@code listSQLInput} is larger than the maximum of number of SQLs that can be executed, throw a {@link GWBadRequestException}</li> |
| 281 | + * <li>For each {@link GWSQLInput} in the {@code listSQLInput}, call function {@code executeSQL(String, String, String, String, GWSQLOutput)} to execute each SQL</li> |
| 282 | + * <li>Return a list of {@link GWSQLOutput}</li> |
| 283 | + * </ol> |
| 284 | + * @param authorization basic authentication |
| 285 | + * @param cluster name of cluster |
| 286 | + * @param database name of database |
| 287 | + * @param listSQLInput a {@link List} of {@link GWSQLInput} |
| 288 | + * @return a {@link List} of {@link GWSQLOutput} |
| 289 | + * @throws GSException internal server exception |
| 290 | + * @throws SQLException a {@link SQLException} |
| 291 | + * @throws UnsupportedEncodingException a {@link UnsupportedEncodingException} |
| 292 | + */ |
| 293 | + public List<GWSQLOutput> executeSQLs(String authorization, String cluster, String database, List<GWSQLInput> listSQLInput) throws GSException, SQLException, UnsupportedEncodingException; |
268 | 294 | } |
0 commit comments