Search in sources :

Example 11 with NameNotFoundException

use of org.springframework.ldap.NameNotFoundException in project perun by CESNET.

the class LdapConnectorImpl method deleteResource.

public void deleteResource(Resource resource) throws InternalErrorException {
    try {
        ldapTemplate.unbind(getResourceDN(String.valueOf(resource.getVoId()), String.valueOf(resource.getId())));
        log.debug("Entry deleted from LDAP: Resource {} from Vo with ID=" + resource.getVoId() + " and Facility with ID=" + resource.getFacilityId() + ".", resource);
    } catch (NameNotFoundException e) {
        throw new InternalErrorException(e);
    }
}
Also used : NameNotFoundException(org.springframework.ldap.NameNotFoundException) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException)

Aggregations

NameNotFoundException (org.springframework.ldap.NameNotFoundException)11 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)10 Attribute (javax.naming.directory.Attribute)5 BasicAttribute (javax.naming.directory.BasicAttribute)5 Attributes (javax.naming.directory.Attributes)4 BasicAttributes (javax.naming.directory.BasicAttributes)4 ArrayList (java.util.ArrayList)1 ModificationItem (javax.naming.directory.ModificationItem)1 DirContextOperations (org.springframework.ldap.core.DirContextOperations)1 BadCredentialsException (org.springframework.security.authentication.BadCredentialsException)1 UsernameNotFoundException (org.springframework.security.core.userdetails.UsernameNotFoundException)1 SpringSecurityLdapTemplate (org.springframework.security.ldap.SpringSecurityLdapTemplate)1