Search in sources :

Example 1 with BeforeApplicationVersionDeleted

use of org.alien4cloud.alm.events.BeforeApplicationVersionDeleted in project alien4cloud by alien4cloud.

the class ApplicationVersionService method deleteVersion.

private void deleteVersion(ApplicationVersion version) {
    // Call delete archive
    for (Map.Entry<String, ApplicationTopologyVersion> topologyVersionEntry : version.getTopologyVersions().entrySet()) {
        publisher.publishEvent(new BeforeApplicationTopologyVersionDeleted(this, version.getApplicationId(), version.getId(), topologyVersionEntry.getKey()));
        csarService.deleteCsar(topologyVersionEntry.getValue().getArchiveId());
    }
    publisher.publishEvent(new BeforeApplicationVersionDeleted(this, version.getApplicationId(), version.getId()));
    alienDAO.delete(ApplicationVersion.class, version.getId());
    publisher.publishEvent(new AfterApplicationVersionDeleted(this, version.getApplicationId(), version.getId()));
    for (Map.Entry<String, ApplicationTopologyVersion> topologyVersionEntry : version.getTopologyVersions().entrySet()) {
        publisher.publishEvent(new AfterApplicationTopologyVersionDeleted(this, version.getApplicationId(), version.getId(), topologyVersionEntry.getKey()));
    }
}
Also used : AfterApplicationTopologyVersionDeleted(org.alien4cloud.alm.events.AfterApplicationTopologyVersionDeleted) AfterApplicationVersionDeleted(org.alien4cloud.alm.events.AfterApplicationVersionDeleted) BeforeApplicationVersionDeleted(org.alien4cloud.alm.events.BeforeApplicationVersionDeleted) Map(java.util.Map) BeforeApplicationTopologyVersionDeleted(org.alien4cloud.alm.events.BeforeApplicationTopologyVersionDeleted) ApplicationTopologyVersion(alien4cloud.model.application.ApplicationTopologyVersion)

Aggregations

ApplicationTopologyVersion (alien4cloud.model.application.ApplicationTopologyVersion)1 Map (java.util.Map)1 AfterApplicationTopologyVersionDeleted (org.alien4cloud.alm.events.AfterApplicationTopologyVersionDeleted)1 AfterApplicationVersionDeleted (org.alien4cloud.alm.events.AfterApplicationVersionDeleted)1 BeforeApplicationTopologyVersionDeleted (org.alien4cloud.alm.events.BeforeApplicationTopologyVersionDeleted)1 BeforeApplicationVersionDeleted (org.alien4cloud.alm.events.BeforeApplicationVersionDeleted)1