Search in sources :

Example 6 with OrchestratorDeploymentProperties

use of org.alien4cloud.alm.deployment.configuration.model.OrchestratorDeploymentProperties in project alien4cloud by alien4cloud.

the class OrchestratorPropertiesService method onLocationChanged.

@EventListener
public void onLocationChanged(OnMatchedLocationChangedEvent locationChangedEvent) {
    // Remove the values of the orchestrator specific properties.
    OrchestratorDeploymentProperties properties = deploymentConfigurationDao.findById(OrchestratorDeploymentProperties.class, AbstractDeploymentConfig.generateId(locationChangedEvent.getEnvironment().getTopologyVersion(), locationChangedEvent.getEnvironment().getId()));
    if (properties == null || !locationChangedEvent.getOrchestratorId().equals(properties.getOrchestratorId())) {
        // Either no orchestrator properties set until now or orchestrator has changed, so reset properties
        properties = new OrchestratorDeploymentProperties(locationChangedEvent.getEnvironment().getTopologyVersion(), locationChangedEvent.getEnvironment().getId(), locationChangedEvent.getOrchestratorId());
        deploymentConfigurationDao.save(properties);
    }
}
Also used : OrchestratorDeploymentProperties(org.alien4cloud.alm.deployment.configuration.model.OrchestratorDeploymentProperties) EventListener(org.springframework.context.event.EventListener)

Aggregations

OrchestratorDeploymentProperties (org.alien4cloud.alm.deployment.configuration.model.OrchestratorDeploymentProperties)6 DeploymentMatchingConfiguration (org.alien4cloud.alm.deployment.configuration.model.DeploymentMatchingConfiguration)4 ApplicationEnvironment (alien4cloud.model.application.ApplicationEnvironment)3 TopologyValidationResult (alien4cloud.topology.TopologyValidationResult)2 AbstractTask (alien4cloud.topology.task.AbstractTask)2 EventListener (org.springframework.context.event.EventListener)2 DeploymentSubstitutionConfiguration (alien4cloud.deployment.model.DeploymentSubstitutionConfiguration)1 NotFoundException (alien4cloud.exception.NotFoundException)1 DeploymentTopology (alien4cloud.model.deployment.DeploymentTopology)1 LocationResourceTypes (alien4cloud.orchestrators.locations.services.LocationResourceTypes)1 LocationPolicyTask (alien4cloud.topology.task.LocationPolicyTask)1 DeploymentInputs (org.alien4cloud.alm.deployment.configuration.model.DeploymentInputs)1 PreconfiguredInputsConfiguration (org.alien4cloud.alm.deployment.configuration.model.PreconfiguredInputsConfiguration)1 SecretCredentialInfo (org.alien4cloud.alm.deployment.configuration.model.SecretCredentialInfo)1 ConstraintTechnicalException (org.alien4cloud.tosca.exceptions.ConstraintTechnicalException)1 ConstraintValueDoNotMatchPropertyTypeException (org.alien4cloud.tosca.exceptions.ConstraintValueDoNotMatchPropertyTypeException)1 ConstraintViolationException (org.alien4cloud.tosca.exceptions.ConstraintViolationException)1 Order (org.springframework.core.annotation.Order)1