Source:
private TierInstance createSecurityGroups(ClaudiaData claudiaData, TierInstance tierInstance) throws InvalidSecurityGroupRequestException, EntityNotFoundException { if ((systemPropertiesProvider.getProperty(SystemPropertiesProvider.CLOUD_SYSTEM).equals("FIWARE") && claudiaData.getVdc() != null && claudiaData.getVdc().length() > 0)) { SecurityGroup securityGroup = generateSecurityGroup(claudiaData, tierInstance); try { securityGroup = securityGroupManager.create(tierInstance.getTier().getRegion(), claudiaData.getUser().getToken(), claudiaData.getVdc(), securityGroup); tierInstance.setSecurityGroup(securityGroup); } catch (InvalidEntityException e) { log.error("It is not posssible to create the security group " + securityGroup.getName() + " " + e.getMessage()); throw new InvalidSecurityGroupRequestException("It is not posssible to create the security group " + securityGroup.getName() + " " + e.getMessage(), e); } catch (InvalidEnvironmentRequestException e) { log.error("It is not posssible to create the security group " + securityGroup.getName() + " " + e.getMessage()); throw new InvalidSecurityGroupRequestException("It is not posssible to create the security group " + securityGroup.getName() + " " + e.getMessage(), e); } catch (AlreadyExistsEntityException e) { log.error("It is not posssible to create the security group " + securityGroup.getName() + " " + e.getMessage()); throw new InvalidSecurityGroupRequestException("It is not posssible to create the security group " + securityGroup.getName() + " " + e.getMessage(), e); } catch (InfrastructureException e) { log.error("It is not posssible to create the security group " + securityGroup.getName() + " " + e.getMessage()); throw new InvalidSecurityGroupRequestException("It is not posssible to create the security group " + securityGroup.getName() + " " + e.getMessage(), e); } tierInstance.setSecurityGroup(securityGroup); } return tierInstance; }

Target:
private TierInstance createSecurityGroups(ClaudiaData claudiaData, TierInstance tierInstance) throws InvalidSecurityGroupRequestException, EntityNotFoundException { if ((systemPropertiesProvider.getProperty(SystemPropertiesProvider.CLOUD_SYSTEM).equals("FIWARE") && claudiaData.getVdc() != null && claudiaData.getVdc().length() > 0)) { SecurityGroup securityGroup = generateSecurityGroup(claudiaData, tierInstance); try { securityGroup = securityGroupManager.create(tierInstance.getTier().getRegion(), claudiaData.getUser().getToken(), claudiaData.getVdc(), securityGroup); tierInstance.setSecurityGroup(securityGroup); } catch (InvalidEntityException e) { String messg_e = "[InvalidEntityException] It is not possible to create the security group " + securityGroup.getName() + " " + e.getMessage(); log.error(messg_e); throw new InvalidSecurityGroupRequestException(messg_e, e); } catch (InvalidEnvironmentRequestException iere) { String messg_iere = "[InvalidEnvironmentRequestException] It is not possible to create the security group " + securityGroup.getName() + " " + iere.getMessage(); log.error(messg_iere); throw new InvalidSecurityGroupRequestException(messg_iere, iere); } catch (AlreadyExistsEntityException aeee) { String messg_aeee = "[AlreadyExistsEntity] It is not possible to create the security group " + securityGroup.getName() + " " + aeee.getMessage(); log.error(messg_aeee); throw new InvalidSecurityGroupRequestException(messg_aeee, aeee); } catch (InfrastructureException ie) { String messg_ie = "[InfrastructureException] It is not possible to create the security group " + securityGroup.getName() + " " + ie.getMessage(); log.error(messg_ie); throw new InvalidSecurityGroupRequestException(messg_ie, ie); } tierInstance.setSecurityGroup(securityGroup); } return tierInstance; }