if (cloudControllerServiceClient != null) {
CartridgeConfig cartridgeConfig = PojoConverter.populateCartridgeConfigPojo(cartridgeDefinitionBean);
if(cartridgeConfig == null) {
throw new RestAPIException("Populated CartridgeConfig instance is null, cartridge deployment aborted");
}
// call CC
try {
cloudControllerServiceClient
.deployCartridgeDefinition(cartridgeConfig);
} catch (RemoteException e) {
log.error(e.getMessage(), e);
throw new RestAPIException(e.getMessage(), e);
} catch (CloudControllerServiceInvalidCartridgeDefinitionExceptionException e) {
String message = e.getFaultMessage().getInvalidCartridgeDefinitionException().getMessage();
log.error(message, e);
throw new RestAPIException(message, e);
} catch (CloudControllerServiceInvalidIaasProviderExceptionException e) {
String message = e.getFaultMessage().getInvalidIaasProviderException().getMessage();
log.error(message, e);
throw new RestAPIException(message, e);
}
log.info("Successfully deployed Cartridge [type] "+cartridgeDefinitionBean.type);
}