| | |
| | | ServerConstants.OID_VLV_REQUEST_CONTROL)); |
| | | |
| | | /** The set of objectclasses that will be used in ECL root entry. */ |
| | | private static final HashMap<ObjectClass, String> |
| | | private static final Map<ObjectClass, String> |
| | | CHANGELOG_ROOT_OBJECT_CLASSES = new LinkedHashMap<ObjectClass, String>(2); |
| | | static |
| | | { |
| | |
| | | } |
| | | |
| | | /** The set of objectclasses that will be used in ECL entries. */ |
| | | private static final HashMap<ObjectClass, String> |
| | | private static final Map<ObjectClass, String> |
| | | CHANGELOG_ENTRY_OBJECT_CLASSES = new LinkedHashMap<ObjectClass, String>(2); |
| | | static |
| | | { |
| | |
| | | + e.getMessage())); |
| | | } |
| | | |
| | | ArrayList<RawAttribute> eclAttributes = addMsg.getEclIncludes(); |
| | | List<RawAttribute> eclAttributes = addMsg.getEclIncludes(); |
| | | |
| | | clEntry = createChangelogEntry(eclmsg.getServiceId(), eclmsg |
| | | clEntry = createChangelogEntry(eclmsg.getBaseDN(), eclmsg |
| | | .getCookie().toString(), DN.decode(addMsg.getDn()), |
| | | addMsg.getChangeNumber(), ldifChanges, // entry as created (in LDIF |
| | | // format) |
| | | addMsg.getEntryUUID(), |
| | | eclAttributes, // entry attributes |
| | | eclmsg.getDraftChangeNumber(), "add", changeInitiatorsName); |
| | | |
| | | } |
| | | else if (msg instanceof ModifyCommonMsg) |
| | | { |
| | |
| | | String changeType = (modifyMsg instanceof ModifyDNMsg) ? "modrdn" |
| | | : "modify"; |
| | | |
| | | clEntry = createChangelogEntry(eclmsg.getServiceId(), eclmsg |
| | | clEntry = createChangelogEntry(eclmsg.getBaseDN(), eclmsg |
| | | .getCookie().toString(), DN.decode(modifyMsg.getDn()), |
| | | modifyMsg.getChangeNumber(), ldifChanges, |
| | | modifyMsg.getEntryUUID(), |
| | |
| | | { |
| | | ModifyDNMsg modDNMsg = (ModifyDNMsg) modifyMsg; |
| | | |
| | | Attribute a = Attributes.create("newrdn", |
| | | modDNMsg.getNewRDN()); |
| | | Attribute a = Attributes.create("newrdn", modDNMsg.getNewRDN()); |
| | | clEntry.addAttribute(a, null); |
| | | |
| | | if (modDNMsg.getNewSuperior() != null) |
| | |
| | | { |
| | | DeleteMsg delMsg = (DeleteMsg) msg; |
| | | |
| | | clEntry = createChangelogEntry(eclmsg.getServiceId(), eclmsg |
| | | clEntry = createChangelogEntry(eclmsg.getBaseDN(), eclmsg |
| | | .getCookie().toString(), DN.decode(delMsg.getDn()), |
| | | delMsg.getChangeNumber(), |
| | | null, // no changes |
| | |
| | | * Create an ECL entry from a set of provided information. This is the part |
| | | * of entry creation common to all types of msgs (ADD, DEL, MOD, MODDN). |
| | | * |
| | | * @param serviceID The provided cookie value. |
| | | * @param baseDN The provided baseDN value. |
| | | * @param cookie The provided cookie value. |
| | | * @param targetDN The provided targetDN. |
| | | * @param changeNumber The provided replication changeNumber. |
| | |
| | | * When any error occurs. |
| | | */ |
| | | private static Entry createChangelogEntry( |
| | | String serviceID, |
| | | String baseDN, |
| | | String cookie, |
| | | DN targetDN, |
| | | ChangeNumber changeNumber, |
| | |
| | | if (draftChangenumber == 0) |
| | | { |
| | | // Draft uncompat mode |
| | | dnString = "replicationCSN=" + changeNumber + "," + serviceID + "," |
| | | dnString = "replicationCSN=" + changeNumber + "," + baseDN + "," |
| | | + ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT; |
| | | } |
| | | else |
| | |
| | | // Objectclass |
| | | Map<AttributeType, List<Attribute>> uAttrs = |
| | | new LinkedHashMap<AttributeType,List<Attribute>>(); |
| | | |
| | | Map<AttributeType, List<Attribute>> operationalAttrs = |
| | | new LinkedHashMap<AttributeType,List<Attribute>>(); |
| | | |
| | | // Operational standard attributes |
| | | |
| | | addAttributeByType(ATTR_SUBSCHEMA_SUBENTRY_LC, ATTR_SUBSCHEMA_SUBENTRY_LC, |
| | | ConfigConstants.DN_DEFAULT_SCHEMA_ROOT, uAttrs, operationalAttrs); |
| | | |