Search in sources :

Example 1 with HostRemovedFromFacility

use of cz.metacentrum.perun.audit.events.FacilityManagerEvents.HostRemovedFromFacility in project perun by CESNET.

the class FacilitiesManagerBlImpl method removeHost.

@Override
public void removeHost(PerunSession sess, Host host, Facility facility) throws HostAlreadyRemovedException {
    try {
        perunBl.getAttributesManagerBl().removeAllAttributes(sess, host);
    } catch (WrongAttributeValueException e) {
        throw new InternalErrorException(e);
    }
    facilitiesManagerImpl.removeHost(sess, host);
    getPerunBl().getAuditer().log(sess, new HostRemovedFromFacility(host, facility));
}
Also used : HostRemovedFromFacility(cz.metacentrum.perun.audit.events.FacilityManagerEvents.HostRemovedFromFacility) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) WrongAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException)

Example 2 with HostRemovedFromFacility

use of cz.metacentrum.perun.audit.events.FacilityManagerEvents.HostRemovedFromFacility in project perun by CESNET.

the class FacilitiesManagerBlImpl method removeHosts.

@Override
public void removeHosts(PerunSession sess, List<Host> hosts, Facility facility) throws HostAlreadyRemovedException {
    for (Host host : hosts) {
        // Remove hosts attributes
        try {
            getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, host);
        } catch (WrongAttributeValueException e) {
            throw new InternalErrorException(e);
        }
        getFacilitiesManagerImpl().removeHost(sess, host);
        getPerunBl().getAuditer().log(sess, new HostRemovedFromFacility(host, facility));
    }
}
Also used : Host(cz.metacentrum.perun.core.api.Host) HostRemovedFromFacility(cz.metacentrum.perun.audit.events.FacilityManagerEvents.HostRemovedFromFacility) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) WrongAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException)

Aggregations

HostRemovedFromFacility (cz.metacentrum.perun.audit.events.FacilityManagerEvents.HostRemovedFromFacility)2 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)2 WrongAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException)2 Host (cz.metacentrum.perun.core.api.Host)1