Search in sources :

Example 1 with ServicesPackageDeleted

use of cz.metacentrum.perun.audit.events.ServicesManagerEvents.ServicesPackageDeleted in project perun by CESNET.

the class ServicesManagerBlImpl method deleteServicesPackage.

@Override
public void deleteServicesPackage(PerunSession sess, ServicesPackage servicesPackage) throws RelationExistsException {
    if (getServicesFromServicesPackage(sess, servicesPackage).isEmpty()) {
        getServicesManagerImpl().deleteServicesPackage(sess, servicesPackage);
        getPerunBl().getAuditer().log(sess, new ServicesPackageDeleted(servicesPackage));
    } else {
        throw new RelationExistsException("There is one or more services in the services package. ServicesPackage=\"" + servicesPackage + "\"");
    }
}
Also used : RelationExistsException(cz.metacentrum.perun.core.api.exceptions.RelationExistsException) ServicesPackageDeleted(cz.metacentrum.perun.audit.events.ServicesManagerEvents.ServicesPackageDeleted)

Aggregations

ServicesPackageDeleted (cz.metacentrum.perun.audit.events.ServicesManagerEvents.ServicesPackageDeleted)1 RelationExistsException (cz.metacentrum.perun.core.api.exceptions.RelationExistsException)1