| | |
| | | * @param entryContainer The entryContainer of the DN database. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | DN2URI(String name, Environment env, |
| | | EntryContainer entryContainer) |
| | | throws DatabaseException |
| | |
| | | dn2uriConfig.setTransactional(true); |
| | | } |
| | | this.dbConfig = dn2uriConfig; |
| | | this.dbConfig.setBtreeComparator(dn2uriComparator.getClass()); |
| | | //This line causes an unchecked cast error if the SuppressWarnings |
| | | //annotation is removed at the beginning of this method. |
| | | this.dbConfig.setBtreeComparator((Class<? extends Comparator<byte[]>>) |
| | | dn2uriComparator.getClass()); |
| | | } |
| | | |
| | | /** |
| | |
| | | case ADD: |
| | | if (a != null) |
| | | { |
| | | for (AttributeValue v : a.getValues()) |
| | | for (AttributeValue v : a) |
| | | { |
| | | insert(txn, entryDN, v.getStringValue()); |
| | | } |
| | |
| | | break; |
| | | |
| | | case DELETE: |
| | | if (a == null || !a.hasValue()) |
| | | if (a == null || a.isEmpty()) |
| | | { |
| | | delete(txn, entryDN); |
| | | } |
| | | else |
| | | { |
| | | for (AttributeValue v : a.getValues()) |
| | | for (AttributeValue v : a) |
| | | { |
| | | delete(txn, entryDN, v.getStringValue()); |
| | | } |
| | |
| | | delete(txn, entryDN); |
| | | if (a != null) |
| | | { |
| | | for (AttributeValue v : a.getValues()) |
| | | for (AttributeValue v : a) |
| | | { |
| | | insert(txn, entryDN, v.getStringValue()); |
| | | } |