use of org.apache.directory.fortress.core.RemoveException in project directory-fortress-core by apache.
the class PermDAO method deletePermissionAttribute.
/**
* @param entity
* @throws RemoveException
*/
void deletePermissionAttribute(PermissionAttribute entity, String attributeSetName) throws RemoveException {
LdapConnection ld = null;
String dn = getDn(entity, attributeSetName, entity.getContextId());
try {
ld = getAdminConnection();
delete(ld, dn);
} catch (LdapException e) {
String error = "deletePermission name [" + entity.getAttributeName() + "] set [" + attributeSetName + "] caught LdapException=" + e.getMessage();
throw new RemoveException(GlobalErrIds.PERM_ATTRIBUTE_DELETE_FAILED, error, e);
} finally {
closeAdminConnection(ld);
}
}
use of org.apache.directory.fortress.core.RemoveException in project directory-fortress-core by apache.
the class PermDAO method deleteObj.
/**
* @param entity
* @throws org.apache.directory.fortress.core.RemoveException
*/
void deleteObj(PermObj entity) throws RemoveException {
LdapConnection ld = null;
String dn = getDn(entity, entity.getContextId());
try {
ld = getAdminConnection();
deleteRecursive(ld, dn, entity);
} catch (LdapException e) {
String error = "deleteObj objName [" + entity.getObjName() + "] caught LdapException=" + e.getMessage();
throw new RemoveException(GlobalErrIds.PERM_DELETE_FAILED, error, e);
} catch (CursorException e) {
String error = "deleteObj objName [" + entity.getObjName() + "] caught LdapException=" + e.getMessage();
throw new RemoveException(GlobalErrIds.PERM_DELETE_FAILED, error, e);
} finally {
closeAdminConnection(ld);
}
}
use of org.apache.directory.fortress.core.RemoveException in project directory-fortress-core by apache.
the class PermDAO method deleteOperation.
/**
* @param entity
* @throws org.apache.directory.fortress.core.RemoveException
*/
void deleteOperation(Permission entity) throws RemoveException {
LdapConnection ld = null;
String dn = getOpRdn(entity.getOpName(), entity.getObjId()) + "," + GlobalIds.POBJ_NAME + "=" + entity.getObjName() + "," + getRootDn(entity.isAdmin(), entity.getContextId());
try {
ld = getAdminConnection();
deleteRecursive(ld, dn, entity);
} catch (LdapException e) {
String error = "deleteOperation objName [" + entity.getObjName() + "] opName [" + entity.getOpName() + "] caught LdapException=" + e.getMessage();
throw new RemoveException(GlobalErrIds.PERM_DELETE_FAILED, error, e);
} catch (CursorException e) {
String error = "deleteOperation objName [" + entity.getObjName() + "] opName [" + entity.getOpName() + "] caught LdapException=" + e.getMessage();
throw new RemoveException(GlobalErrIds.PERM_DELETE_FAILED, error, e);
} finally {
closeAdminConnection(ld);
}
}
use of org.apache.directory.fortress.core.RemoveException in project directory-fortress-core by apache.
the class PolicyDAO method remove.
/**
* @param entity
* @throws org.apache.directory.fortress.core.RemoveException
*/
void remove(PwPolicy entity) throws RemoveException {
LdapConnection ld = null;
String dn = getDn(entity);
try {
ld = getAdminConnection();
delete(ld, dn, entity);
} catch (LdapException e) {
String error = "remove name [" + entity.getName() + "] caught LdapException=" + e.getMessage();
throw new RemoveException(GlobalErrIds.PSWD_DELETE_FAILED, error, e);
} finally {
closeAdminConnection(ld);
}
}
use of org.apache.directory.fortress.core.RemoveException in project directory-fortress-core by apache.
the class GroupDAO method delete.
Group delete(Group group, String key, String value) throws FinderException, RemoveException {
LdapConnection ld = null;
String nodeDn = getDn(group.getName(), group.getContextId());
try {
LOG.debug("delete group property dn [{}], key [{}], value [{}]", nodeDn, key, value);
List<Modification> mods = new ArrayList<Modification>();
mods.add(new DefaultModification(ModificationOperation.REMOVE_ATTRIBUTE, GROUP_PROPERTY_ATTR_IMPL, key + "=" + value));
ld = getAdminConnection();
modify(ld, nodeDn, mods, group);
} catch (LdapException e) {
String error = "delete group property node dn [" + nodeDn + "] caught LDAPException=" + e.getMessage();
throw new RemoveException(GlobalErrIds.GROUP_DELETE_PROPERTY_FAILED, error, e);
} finally {
closeAdminConnection(ld);
}
return get(group);
}
Aggregations