Search in sources :

Example 1 with GeneratorPluginInfo

use of org.eclipse.vorto.plugin.generator.GeneratorPluginInfo in project vorto by eclipse.

the class GeneratorMetaHandler method handleRequest.

@Override
public void handleRequest(InputStream input, OutputStream output, Context context) throws IOException {
    ApiGatewayRequest request = ApiGatewayRequest.createFromJson(input);
    GeneratorPluginInfo pluginInfo = GeneratorPluginInfoFactory.getInstance().getForPlugin(request.getPathParam("pluginkey"));
    if (pluginInfo == null) {
        ApiGatewayResponse response = ApiGatewayResponse.builder().setStatusCode(404).build();
        objectMapper.writeValue(output, response);
    } else {
        ApiGatewayResponse gatewayResponse = ApiGatewayResponse.builder().setStatusCode(200).setRawBody(objectMapper.writeValueAsString(pluginInfo)).build();
        objectMapper.writeValue(output, gatewayResponse);
    }
}
Also used : GeneratorPluginInfo(org.eclipse.vorto.plugin.generator.GeneratorPluginInfo) ApiGatewayResponse(org.eclipse.vorto.plugin.utils.ApiGatewayResponse) ApiGatewayRequest(org.eclipse.vorto.plugin.utils.ApiGatewayRequest)

Aggregations

GeneratorPluginInfo (org.eclipse.vorto.plugin.generator.GeneratorPluginInfo)1 ApiGatewayRequest (org.eclipse.vorto.plugin.utils.ApiGatewayRequest)1 ApiGatewayResponse (org.eclipse.vorto.plugin.utils.ApiGatewayResponse)1