mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
20.29.2014 cf0ae342a174ec03d0cef89e2687cf5f2b57b15e
Code cleanup.


LDAPReplicationDomain.java:
Changed numReplayedPostOpCalled field from int to AtomicInteger.
Extracted methods newSet(), newList(), exists(), canRemoveAttribute().
Inlined getPendingUpdatesCount(), getNumReplayedPostOpCalled(), getNumResolvedModifyConflicts(), getNumResolvedNamingConflicts() and getNumUnresolvedNamingConflicts().
In contains(), changed parameter names.
Added javadocs to instance variables.
Reduced visibilities to default or private.
Added braces to if statements.
Used static imports.
Fixed Eclipse warnings.
Replaced unnecessary use of MessageBuilder by adding arguments to replication messages.

replication*.properties:
Modified messages to include arguments.
9 files modified
506 ■■■■■ changed files
opendj3-server-dev/src/messages/messages/replication.properties 6 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/messages/messages/replication_de.properties 6 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/messages/messages/replication_es.properties 6 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/messages/messages/replication_fr.properties 6 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/messages/messages/replication_ja.properties 4 ●●● patch | view | raw | blame | history
opendj3-server-dev/src/messages/messages/replication_ko.properties 4 ●●● patch | view | raw | blame | history
opendj3-server-dev/src/messages/messages/replication_zh_CN.properties 3 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/messages/messages/replication_zh_TW.properties 3 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java 468 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/messages/messages/replication.properties
@@ -118,11 +118,11 @@
ERR_BAD_HISTORICAL_56=Entry %s was containing some unknown historical \
 information, This may cause some inconsistency for this entry
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=A conflict was detected but the \
 conflict information could not be added. Operation :
 conflict information could not be added. Operation: %s, Result: %s
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=An error happened trying to \
 rename a conflicting entry :
 rename a conflicting entry. DN: %s, Operation: %s, Result: %s
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=An Exception happened when \
 trying to rename a conflicting entry :
 trying to rename a conflicting entry. DN: %s, Operation: %s, Stacktrace: %s
ERR_REPLICATION_COULD_NOT_CONNECT_61=The Replication is configured for \
 suffix %s but was not able to connect to any Replication Server
