| | |
| | | debugBuffer.toString()); |
| | | |
| | | Entry debugEntry = |
| | | new Entry(DN.decode("cn=debugsearch"), null, null, null); |
| | | new Entry(DN.valueOf("cn=debugsearch"), null, null, null); |
| | | debugEntry.addAttribute(attr, new ArrayList<AttributeValue>()); |
| | | |
| | | searchOperation.returnEntry(debugEntry, null); |
| | |
| | | * "ou=people,dc=example,dc=com". |
| | | */ |
| | | byte[] baseDNKey = JebFormat.dnToDNKey(aBaseDN, |
| | | this.baseDN.getNumComponents()); |
| | | this.baseDN.size()); |
| | | byte[] suffix = Arrays.copyOf(baseDNKey, baseDNKey.length+1); |
| | | suffix[suffix.length-1] = 0x00; |
| | | |
| | |
| | | else if (searchScope == SearchScope.SINGLE_LEVEL) |
| | | { |
| | | // Check if this entry is an immediate child. |
| | | if ((entryDN.getNumComponents() == |
| | | aBaseDN.getNumComponents() + 1) && |
| | | if ((entryDN.size() == |
| | | aBaseDN.size() + 1) && |
| | | entryDN.isDescendantOf(aBaseDN)) |
| | | { |
| | | isInScope = true; |
| | |
| | | } |
| | | else if (searchScope == SearchScope.SUBORDINATE_SUBTREE) |
| | | { |
| | | if ((entryDN.getNumComponents() > |
| | | aBaseDN.getNumComponents()) && |
| | | if ((entryDN.size() > |
| | | aBaseDN.size()) && |
| | | entryDN.isDescendantOf(aBaseDN)) |
| | | { |
| | | isInScope = true; |
| | |
| | | * downwards. |
| | | */ |
| | | byte[] entryDNKey = JebFormat.dnToDNKey(entryDN, |
| | | this.baseDN.getNumComponents()); |
| | | this.baseDN.size()); |
| | | byte[] suffix = Arrays.copyOf(entryDNKey, entryDNKey.length+1); |
| | | suffix[suffix.length-1] = 0x00; |
| | | |
| | |
| | | { |
| | | leafDNKey = |
| | | new DatabaseEntry(JebFormat.dnToDNKey( |
| | | targetDN, this.baseDN.getNumComponents())); |
| | | targetDN, this.baseDN.size())); |
| | | } |
| | | DatabaseEntry value = new DatabaseEntry(); |
| | | OperationStatus status; |
| | |
| | | * downwards. |
| | | */ |
| | | byte[] currentDNKey = JebFormat.dnToDNKey(currentDN, |
| | | this.baseDN.getNumComponents()); |
| | | this.baseDN.size()); |
| | | byte[] suffix = Arrays.copyOf(currentDNKey, currentDNKey.length+1); |
| | | suffix[suffix.length-1] = 0x00; |
| | | |
| | |
| | | |
| | | // Construct the new DN of the entry. |
| | | DN newDN = modDN(oldEntry.getDN(), |
| | | currentDN.getNumComponents(), |
| | | currentDN.size(), |
| | | entry.getDN()); |
| | | |
| | | // Assign a new entry ID if we are renumbering. |
| | |
| | | */ |
| | | public static DN modDN(DN oldDN, int oldSuffixLen, DN newSuffixDN) |
| | | { |
| | | int oldDNNumComponents = oldDN.getNumComponents(); |
| | | int oldDNNumComponents = oldDN.size(); |
| | | int oldDNKeepComponents = oldDNNumComponents - oldSuffixLen; |
| | | int newSuffixDNComponents = newSuffixDN.getNumComponents(); |
| | | int newSuffixDNComponents = newSuffixDN.size(); |
| | | |
| | | RDN[] newDNComponents = new RDN[oldDNKeepComponents+newSuffixDNComponents]; |
| | | for (int i=0; i < oldDNKeepComponents; i++) |
| | |
| | | { |
| | | return null; |
| | | } |
| | | return dn.getParent(); |
| | | return dn.parent(); |
| | | } |
| | | |
| | | /** |