Search in sources :

Example 1 with TopologyVersionChangedInfo

use of alien4cloud.common.ResourceUpdateInterceptor.TopologyVersionChangedInfo in project alien4cloud by alien4cloud.

the class ApplicationEnvironmentService method updateTopologyVersion.

public void updateTopologyVersion(ApplicationEnvironment applicationEnvironment, String oldTopologyVersion, String newVersion, String newTopologyVersion, String environmentIdToCopyInput) {
    applicationEnvironment.setVersion(newVersion);
    applicationEnvironment.setTopologyVersion(newTopologyVersion);
    if (environmentIdToCopyInput != null) {
        ApplicationEnvironment environmentToCopyInput = checkAndGetApplicationEnvironment(environmentIdToCopyInput, ApplicationRole.APPLICATION_MANAGER);
        alienDAO.save(applicationEnvironment);
        synchronizeEnvironmentInputs(environmentToCopyInput, applicationEnvironment);
    } else {
        alienDAO.save(applicationEnvironment);
    }
    publisher.publishEvent(new AfterEnvironmentTopologyVersionChanged(this, oldTopologyVersion, newTopologyVersion, applicationEnvironment.getId(), applicationEnvironment.getApplicationId()));
    resourceUpdateInterceptor.runOnEnvironmentTopologyVersionChanged(new TopologyVersionChangedInfo(applicationEnvironment, oldTopologyVersion, newTopologyVersion));
}
Also used : AfterEnvironmentTopologyVersionChanged(org.alien4cloud.alm.events.AfterEnvironmentTopologyVersionChanged) TopologyVersionChangedInfo(alien4cloud.common.ResourceUpdateInterceptor.TopologyVersionChangedInfo) ApplicationEnvironment(alien4cloud.model.application.ApplicationEnvironment)

Aggregations

TopologyVersionChangedInfo (alien4cloud.common.ResourceUpdateInterceptor.TopologyVersionChangedInfo)1 ApplicationEnvironment (alien4cloud.model.application.ApplicationEnvironment)1 AfterEnvironmentTopologyVersionChanged (org.alien4cloud.alm.events.AfterEnvironmentTopologyVersionChanged)1