/** * Indicates whether to include the entry with the specified DN in the import. * * @param dn The DN of the entry for which to make the determination. * @return <CODE>true</CODE> if the entry with the specified DN should be included in the import, * or <CODE>false</CODE> if not. */ public boolean includeEntry(DN dn) { if (!excludeBranches.isEmpty()) { for (DN excludeBranch : excludeBranches) { if (excludeBranch.isAncestorOf(dn)) { return false; } } } if (!includeBranches.isEmpty()) { for (DN includeBranch : includeBranches) { if (includeBranch.isAncestorOf(dn)) { return true; } } return false; } return true; }
/** * Indicates whether the specified attribute should be included in the entries read from the LDIF. * * @param attributeType The attribute type for which to make the determination. * @return <CODE>true</CODE> if the specified attribute should be included in the entries read * from the LDIF, or <CODE>false</CODE> if not. */ public boolean includeAttribute(AttributeType attributeType) { if (!excludeAttributes.isEmpty() && excludeAttributes.contains(attributeType)) { return false; } if ((excludeAllOpAttrs && attributeType.isOperational()) || (excludeAllUserAttrs && !attributeType.isOperational())) { return false; } if ((includeAllUserAttrs && !attributeType.isOperational()) || (includeAllOpAttrs && attributeType.isOperational())) { return true; } if (!includeAttributes.isEmpty()) { return includeAttributes.contains(attributeType); } else if ((includeAllUserAttrs && attributeType.isOperational()) || (includeAllOpAttrs && !attributeType.isOperational())) { return false; } return true; }