Search in sources :

Example 1 with CheckDeletePermissions

use of org.bf2.srs.fleetmanager.auth.interceptor.CheckDeletePermissions in project srs-fleet-manager by bf2fc6cc711aee1a0c2a.

the class RegistryServiceImpl method deleteRegistry.

@Override
@Audited(extractParameters = { "0", KEY_REGISTRY_ID })
@CheckDeletePermissions
public void deleteRegistry(String registryId) throws RegistryNotFoundException, RegistryStorageConflictException {
    try {
        // Verify preconditions - Registry exists
        storage.getRegistryById(registryId).orElseThrow(() -> new RegistryNotFoundException(registryId));
        tasks.submit(StartDeprovisionRegistryTask.builder().registryId(registryId).build());
    } catch (NumberFormatException ex) {
        throw new RegistryNotFoundException(registryId);
    }
}
Also used : RegistryNotFoundException(org.bf2.srs.fleetmanager.storage.RegistryNotFoundException) Audited(org.bf2.srs.fleetmanager.common.operation.auditing.Audited) CheckDeletePermissions(org.bf2.srs.fleetmanager.auth.interceptor.CheckDeletePermissions)

Aggregations

CheckDeletePermissions (org.bf2.srs.fleetmanager.auth.interceptor.CheckDeletePermissions)1 Audited (org.bf2.srs.fleetmanager.common.operation.auditing.Audited)1 RegistryNotFoundException (org.bf2.srs.fleetmanager.storage.RegistryNotFoundException)1