ERR_CHANGELOG_ERROR_SENDING_ERROR_65=An unexpected error occurred \
opendj3-server-dev/src/messages/messages/replication_de.properties
@@ -86,9 +86,9 @@
ERR_DUPLICATE_SERVER_ID_54=In Replikationsserver %s: besitzen Server %s und %s dieselbe Server-ID : %d
ERR_DUPLICATE_REPLICATION_SERVER_ID_55=In Replikationsserver %s: besitzen Replikationsserver %s und %s dieselbe Server-ID : %d
ERR_BAD_HISTORICAL_56=Eintrag %s hat einige unbekannte historische Informatinoen enthalten. Dadurch k\u00f6nnen Inkonsistenzen f\u00fcr diesen Eintrag auftreten
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=Es wurde ein Konflikt entdeckt, aber die Konfliktinformationen konnten nicht hinzugef\u00fcgt werden. Vorgang:
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=Bei dem Versuch, einen widerspr\u00fcchlichen Eintrag umzubenennen, ist ein Fehler aufgetreten:
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=Bei dem Versuch, einen widerspr\u00fcchlichen Eintrag umzubenennen, ist ein Ausnahmefehler aufgetreten:
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=Es wurde ein Konflikt entdeckt, aber die Konfliktinformationen konnten nicht hinzugef\u00fcgt werden. Vorgang: %s, Ergebnis: %s
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=Bei dem Versuch, einen widerspr\u00fcchlichen Eintrag umzubenennen, ist ein Fehler aufgetreten. DN: %s, Vorgang: %s, Ergebnis: %s
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=Bei dem Versuch, einen widerspr\u00fcchlichen Eintrag umzubenennen, ist ein Ausnahmefehler aufgetreten. DN: %s, Vorgang: %s, Stacktrace: %s
ERR_REPLICATION_COULD_NOT_CONNECT_61=Die Replikation ist f\u00fcr Suffix %s konfiguriert, konnte jedoch keine Verbindung zu einem Replikationsserver herstellen
ERR_CHANGELOG_ERROR_SENDING_ERROR_65=Beim Senden einer Fehlernachricht an %s ist ein unerwarteter Fehler aufgetreten. Diese Verbindung wird geschlossen und erneut ge\u00f6ffnet
ERR_CHANGELOG_ERROR_SENDING_MSG_66=Beim Senden einer Nachricht an %s ist ein unerwarteter Fehler aufgetreten. Diese Verbindung wird geschlossen und erneut ge\u00f6ffnet
opendj3-server-dev/src/messages/messages/replication_es.properties
@@ -86,9 +86,9 @@
ERR_DUPLICATE_SERVER_ID_54=En el Servidor de repetici\u00f3n %s: los servidores %s y %s tienen el mismo Id. (ServerId): %d
ERR_DUPLICATE_REPLICATION_SERVER_ID_55=En el Servidor de repetici\u00f3n %s: los servidores de repetici\u00f3n %s y %s tienen el mismo Id. (ServerId): %d
ERR_BAD_HISTORICAL_56=La entrada %s conten\u00eda informaci\u00f3n hist\u00f3rica desconocida. Es posible que esto genere incoherencias con respecto a esta entrada
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=Se detect\u00f3 un conflicto pero no se pudo agregar su informaci\u00f3n. Operaci\u00f3n:
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=Se produjo un error al intentar cambiar el nombre de una entrada contradictoria:
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=Se produjo una excepci\u00f3n al intentar cambiar el nombre de una entrada contradictoria:
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=Se detect\u00f3 un conflicto pero no se pudo agregar su informaci\u00f3n. Operaci\u00f3n: %s, Resultado: %s
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=Se produjo un error al intentar cambiar el nombre de una entrada contradictoria. DN: %s, Operaci\u00f3n: %s, Resultado: %s
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=Se produjo una excepci\u00f3n al intentar cambiar el nombre de una entrada contradictoria. DN: %s, Operaci\u00f3n: %s, Stacktrace: %s
ERR_REPLICATION_COULD_NOT_CONNECT_61=La repetici\u00f3n est\u00e1 configurada para el sufijo %s, pero no pudo conectarse con ning\u00fan Servidor de repetici\u00f3n
ERR_CHANGELOG_ERROR_SENDING_ERROR_65=Se ha producido un error inesperado al enviar un mensaje de error a %s. Esta conexi\u00f3n se cerrar\u00e1 y volver\u00e1 a abrirse
ERR_CHANGELOG_ERROR_SENDING_MSG_66=Se ha producido un error inesperado al enviar un mensaje a %s. Esta conexi\u00f3n se cerrar\u00e1 y volver\u00e1 a abrirse
opendj3-server-dev/src/messages/messages/replication_fr.properties
@@ -86,9 +86,9 @@
ERR_DUPLICATE_SERVER_ID_54=Sur le serveur de r\u00e9plication %s\u00a0: les serveurs %s et %s ont le m\u00eame ID (ServerId)\u00a0: %d
ERR_DUPLICATE_REPLICATION_SERVER_ID_55=Sur le serveur de r\u00e9plication %s\u00a0: les serveurs de r\u00e9plication %s et %s ont le m\u00eame ID (ServerId)\u00a0: %d
ERR_BAD_HISTORICAL_56=L'entr\u00e9e %s contenait des informations historiques inconnues, ce qui peut provoquer des incoh\u00e9rences pour cette entr\u00e9e
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=Un conflit a \u00e9t\u00e9 d\u00e9tect\u00e9 mais des informations sur ce conflit n'ont pas pu \u00eatre ajout\u00e9es. Op\u00e9ration :
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=Une erreur s'est produite lors de la tentative de renommage d'une entr\u00e9e conflictuelle\u00a0:
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=Une exception s'est produite lors de la tentative de renommage d'une entr\u00e9e conflictuelle\u00a0:
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=Un conflit a \u00e9t\u00e9 d\u00e9tect\u00e9 mais des informations sur ce conflit n'ont pas pu \u00eatre ajout\u00e9es. Op\u00e9ration\u00a0: %s, R\u00e9sultat\u00a0: %s
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=Une erreur s'est produite lors de la tentative de renommage d'une entr\u00e9e conflictuelle. DN\u00a0: %s, Op\u00e9ration\u00a0: %s, R\u00e9sultat\u00a0: %s
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=Une exception s'est produite lors de la tentative de renommage d'une entr\u00e9e conflictuelle. DN\u00a0: %s, Op\u00e9ration\u00a0: %s, Stacktrace\u00a0: %s
ERR_REPLICATION_COULD_NOT_CONNECT_61=La r\u00e9plication est configur\u00e9e pour le suffixe %s mais n'a pu se connecter \u00e0 aucun serveur de r\u00e9plication
ERR_CHANGELOG_ERROR_SENDING_ERROR_65=Une erreur inattendue s'est produite lors de l'envoi d'un message d'erreur \u00e0 %s. Cette connexion va \u00eatre ferm\u00e9e, puis rouverte
ERR_CHANGELOG_ERROR_SENDING_MSG_66=Une erreur inattendue s'est produite lors de l'envoi d'un message \u00e0 %s. Cette connexion va \u00eatre ferm\u00e9e, puis rouverte
opendj3-server-dev/src/messages/messages/replication_ja.properties
@@ -86,9 +86,7 @@
ERR_DUPLICATE_SERVER_ID_54=\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u30fc %s: \u30b5\u30fc\u30d0\u30fc %s \u3068 %s \u306eServerId \u304c\u540c\u3058\u3067\u3059: %d
ERR_DUPLICATE_REPLICATION_SERVER_ID_55=\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u30fc %s: \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u30fc %s \u3068 %s \u306eServerId \u304c\u540c\u3058\u3067\u3059: %d
ERR_BAD_HISTORICAL_56=\u30a8\u30f3\u30c8\u30ea %s \u306b\u4e0d\u660e\u306a\u5c65\u6b74\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u306b\u77db\u76fe\u304c\u8d77\u304d\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=\u7af6\u5408\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u7af6\u5408\u60c5\u5831\u3092\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u64cd\u4f5c:
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=\u7af6\u5408\u3057\u3066\u3044\u308b\u30a8\u30f3\u30c8\u30ea\u306e\u540d\u524d\u3092\u5909\u66f4\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f:
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=\u7af6\u5408\u3057\u3066\u3044\u308b\u30a8\u30f3\u30c8\u30ea\u306e\u540d\u524d\u3092\u5909\u66f4\u4e2d\u306b\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f:
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=\u7af6\u5408\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u7af6\u5408\u60c5\u5831\u3092\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u64cd\u4f5c: %s, \u7d50\u679c: %s
ERR_REPLICATION_COULD_NOT_CONNECT_61=\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u30b5\u30d5\u30a3\u30c3\u30af\u30b9 %s \u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u3044\u305a\u308c\u306e\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u30fc\u306b\u3082\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f
ERR_CHANGELOG_ERROR_SENDING_ERROR_65=%s \u306b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u4e2d\u306b\u3001\u4e88\u671f\u3057\u306a\u3044\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u3053\u306e\u63a5\u7d9a\u306f\u9589\u3058\u3089\u308c\u305f\u3042\u3068\u3001\u958b\u304d\u76f4\u3055\u308c\u307e\u3059
ERR_CHANGELOG_ERROR_SENDING_MSG_66=%s \u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u4e2d\u306b\u3001\u4e88\u671f\u3057\u306a\u3044\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u3053\u306e\u63a5\u7d9a\u306f\u9589\u3058\u3089\u308c\u305f\u3042\u3068\u3001\u958b\u304d\u76f4\u3055\u308c\u307e\u3059
opendj3-server-dev/src/messages/messages/replication_ko.properties
@@ -81,9 +81,7 @@
NOTE_READER_NULL_MSG_52=%s\uc5d0\uc11c Null \uba54\uc2dc\uc9c0\ub97c \uc218\uc2e0\ud588\uc2b5\ub2c8\ub2e4.
NOTE_READER_EXCEPTION_53=%s\uc5d0\uc11c \uba54\uc2dc\uc9c0\ub97c \uc77d\ub294 \ub3d9\uc548 \uc608\uc678\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4: %s
ERR_BAD_HISTORICAL_56=%s \ud56d\ubaa9\uc5d0 \uc54c\ub824\uc9c0\uc9c0 \uc54a\uc740 \uc77c\ubd80 \uae30\ub85d \uc815\ubcf4\uac00 \ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub85c \uc778\ud574 \uc774 \ud56d\ubaa9\uc5d0 \ub300\ud55c \uc77c\ubd80 \ubd88\uc77c\uce58\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=\ucda9\ub3cc\uc774 \uac80\uc0c9\ub418\uc5c8\uc9c0\ub9cc \ucda9\ub3cc \uc815\ubcf4\ub97c \ucd94\uac00\ud558\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4. \uc791\uc5c5:
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=\ucda9\ub3cc\ud558\ub294 \ud56d\ubaa9\uc758 \uc774\ub984\uc744 \ubc14\uafb8\ub294 \ub3d9\uc548 \uc624\ub958\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4:
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=\ucda9\ub3cc\ud558\ub294 \ud56d\ubaa9\uc758 \uc774\ub984\uc744 \ubc14\uafb8\ub294 \ub3d9\uc548 \uc608\uc678\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4:
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=\ucda9\ub3cc\uc774 \uac80\uc0c9\ub418\uc5c8\uc9c0\ub9cc \ucda9\ub3cc \uc815\ubcf4\ub97c \ucd94\uac00\ud558\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4. \uc791\uc5c5: %s, \uacb0\uacfc: %s
ERR_REPLICATION_COULD_NOT_CONNECT_61=\uc811\ubbf8\uc5b4 %s\uc5d0 \ub300\ud55c \ubcf5\uc81c\uac00 \uad6c\uc131\ub418\uc5b4 \uc788\uc9c0\ub9cc \ubcf5\uc81c \uc11c\ubc84\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
ERR_CHANGELOG_ERROR_SENDING_ERROR_65=%s(\uc73c)\ub85c \uc624\ub958 \uba54\uc2dc\uc9c0\ub97c \ubcf4\ub0b4\ub294 \ub3d9\uc548 \uc608\uae30\uce58 \uc54a\uc740 \uc624\ub958\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4. \uc774 \uc5f0\uacb0\uc774 \ub2eb\ud614\ub2e4\uac00 \ub2e4\uc2dc \uc5f4\ub9bd\ub2c8\ub2e4.
ERR_CHANGELOG_ERROR_SENDING_MSG_66=%s(\uc73c)\ub85c \uba54\uc2dc\uc9c0\ub97c \ubcf4\ub0b4\ub294 \ub3d9\uc548 \uc608\uae30\uce58 \uc54a\uc740 \uc624\ub958\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4. \uc774 \uc5f0\uacb0\uc774 \ub2eb\ud614\ub2e4\uac00 \ub2e4\uc2dc \uc5f4\ub9bd\ub2c8\ub2e4.
opendj3-server-dev/src/messages/messages/replication_zh_CN.properties
@@ -86,9 +86,6 @@
ERR_DUPLICATE_SERVER_ID_54=\u5728\u590d\u5236\u670d\u52a1\u5668 %s \u4e2d\uff1a\u670d\u52a1\u5668 %s \u548c %s \u5177\u6709\u76f8\u540c\u7684\u670d\u52a1\u5668 ID: %d
ERR_DUPLICATE_REPLICATION_SERVER_ID_55=\u5728\u590d\u5236\u670d\u52a1\u5668 %s \u4e2d\uff1a\u590d\u5236\u670d\u52a1\u5668 %s \u548c %s \u5177\u6709\u76f8\u540c\u7684\u670d\u52a1\u5668 ID: %d
ERR_BAD_HISTORICAL_56=\u6761\u76ee %s \u5305\u542b\u67d0\u4e9b\u672a\u77e5\u7684\u5386\u53f2\u4fe1\u606f\uff0c\u53ef\u80fd\u4f1a\u9020\u6210\u672c\u6761\u76ee\u7684\u4e0d\u4e00\u81f4\u6027
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=\u68c0\u6d4b\u5230\u51b2\u7a81\uff0c\u4f46\u65e0\u6cd5\u6dfb\u52a0\u51b2\u7a81\u4fe1\u606f\u3002\u64cd\u4f5c:
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=\u5728\u5c1d\u8bd5\u91cd\u547d\u540d\u51b2\u7a81\u6761\u76ee\u65f6\u51fa\u73b0\u9519\u8bef:
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=\u5728\u5c1d\u8bd5\u91cd\u547d\u540d\u51b2\u7a81\u6761\u76ee\u65f6\u51fa\u73b0\u5f02\u5e38:
ERR_REPLICATION_COULD_NOT_CONNECT_61=\u6b64\u590d\u5236\u4e3a\u540e\u7f00 %s \u914d\u7f6e\uff0c\u4f46\u4e0d\u80fd\u8fde\u63a5\u5230\u4efb\u4f55\u590d\u5236\u670d\u52a1\u5668
ERR_CHANGELOG_ERROR_SENDING_ERROR_65=\u5411 %s \u53d1\u9001\u9519\u8bef\u6d88\u606f\u65f6\u51fa\u73b0\u610f\u5916\u9519\u8bef\u3002\u6b64\u8fde\u63a5\u5c06\u88ab\u5173\u95ed\u5e76\u91cd\u65b0\u6253\u5f00
ERR_CHANGELOG_ERROR_SENDING_MSG_66=\u5411 %s \u53d1\u9001\u6d88\u606f\u65f6\u51fa\u73b0\u610f\u5916\u9519\u8bef\u3002\u6b64\u8fde\u63a5\u5c06\u88ab\u5173\u95ed\u5e76\u91cd\u65b0\u6253\u5f00
opendj3-server-dev/src/messages/messages/replication_zh_TW.properties
@@ -81,9 +81,6 @@
NOTE_READER_NULL_MSG_52=\u5f9e %s \u63a5\u6536\u5230\u7a7a\u8a0a\u606f
NOTE_READER_EXCEPTION_53=\u8b80\u53d6\u4f86\u81ea %s \u7684\u8a0a\u606f\u6642\u767c\u751f\u7570\u5e38: %s
ERR_BAD_HISTORICAL_56=\u9805\u76ee %s \u5305\u542b\u67d0\u4e9b\u4e0d\u660e\u6b77\u7a0b\u8cc7\u8a0a\uff0c\u9019\u53ef\u80fd\u6703\u5c0e\u81f4\u6b64\u9805\u76ee\u51fa\u73fe\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1
ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE_57=\u5075\u6e2c\u5230\u885d\u7a81\uff0c\u4f46\u7121\u6cd5\u589e\u52a0\u885d\u7a81\u8cc7\u8a0a\u3002\u4f5c\u696d:
ERR_CANNOT_RENAME_CONFLICT_ENTRY_58=\u5617\u8a66\u91cd\u65b0\u547d\u540d\u885d\u7a81\u9805\u76ee\u6642\u767c\u751f\u932f\u8aa4:
ERR_EXCEPTION_RENAME_CONFLICT_ENTRY_59=\u5617\u8a66\u91cd\u65b0\u547d\u540d\u885d\u7a81\u9805\u76ee\u6642\u767c\u751f\u7570\u5e38:
ERR_REPLICATION_COULD_NOT_CONNECT_61=\u5df2\u914d\u7f6e\u5c3e\u78bc %s \u7684\u8907\u88fd\uff0c\u4f46\u7121\u6cd5\u9023\u7dda\u5230\u4efb\u4f55\u8907\u88fd\u4f3a\u670d\u5668
ERR_CHANGELOG_ERROR_SENDING_ERROR_65=\u50b3\u9001\u932f\u8aa4\u8a0a\u606f\u81f3 %s \u6642\u767c\u751f\u672a\u9810\u671f\u7684\u932f\u8aa4\u3002\u6b64\u9023\u7dda\u5373\u5c07\u95dc\u9589\u4e26\u91cd\u65b0\u958b\u555f
ERR_CHANGELOG_ERROR_SENDING_MSG_66=\u50b3\u9001\u8a0a\u606f\u81f3 %s \u6642\u767c\u751f\u672a\u9810\u671f\u7684\u932f\u8aa4\u3002\u6b64\u9023\u7dda\u5373\u5c07\u95dc\u9589\u4e26\u91cd\u65b0\u958b\u555f
opendj3-server-dev/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -37,7 +37,6 @@
import java.util.zip.DataFormatException;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.DecodeException;
@@ -79,6 +78,7 @@
import static org.forgerock.opendj.ldap.ResultCode.*;
import static org.opends.messages.ReplicationMessages.*;
import static org.opends.messages.ToolMessages.*;
import static org.opends.server.protocols.internal.InternalClientConnection.*;
import static org.opends.server.replication.plugin.EntryHistorical.*;
import static org.opends.server.replication.protocol.OperationContext.*;
import static org.opends.server.replication.service.ReplicationMonitor.*;
@@ -175,12 +175,16 @@
   * push incoming update messages.
   */
  private final BlockingQueue<UpdateToReplay> updateToReplayQueue;
  /** The number of naming conflicts successfully resolved. */
  private final AtomicInteger numResolvedNamingConflicts = new AtomicInteger();
  /** The number of modify conflicts successfully resolved. */
  private final AtomicInteger numResolvedModifyConflicts = new AtomicInteger();
  /** The number of unresolved naming conflicts. */
  private final AtomicInteger numUnresolvedNamingConflicts =
    new AtomicInteger();
      new AtomicInteger();
  private final PersistentServerState state;
  private int numReplayedPostOpCalled = 0;
  /** The number of updates replayed successfully by the replication. */
  private final AtomicInteger numReplayedPostOpCalled = new AtomicInteger();
  private volatile boolean generationIdSavedStatus = false;
@@ -205,12 +209,9 @@
   * not updated too early.
   */
  private final RemotePendingChanges remotePendingChanges;
  private final InternalClientConnection conn =
      InternalClientConnection.getRootConnection();
  private boolean solveConflictFlag = true;
  private final InternalClientConnection conn = getRootConnection();
  private volatile boolean shutdown = false;
  private volatile boolean disabled = false;
  private volatile boolean stateSavingDisabled = false;
@@ -241,13 +242,13 @@
   * The attribute name used to store the fractional include configuration in
   * the backend.
   */
  public static final String REPLICATION_FRACTIONAL_INCLUDE =
  static final String REPLICATION_FRACTIONAL_INCLUDE =
    "ds-sync-fractional-include";
  /**
   * The attribute name used to store the fractional exclude configuration in
   * the backend.
   */
  public static final String REPLICATION_FRACTIONAL_EXCLUDE =
  static final String REPLICATION_FRACTIONAL_EXCLUDE =
    "ds-sync-fractional-exclude";
  /**
@@ -289,11 +290,11 @@
  /**
   * LocalizableMessage type for ERR_FULL_UPDATE_IMPORT_FRACTIONAL_BAD_REMOTE.
   */
  public static final int IMPORT_ERROR_MESSAGE_BAD_REMOTE = 1;
  static final int IMPORT_ERROR_MESSAGE_BAD_REMOTE = 1;
  /**
   * LocalizableMessage type for ERR_FULL_UPDATE_IMPORT_FRACTIONAL_REMOTE_IS_FRACTIONAL.
   */
  public static final int IMPORT_ERROR_MESSAGE_REMOTE_IS_FRACTIONAL = 2;
  static final int IMPORT_ERROR_MESSAGE_REMOTE_IS_FRACTIONAL = 2;
  /*
   * Definitions for the return codes of the
@@ -455,7 +456,7 @@
   * @param updateToReplayQueue The queue for update messages to replay.
   * @throws ConfigException In case of invalid configuration.
   */
  public LDAPReplicationDomain(ReplicationDomainCfg configuration,
  LDAPReplicationDomain(ReplicationDomainCfg configuration,
      BlockingQueue<UpdateToReplay> updateToReplayQueue) throws ConfigException
  {
    super(configuration, -1);
@@ -623,7 +624,9 @@
    // Reconnect if required
    if (needRestart)
    {
      enableService();
    }
  }
  /**
@@ -635,9 +638,11 @@
  {
    // Read config stored in domain root entry
    if (logger.isTraceEnabled())
    {
      logger.trace(
          "Attempt to read the potential fractional config in domain root "
              + "entry " + getBaseDNString());
    }
    LDAPFilter filter;
    try
@@ -650,11 +655,11 @@
    }
    // Search the domain root entry that is used to save the generation id
    ByteString asn1BaseDn = ByteString.valueOf(getBaseDNString());
    Set<String> attributes = new LinkedHashSet<String>(3);
    attributes.add(REPLICATION_GENERATION_ID);
    attributes.add(REPLICATION_FRACTIONAL_EXCLUDE);
    attributes.add(REPLICATION_FRACTIONAL_INCLUDE);
    final ByteString asn1BaseDn = ByteString.valueOf(getBaseDNString());
    final Set<String> attributes = newSet(
        REPLICATION_GENERATION_ID,
        REPLICATION_FRACTIONAL_EXCLUDE,
        REPLICATION_FRACTIONAL_INCLUDE);
    InternalSearchOperation search = conn.processSearch(asn1BaseDn,
      SearchScope.BASE_OBJECT,
      DereferenceAliasesPolicy.ALWAYS, 0, 0, false,
@@ -816,7 +821,7 @@
   * Utility class to have get a string iterator from an AtributeValue iterator.
   * Assuming the attribute values are strings.
   */
  public static class AttributeValueStringIterator implements Iterator<String>
  static class AttributeValueStringIterator implements Iterator<String>
  {
    private Iterator<ByteString> attrValIt;
@@ -825,7 +830,7 @@
     * @param attrValIt The underlying attribute iterator to use, assuming
     * internal values are strings.
     */
    public AttributeValueStringIterator(Iterator<ByteString> attrValIt)
    AttributeValueStringIterator(Iterator<ByteString> attrValIt)
    {
      this.attrValIt = attrValIt;
    }
@@ -870,7 +875,9 @@
  {
    // Compare all classes attributes
    if (attributes1.size() != attributes2.size())
    {
      return false;
    }
    // Check consistency of all classes attributes
    Schema schema = DirectoryServer.getSchema();
@@ -905,7 +912,9 @@
      }
      // Found matching attribute ?
      if (!foundAttribute)
      {
        return false;
      }
    }
    return true;
@@ -932,8 +941,8 @@
    if (!newFractionalConfig.isFractional())
    {
        // Nothing to check
        return;
      // Nothing to check
      return;
    }
    // Prepare variables to be filled with config
@@ -1091,8 +1100,10 @@
    boolean fractionalExclusive = fractionalConfig.isFractionalExclusive();
    if (fractionalExclusive && fractionalConcernedAttributes.isEmpty())
    {
      // No attributes to filter
      return false;
    }
    /*
     * Analyze the old and new rdn to see if they are some attributes to be
@@ -1112,21 +1123,10 @@
    for (int i=0 ; i<rdn.getNumValues() ; i++)
    {
      AttributeType attributeType = rdn.getAttributeType(i);
      boolean found = false;
      // Is it present in the fractional attributes established list ?
      for (String attrTypeStr : fractionalConcernedAttributes)
      {
        AttributeType attributeTypeFromList =
        DirectoryServer.getAttributeType(attrTypeStr);
        if (attributeTypeFromList.equals(attributeType))
        {
          found = true;
          break;
        }
      }
      boolean attributeToBeFiltered = (fractionalExclusive && found)
          || (!fractionalExclusive && !found);
      if (attributeToBeFiltered
      boolean foundAttribute =
          exists(fractionalConcernedAttributes, attributeType);
      if (canRemoveAttribute(fractionalExclusive, foundAttribute)
          && !newRdn.hasAttributeType(attributeType)
          && !modifyDNOperation.deleteOldRDN())
      {
@@ -1146,6 +1146,18 @@
    return inconsistentOperation;
  }
  private boolean exists(Set<String> attrNames, AttributeType attrTypeToFind)
  {
    for (String attrName : attrNames)
    {
      if (DirectoryServer.getAttributeType(attrName).equals(attrTypeToFind))
      {
        return true;
      }
    }
    return false;
  }
  /**
   * Remove attributes from an entry, according to the passed fractional
   * configuration. The entry is represented by the 2 passed parameters.
@@ -1177,7 +1189,9 @@
      createFractionalConcernedAttrList(fractionalConfig, classes.keySet());
    boolean fractionalExclusive = fractionalConfig.isFractionalExclusive();
    if (fractionalExclusive && fractionalConcernedAttributes.isEmpty())
    {
      return false; // No attributes to filter
    }
    // Prepare list of object classes of the added entry
    Set<ObjectClass> entryClasses = classes.keySet();
@@ -1189,12 +1203,12 @@
     * - include mode : remove any attribute that is not in
     * fractionalConcernedAttributes
     */
    Iterator<AttributeType> attributeTypes = attributesMap.keySet().iterator();
    List<List<Attribute>> newRdnAttrLists = new ArrayList<List<Attribute>>();
    List<AttributeType> rdnAttrTypes = new ArrayList<AttributeType>();
    while (attributeTypes.hasNext())
    final Set<AttributeType> attrTypes = attributesMap.keySet();
    for (Iterator<AttributeType> iter = attrTypes.iterator(); iter.hasNext();)
    {
      AttributeType attributeType = attributeTypes.next();
      AttributeType attributeType = iter.next();
      // Only optional attributes may be removed
      if (isMandatoryAttribute(entryClasses, attributeType)
@@ -1253,11 +1267,8 @@
          // find the attribute/value pair matching the pair in the RDN
        {
          // Construct and store new attribute list
          AttributeBuilder attrBuilder = new AttributeBuilder(attributeType);
          attrBuilder.add(sameAttrValue);
          List<Attribute> newRdnAttrList = new ArrayList<Attribute>();
          newRdnAttrList.add(attrBuilder.toAttribute());
          newRdnAttrLists.add(newRdnAttrList);
          newRdnAttrLists.add(
              newList(Attributes.create(attributeType, sameAttrValue)));
          /*
          Store matching attribute type
          The mapping will be done using object from rdnAttrTypes as key
@@ -1270,7 +1281,7 @@
      else
      {
        // Found an attribute to remove, remove it from the list.
        attributeTypes.remove();
        iter.remove();
        hasSomeAttributesToFilter = true;
      }
    }
@@ -1283,6 +1294,23 @@
    return hasSomeAttributesToFilter;
  }
  private static <T> ArrayList<T> newList(T elem)
  {
    final ArrayList<T> list = new ArrayList<T>(1);
    list.add(elem);
    return list;
  }
  private static <T> Set<T> newSet(T... elems)
  {
    final Set<T> list = new LinkedHashSet<T>(elems.length);
    for (T elem : elems)
    {
      list.add(elem);
    }
    return list;
  }
   private static boolean isMandatoryAttribute(Set<ObjectClass> entryClasses,
       AttributeType attributeType)
   {
@@ -1315,19 +1343,21 @@
    // Now remove the attribute or modification if:
    // - exclusive mode and attribute is in configuration
    // - inclusive mode and attribute is not in configuration
    return canRemoveAttribute(fractionalExclusive, foundAttribute);
  }
  private static boolean canRemoveAttribute(boolean fractionalExclusive,
      boolean foundAttribute)
  {
    return (foundAttribute && fractionalExclusive)
        || (!foundAttribute && !fractionalExclusive);
  }
  private static boolean contains(Set<String> fractionalConcernedAttributes,
      String attributeName, String attributeOid)
  private static boolean contains(Set<String> attrNames, String attrName,
      String attrOID)
  {
    final boolean foundAttribute =
        attributeName != null
            && fractionalConcernedAttributes.contains(attributeName
                .toLowerCase());
    return foundAttribute
        || fractionalConcernedAttributes.contains(attributeOid);
    return attrNames.contains(attrOID)
        || (attrName != null && attrNames.contains(attrName.toLowerCase()));
  }
  /**
@@ -1404,8 +1434,10 @@
      modifiedEntry.getObjectClasses().keySet());
    boolean fractionalExclusive = fractionalConfig.isFractionalExclusive();
    if (fractionalExclusive && fractionalConcernedAttributes.isEmpty())
    {
      // No attributes to filter
      return FRACTIONAL_HAS_NO_FRACTIONAL_FILTERED_ATTRIBUTES;
    }
    // Prepare list of object classes of the modified entry
    DN entryToModifyDn = modifyOperation.getEntryDN();
@@ -1558,8 +1590,8 @@
       * as it was in the original message.
       */
      String operationEntryUUID = ctx.getEntryUUID();
      String modifiedEntryUUID = EntryHistorical.getEntryUUID(deletedEntry);
      if (!operationEntryUUID.equals(modifiedEntryUUID))
      String deletedEntryUUID = getEntryUUID(deletedEntry);
      if (!operationEntryUUID.equals(deletedEntryUUID))
      {
        /*
         * The changes entry is not the same entry as the one on
@@ -1581,7 +1613,7 @@
      // There is no replication context attached to the operation
      // so this is not a replication operation.
      CSN csn = generateCSN(deleteOperation);
      String modifiedEntryUUID = EntryHistorical.getEntryUUID(deletedEntry);
      String modifiedEntryUUID = getEntryUUID(deletedEntry);
      ctx = new DeleteContext(csn, modifiedEntryUUID);
      deleteOperation.setAttachment(SYNCHROCONTEXT, ctx);
@@ -1785,8 +1817,8 @@
       * Check that the modified entry has the same entryuuid
       * as was in the original message.
       */
      String modifiedEntryUUID =
        EntryHistorical.getEntryUUID(modifyDNOperation.getOriginalEntry());
      final String modifiedEntryUUID =
          getEntryUUID(modifyDNOperation.getOriginalEntry());
      if (!modifiedEntryUUID.equals(ctx.getEntryUUID()))
      {
        /*
@@ -1842,7 +1874,7 @@
      }
      Entry modifiedEntry = modifyDNOperation.getOriginalEntry();
      String modifiedEntryUUID = EntryHistorical.getEntryUUID(modifiedEntry);
      String modifiedEntryUUID = getEntryUUID(modifiedEntry);
      ctx = new ModifyDnContext(csn, modifiedEntryUUID, newParentId);
      modifyDNOperation.setAttachment(SYNCHROCONTEXT, ctx);
    }
@@ -1920,8 +1952,7 @@
      // - attach the context to the op
      CSN csn = generateCSN(modifyOperation);
      String modifiedEntryUUID = EntryHistorical.getEntryUUID(modifiedEntry);
      ctx = new ModifyContext(csn, modifiedEntryUUID);
      ctx = new ModifyContext(csn, getEntryUUID(modifiedEntry));
      modifyOperation.setAttachment(SYNCHROCONTEXT, ctx);
    }
@@ -1932,7 +1963,7 @@
      // - check if the entry has been renamed
      // - check for conflicts
      String modifiedEntryUUID = ctx.getEntryUUID();
      String currentEntryUUID = EntryHistorical.getEntryUUID(modifiedEntry);
      String currentEntryUUID = getEntryUUID(modifiedEntry);
      if (currentEntryUUID != null
          && !currentEntryUUID.equals(modifiedEntryUUID))
      {
@@ -1974,12 +2005,12 @@
   *
   * @param addOperation The Add Operation.
   */
  public void doPreOperation(PreOperationAddOperation addOperation)
  void doPreOperation(PreOperationAddOperation addOperation)
  {
    AddContext ctx = new AddContext(generateCSN(addOperation),
        EntryHistorical.getEntryUUID(addOperation),
    final CSN csn = generateCSN(addOperation);
    final String entryUUID = getEntryUUID(addOperation);
    final AddContext ctx = new AddContext(csn, entryUUID,
        findEntryUUID(addOperation.getEntryDN().getParentDNInSuffix()));
    addOperation.setAttachment(SYNCHROCONTEXT, ctx);
  }
@@ -1988,7 +2019,7 @@
   * Also update the list of pending changes and the server RUV
   * @param op the operation
   */
  public void synchronize(PostOperationOperation op)
  void synchronize(PostOperationOperation op)
  {
    ResultCode result = op.getResultCode();
    // Note that a failed non-replication operation might not have a change
@@ -2004,12 +2035,12 @@
    {
      if (op.isSynchronizationOperation())
      { // Replaying a sync operation
        numReplayedPostOpCalled++;
        numReplayedPostOpCalled.incrementAndGet();
        try
        {
          remotePendingChanges.commit(curCSN);
        }
        catch  (NoSuchElementException e)
        catch (NoSuchElementException e)
        {
          logger.error(ERR_OPERATION_NOT_FOUND_IN_PENDING, op, curCSN);
          return;
@@ -2188,8 +2219,7 @@
      boolean markConflict)
  {
    ModifyDNOperation newOp = new ModifyDNOperationBasis(
        conn, InternalClientConnection.nextOperationID(),
        InternalClientConnection.nextMessageID(), new ArrayList<Control>(0),
        conn, nextOperationID(), nextMessageID(), new ArrayList<Control>(0),
        targetDN, newRDN, false, parentDN);
    AttributeType attrType =
@@ -2219,32 +2249,9 @@
  }
  /**
   * Get the number of updates in the pending list.
   *
   * @return The number of updates in the pending list
   */
  private int getPendingUpdatesCount()
  {
    if (pendingChanges != null)
      return pendingChanges.size();
    return 0;
  }
  /**
   * get the number of updates replayed successfully by the replication.
   *
   * @return The number of updates replayed successfully
   */
  private int getNumReplayedPostOpCalled()
  {
    return numReplayedPostOpCalled;
  }
  /**
   * Delete this ReplicationDomain.
   */
  public void delete()
  void delete()
  {
    shutdown();
    removeECLDomainCfg();
@@ -2301,7 +2308,7 @@
   * @param shutdown
   *          whether the server initiated shutdown
   */
  public void replay(LDAPUpdateMsg msg, AtomicBoolean shutdown)
  void replay(LDAPUpdateMsg msg, AtomicBoolean shutdown)
  {
    // Try replay the operation, then flush (replaying) any pending operation
    // whose dependency has been replayed until no more left.
@@ -2461,6 +2468,7 @@
          LocalizableMessage message =
              ERR_EXCEPTION_REPLAYING_OPERATION.get(
                  stackTraceToSingleLineString(e), op);
          logger.error(message);
          replayErrorMsg = message.toString();
          updateError(csn);
        } else
@@ -2541,28 +2549,28 @@
  static String findEntryUUID(DN dn)
  {
    if (dn == null)
    {
      return null;
    }
    try
    {
      InternalClientConnection conn =
                InternalClientConnection.getRootConnection();
      Set<String> attrs = new LinkedHashSet<String>(1);
      attrs.add(ENTRYUUID_ATTRIBUTE_NAME);
      InternalSearchOperation search = conn.processSearch(dn,
            SearchScope.BASE_OBJECT, DereferenceAliasesPolicy.NEVER,
            0, 0, false,
            SearchFilter.createFilterFromString("(objectclass=*)"),
            attrs);
      final Set<String> attrs = newSet(ENTRYUUID_ATTRIBUTE_NAME);
      final InternalSearchOperation search = getRootConnection().processSearch(
          dn, SearchScope.BASE_OBJECT, DereferenceAliasesPolicy.NEVER,
          0, 0, false,
          SearchFilter.createFilterFromString("(objectclass=*)"),
          attrs);
      if (search.getResultCode() == ResultCode.SUCCESS)
      {
        List<SearchResultEntry> result = search.getSearchEntries();
        final List<SearchResultEntry> result = search.getSearchEntries();
        if (!result.isEmpty())
        {
          SearchResultEntry resultEntry = result.get(0);
          final SearchResultEntry resultEntry = result.get(0);
          if (resultEntry != null)
          {
            return EntryHistorical.getEntryUUID(resultEntry);
            return getEntryUUID(resultEntry);
          }
        }
      }
@@ -2589,10 +2597,10 @@
            SearchFilter.createFilterFromString("entryuuid="+uuid));
      if (search.getResultCode() == ResultCode.SUCCESS)
      {
        List<SearchResultEntry> result = search.getSearchEntries();
        if (!result.isEmpty())
        final List<SearchResultEntry> results = search.getSearchEntries();
        if (!results.isEmpty())
        {
          SearchResultEntry resultEntry = result.get(0);
          final SearchResultEntry resultEntry = results.get(0);
          if (resultEntry != null)
          {
            return resultEntry.getName();
@@ -2613,8 +2621,7 @@
   * @param msg The operation that triggered the conflict detection.
   * @return true if the process is completed, false if it must continue..
   */
  private boolean solveNamingConflict(ModifyOperation op,
      ModifyMsg msg)
  private boolean solveNamingConflict(ModifyOperation op, ModifyMsg msg)
  {
    ResultCode result = op.getResultCode();
    ModifyContext ctx = (ModifyContext) op.getAttachment(SYNCHROCONTEXT);
@@ -2702,8 +2709,7 @@
  * @param msg The operation that triggered the conflict detection.
  * @return true if the process is completed, false if it must continue..
  */
 private boolean solveNamingConflict(DeleteOperation op,
     LDAPUpdateMsg msg)
 private boolean solveNamingConflict(DeleteOperation op, LDAPUpdateMsg msg)
 {
   ResultCode result = op.getResultCode();
   DeleteContext ctx = (DeleteContext) op.getAttachment(SYNCHROCONTEXT);
@@ -2721,7 +2727,7 @@
        * The entry has already been deleted, either because this delete
        * has already been replayed or because another concurrent delete
        * has already done the job.
        * In any case, there is is nothing more to do.
        * In any case, there is nothing more to do.
        */
       numResolvedNamingConflicts.incrementAndGet();
       return true;
@@ -2763,7 +2769,7 @@
   }
 }
  /**
/**
 * Solve a conflict detected when replaying a Modify DN operation.
 *
 * @param op The operation that triggered the conflict detection.
@@ -2771,8 +2777,8 @@
 * @return true if the process is completed, false if it must continue.
 * @throws Exception When the operation is not valid.
 */
private boolean solveNamingConflict(ModifyDNOperation op,
    LDAPUpdateMsg msg) throws Exception
private boolean solveNamingConflict(ModifyDNOperation op, LDAPUpdateMsg msg)
    throws Exception
{
  ResultCode result = op.getResultCode();
  ModifyDnContext ctx = (ModifyDnContext) op.getAttachment(SYNCHROCONTEXT);
@@ -2891,8 +2897,8 @@
   * @return true if the process is completed, false if it must continue.
   * @throws Exception When the operation is not valid.
   */
  private boolean solveNamingConflict(AddOperation op,
      AddMsg msg) throws Exception
  private boolean solveNamingConflict(AddOperation op, AddMsg msg)
      throws Exception
  {
    ResultCode result = op.getResultCode();
    AddContext ctx = (AddContext) op.getAttachment(SYNCHROCONTEXT);
@@ -2999,9 +3005,8 @@
    // Find an rename child entries.
    try
    {
      Set<String> attrs = new LinkedHashSet<String>(1);
      attrs.add(EntryHistorical.ENTRYUUID_ATTRIBUTE_NAME);
      attrs.add(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
      final Set<String> attrs =
          newSet(ENTRYUUID_ATTRIBUTE_NAME, HISTORICAL_ATTRIBUTE_NAME);
      InternalSearchOperation op =
          conn.processSearch(entryDN, SearchScope.SINGLE_LEVEL,
@@ -3022,34 +3027,22 @@
             * and keep the entry as a conflicting entry,
             */
            conflict = true;
            renameConflictEntry(conflictOp, entry.getName(),
                EntryHistorical.getEntryUUID(entry));
            renameConflictEntry(conflictOp, entry.getName(), getEntryUUID(entry));
          }
        }
      }
      else
      {
        // log error and information for the REPAIR tool.
        LocalizableMessageBuilder mb = new LocalizableMessageBuilder();
        mb.append(ERR_CANNOT_RENAME_CONFLICT_ENTRY.get());
        mb.append(entryDN);
        mb.append(" ");
        mb.append(conflictOp);
        mb.append(" ");
        mb.append(op.getResultCode());
        logger.error(mb.toMessage());
        logger.error(ERR_CANNOT_RENAME_CONFLICT_ENTRY,
            entryDN, conflictOp, op.getResultCode());
      }
    } catch (DirectoryException e)
    }
    catch (DirectoryException e)
    {
      // log error and information for the REPAIR tool.
      LocalizableMessageBuilder mb = new LocalizableMessageBuilder();
      mb.append(ERR_EXCEPTION_RENAME_CONFLICT_ENTRY.get());
      mb.append(entryDN);
      mb.append(" ");
      mb.append(conflictOp);
      mb.append(" ");
      mb.append(stackTraceToSingleLineString(e));
      logger.error(mb.toMessage());
      logger.error(ERR_EXCEPTION_RENAME_CONFLICT_ENTRY,
          entryDN, conflictOp, stackTraceToSingleLineString(e));
    }
    return conflict;
@@ -3077,14 +3070,8 @@
    if (newOp.getResultCode() != ResultCode.SUCCESS)
    {
      // log information for the repair tool.
      LocalizableMessageBuilder mb = new LocalizableMessageBuilder();
      mb.append(ERR_CANNOT_RENAME_CONFLICT_ENTRY.get());
      mb.append(dn);
      mb.append(" ");
      mb.append(conflictOp);
      mb.append(" ");
      mb.append(newOp.getResultCode());
      logger.error(mb.toMessage());
      logger.error(ERR_CANNOT_RENAME_CONFLICT_ENTRY,
          dn, conflictOp, newOp.getResultCode());
    }
  }
@@ -3103,24 +3090,18 @@
    AttributeType attrType = DirectoryServer.getAttributeType(DS_SYNC_CONFLICT,
        true);
    Attribute attr = Attributes.create(attrType, conflictDN.toNormalizedString());
    List<Modification> mods = new ArrayList<Modification>();
    mods.add(new Modification(ModificationType.REPLACE, attr));
    List<Modification> mods =
        newList(new Modification(ModificationType.REPLACE, attr));
    ModifyOperation newOp = new ModifyOperationBasis(
          conn, InternalClientConnection.nextOperationID(),
          InternalClientConnection.nextMessageID(), new ArrayList<Control>(0),
          conn, nextOperationID(), nextMessageID(), new ArrayList<Control>(0),
          currentDN, mods);
    runAsSynchronizedOperation(newOp);
    if (newOp.getResultCode() != ResultCode.SUCCESS)
    {
      // Log information for the repair tool.
      LocalizableMessageBuilder mb = new LocalizableMessageBuilder();
      mb.append(ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE.get());
      mb.append(op);
      mb.append(" ");
      mb.append(newOp.getResultCode());
      logger.error(mb.toMessage());
      logger.error(ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE, op, newOp.getResultCode());
    }
    // Generate an alert to let the administration know that some
@@ -3189,38 +3170,11 @@
  }
  /**
   * Get the number of modify conflicts successfully resolved.
   * @return The number of modify conflicts successfully resolved.
   */
  private int getNumResolvedModifyConflicts()
  {
    return numResolvedModifyConflicts.get();
  }
  /**
   * Get the number of naming conflicts successfully resolved.
   * @return The number of naming conflicts successfully resolved.
   */
  private int getNumResolvedNamingConflicts()
  {
    return numResolvedNamingConflicts.get();
  }
  /**
   * Get the number of unresolved conflicts.
   * @return The number of unresolved conflicts.
   */
  private int getNumUnresolvedNamingConflicts()
  {
    return numUnresolvedNamingConflicts.get();
  }
  /**
   * Check if the domain solve conflicts.
   *
   * @return a boolean indicating if the domain should solve conflicts.
   */
  public boolean solveConflict()
  boolean solveConflict()
  {
    return solveConflictFlag;
  }
@@ -3249,8 +3203,7 @@
   * and generationId.
   * @exception DirectoryException Thrown when an error occurs.
   */
  protected void loadDataState()
  throws DirectoryException
  private void loadDataState() throws DirectoryException
  {
    state.clearInMemory();
    state.loadState();
@@ -3298,11 +3251,11 @@
   */
  private long computeGenerationId() throws DirectoryException
  {
    long genId = exportBackend(null, true);
    final long genId = exportBackend(null, true);
    if (logger.isTraceEnabled())
    {
      logger.trace("Computed generationId: generationId=" + genId);
    }
    return genId;
  }
@@ -3318,23 +3271,18 @@
  private ResultCode runSaveGenerationId(DN entryDN, long generationId)
  {
    // The generationId is stored in the root entry of the domain.
    ByteString asn1BaseDn = ByteString.valueOf(entryDN.toString());
    final ByteString asn1BaseDn = ByteString.valueOf(entryDN.toString());
    final ArrayList<ByteString> values =
        newList(ByteString.valueOf(Long.toString(generationId)));
    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf(Long.toString(generationId)));
    LDAPAttribute attr =
      new LDAPAttribute(REPLICATION_GENERATION_ID, values);
    LDAPAttribute attr = new LDAPAttribute(REPLICATION_GENERATION_ID, values);
    List<RawModification> mods = new ArrayList<RawModification>(1);
    mods.add(new LDAPModification(ModificationType.REPLACE, attr));
    ModifyOperation op = new ModifyOperationBasis(
          conn, InternalClientConnection.nextOperationID(),
          InternalClientConnection.nextMessageID(),
          new ArrayList<Control>(0), asn1BaseDn,
          mods);
          conn, nextOperationID(), nextMessageID(), new ArrayList<Control>(0),
          asn1BaseDn, mods);
    runAsSynchronizedOperation(op);
    return op.getResultCode();
  }
@@ -3343,10 +3291,9 @@
   * @param generationId The value of the generationId.
   * @return a ResultCode indicating if the method was successful.
   */
  public ResultCode saveGenerationId(long generationId)
  private ResultCode saveGenerationId(long generationId)
  {
    ResultCode result = runSaveGenerationId(getBaseDN(), generationId);
    if (result != ResultCode.SUCCESS)
    {
      generationIdSavedStatus = false;
@@ -3381,15 +3328,16 @@
  private long loadGenerationId() throws DirectoryException
  {
    if (logger.isTraceEnabled())
    {
      logger.trace("Attempt to read generation ID from DB "
          + getBaseDNString());
    }
    /*
     * Search the database entry that is used to periodically
     * save the generation id
     */
    final Set<String> attributes = new LinkedHashSet<String>(1);
    attributes.add(REPLICATION_GENERATION_ID);
    final Set<String> attributes = newSet(REPLICATION_GENERATION_ID);
    final String filter = "(objectclass=*)";
    InternalSearchOperation search = conn.processSearch(getBaseDNString(),
        SearchScope.BASE_OBJECT,
@@ -3457,15 +3405,19 @@
      saveGenerationId(aGenerationId);
      if (logger.isTraceEnabled())
      {
        logger.trace("Generation ID created for domain baseDN="
            + getBaseDNString() + " generationId=" + aGenerationId);
      }
    }
    else
    {
      generationIdSavedStatus = true;
      if (logger.isTraceEnabled())
      {
        logger.trace("Generation ID successfully read from domain baseDN="
            + getBaseDNString() + " generationId=" + aGenerationId);
      }
    }
    return aGenerationId;
  }
@@ -3567,10 +3519,8 @@
    }
    // baseDN branch is the only one included in the export
    List<DN> includeBranches = new ArrayList<DN>(1);
    includeBranches.add(getBaseDN());
    LDIFExportConfig exportConfig = new LDIFExportConfig(os);
    exportConfig.setIncludeBranches(includeBranches);
    exportConfig.setIncludeBranches(newList(getBaseDN()));
    // For the checksum computing mode, only consider the 'stable' attributes
    if (checksumOutput)
@@ -3598,8 +3548,7 @@
    }
    catch (DirectoryException de)
    {
      if (ros == null ||
          ros.getNumExportedEntries() < entryCount)
      if (ros == null || ros.getNumExportedEntries() < entryCount)
      {
        LocalizableMessage message = ERR_LDIFEXPORT_ERROR_DURING_EXPORT.get(de.getMessageObject());
        logger.error(message);
@@ -3699,9 +3648,7 @@
      }
      importConfig = new LDIFImportConfig(input);
      List<DN> includeBranches = new ArrayList<DN>();
      includeBranches.add(getBaseDN());
      importConfig.setIncludeBranches(includeBranches);
      importConfig.setIncludeBranches(newList(getBaseDN()));
      importConfig.setAppendToExistingData(false);
      importConfig.setSkipDNValidation(true);
      // We should not validate schema for replication
@@ -3765,7 +3712,9 @@
    }
    if (ieCtx.getException() != null)
    {
      throw ieCtx.getException();
    }
  }
  /**
@@ -3773,7 +3722,7 @@
   * @param backend The backend implied in the import.
   * @exception DirectoryException Thrown when an error occurs.
   */
  protected void closeBackendImport(Backend backend) throws DirectoryException
  private void closeBackendImport(Backend backend) throws DirectoryException
  {
    String lockFile = LockFileManager.getBackendLockFileName(backend);
    StringBuilder failureReason = new StringBuilder();
@@ -3859,14 +3808,11 @@
   * @param modifications
   *          The modification to push
   */
  public void synchronizeModifications(List<Modification> modifications)
  void synchronizeModifications(List<Modification> modifications)
  {
    ModifyOperation op = new ModifyOperationBasis(
                          InternalClientConnection.getRootConnection(),
                          InternalClientConnection.nextOperationID(),
                          InternalClientConnection.nextMessageID(),
                          null, DirectoryServer.getSchemaDN(),
                          modifications);
        conn, nextOperationID(), nextMessageID(), null,
        DirectoryServer.getSchemaDN(), modifications);
    LocalBackendModifyOperation localOp = new LocalBackendModifyOperation(op);
    CSN csn = generateCSN(localOp);
@@ -3886,8 +3832,8 @@
   *
   * @return true if the configuration is acceptable, false other wise.
   */
  public static boolean isConfigurationAcceptable(
      ReplicationDomainCfg configuration, List<LocalizableMessage> unacceptableReasons)
  static boolean isConfigurationAcceptable(ReplicationDomainCfg configuration,
      List<LocalizableMessage> unacceptableReasons)
  {
    // Check that there is not already a domain with the same DN
    final DN dn = configuration.getBaseDN();
@@ -4125,8 +4071,10 @@
        ECLWorkflowElement wfe = (ECLWorkflowElement)
        DirectoryServer.getWorkflowElement(
            ECLWorkflowElement.ECL_WORKFLOW_ELEMENT);
        if (wfe!=null)
        if (wfe != null)
        {
          wfe.getReplicationServer().enableECL();
        }
      }
      catch (DirectoryException de)
      {
@@ -4198,7 +4146,7 @@
   * @throws Exception
   *           if an Exception happens during the search.
   */
  public boolean buildAndPublishMissingChanges(CSN startCSN,
  boolean buildAndPublishMissingChanges(CSN startCSN,
      ReplicationBroker session, AtomicBoolean shutdown) throws Exception
  {
    // Trim the changes in replayOperations that are older than the startCSN.
@@ -4321,13 +4269,10 @@
      CSN fromCSN, CSN lastCSN, InternalSearchListener resultListener)
      throws Exception
  {
    InternalClientConnection conn =
      InternalClientConnection.getRootConnection();
    Integer serverId = fromCSN.getServerId();
    String maxValueForId;
    if (lastCSN == null)
    {
      final Integer serverId = fromCSN.getServerId();
      maxValueForId = "ffffffffffffffff" + String.format("%04x", serverId)
                      + "ffffffff";
    }
@@ -4340,7 +4285,7 @@
        "(&(" + HISTORICAL_ATTRIBUTE_NAME + ">=dummy:" + fromCSN + ")" +
          "(" + HISTORICAL_ATTRIBUTE_NAME + "<=dummy:" + maxValueForId + "))");
    return conn.processSearch(
    return getRootConnection().processSearch(
      ByteString.valueOf(baseDN.toString()),
      SearchScope.WHOLE_SUBTREE,
      DereferenceAliasesPolicy.NEVER,
@@ -4364,7 +4309,7 @@
   * @throws Exception
   *           when raised.
   */
  public static InternalSearchOperation searchForChangedEntries(DN baseDN,
  static InternalSearchOperation searchForChangedEntries(DN baseDN,
      CSN fromCSN, InternalSearchListener resultListener) throws Exception
  {
    return searchForChangedEntries(baseDN, fromCSN, null, resultListener);
@@ -4465,17 +4410,17 @@
  {
    List<Attribute> attributes = new ArrayList<Attribute>();
    // get number of changes in the pending list
    addMonitorData(attributes, "pending-updates", getPendingUpdatesCount());
    // number of updates in the pending list
    addMonitorData(attributes, "pending-updates", pendingChanges.size());
    addMonitorData(attributes, "replayed-updates-ok",
        getNumReplayedPostOpCalled());
        numReplayedPostOpCalled.get());
    addMonitorData(attributes, "resolved-modify-conflicts",
        getNumResolvedModifyConflicts());
        numResolvedModifyConflicts.get());
    addMonitorData(attributes, "resolved-naming-conflicts",
        getNumResolvedNamingConflicts());
        numResolvedNamingConflicts.get());
    addMonitorData(attributes, "unresolved-naming-conflicts",
        getNumUnresolvedNamingConflicts());
        numUnresolvedNamingConflicts.get());
    addMonitorData(attributes, "remote-pending-changes-size",
        remotePendingChanges.getQueueSize());
@@ -4958,12 +4903,16 @@
     * Get an integer representation of the domain fractional configuration.
     * @return An integer representation of the domain fractional configuration.
     */
    int fractionalConfigToInt()
    private int fractionalConfigToInt()
    {
      if (!fractional)
      {
        return NOT_FRACTIONAL;
      if (fractionalExclusive)
      }
      else if (fractionalExclusive)
      {
        return EXCLUSIVE_FRACTIONAL;
      }
      return INCLUSIVE_FRACTIONAL;
    }
@@ -4976,23 +4925,29 @@
     * @throws ConfigException If some classes or attributes could not be
     * retrieved from the schema.
     */
    static boolean isFractionalConfigEquivalent(FractionalConfig cfg1,
    private static boolean isFractionalConfigEquivalent(FractionalConfig cfg1,
        FractionalConfig cfg2) throws ConfigException
    {
      // Compare base DNs just to be consistent
      if (!cfg1.getBaseDn().equals(cfg2.getBaseDn()))
      {
        return false;
      }
      // Compare modes
      if (cfg1.isFractional() != cfg2.isFractional()
          || cfg1.isFractionalExclusive() != cfg2.isFractionalExclusive())
      {
        return false;
      }
      // Compare all classes attributes
      Set<String> allClassesAttrs1 = cfg1.getFractionalAllClassesAttributes();
      Set<String> allClassesAttrs2 = cfg2.getFractionalAllClassesAttributes();
      if (!areAttributesEquivalent(allClassesAttrs1, allClassesAttrs2))
      {
        return false;
      }
      // Compare specific classes attributes
      Map<String, Set<String>> specificClassesAttrs1 =
@@ -5000,7 +4955,9 @@
      Map<String, Set<String>> specificClassesAttrs2 =
          cfg2.getFractionalSpecificClassesAttributes();
      if (specificClassesAttrs1.size() != specificClassesAttrs2.size())
      {
        return false;
      }
      /*
       * Check consistency of specific classes attributes
@@ -5036,13 +4993,17 @@
            Set<String> attributes1 = specificClassesAttrs1.get(className1);
            Set<String> attributes2 = specificClassesAttrs2.get(className2);
            if (!areAttributesEquivalent(attributes1, attributes2))
            {
              return false;
            }
            break;
          }
        }
        // Found matching class ?
        if (!foundClass)
        {
          return false;
        }
      }
      return true;
@@ -5120,9 +5081,10 @@
         USER_AND_REPL_OPERATIONAL_ATTRS, null);
     int count = 0;
     if (task != null)
     {
       task.setProgressStats(lastCSNPurgedFromHist, count);
     }
     for (SearchResultEntry entry : searchOp.getSearchEntries())
     {
@@ -5138,26 +5100,18 @@
       entryHist.setPurgeDelay(getHistoricalPurgeDelay());
       Attribute attr = entryHist.encodeAndPurge();
       count += entryHist.getLastPurgedValuesCount();
       List<Modification> mods = new LinkedList<Modification>();
       mods.add(new Modification(ModificationType.REPLACE, attr));
       List<Modification> mods =
           newList(new Modification(ModificationType.REPLACE, attr));
       ModifyOperation newOp = new ModifyOperationBasis(
             conn, InternalClientConnection.nextOperationID(),
             InternalClientConnection.nextMessageID(),
             new ArrayList<Control>(0),
             entry.getName(),
             mods);
      runAsSynchronizedOperation(newOp);
           conn, nextOperationID(), nextMessageID(), new ArrayList<Control>(0),
           entry.getName(), mods);
       runAsSynchronizedOperation(newOp);
       if (newOp.getResultCode() != ResultCode.SUCCESS)
       {
         // Log information for the repair tool.
         LocalizableMessageBuilder mb = new LocalizableMessageBuilder();
         mb.append(ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE.get());
         mb.append(newOp);
         mb.append(" ");
         mb.append(newOp.getResultCode());
         logger.error(mb.toMessage());
         logger.error(ERR_CANNOT_ADD_CONFLICT_ATTRIBUTE, newOp, newOp.getResultCode());
       }
       else if (task != null)
       {