| | |
| | | import org.opends.server.core.ModifyOperationBasis; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.asn1.ASN1Exception; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchListener; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeBuilder; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.AttributeValues; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.Control; |
| | | import org.opends.server.types.DN; |
| | |
| | | |
| | | // The update to replay message queue where the listener thread is going to |
| | | // push incoming update messages. |
| | | private LinkedBlockingQueue<UpdateToReplay> updateToReplayQueue; |
| | | private AtomicInteger numResolvedNamingConflicts = new AtomicInteger(); |
| | | private AtomicInteger numResolvedModifyConflicts = new AtomicInteger(); |
| | | private AtomicInteger numUnresolvedNamingConflicts = new AtomicInteger(); |
| | | private int debugCount = 0; |
| | | private final LinkedBlockingQueue<UpdateToReplay> updateToReplayQueue; |
| | | private final AtomicInteger numResolvedNamingConflicts = new AtomicInteger(); |
| | | private final AtomicInteger numResolvedModifyConflicts = new AtomicInteger(); |
| | | private final AtomicInteger numUnresolvedNamingConflicts = |
| | | new AtomicInteger(); |
| | | private final int debugCount = 0; |
| | | private final PersistentServerState state; |
| | | private int numReplayedPostOpCalled = 0; |
| | | |
| | | private long generationId = -1; |
| | | private boolean generationIdSavedStatus = false; |
| | | |
| | | private ChangeNumberGenerator generator; |
| | | private final ChangeNumberGenerator generator; |
| | | |
| | | /** |
| | | * This object is used to store the list of update currently being |
| | |
| | | * correct order to the replication server and that the ServerState |
| | | * is not updated too early. |
| | | */ |
| | | private PendingChanges pendingChanges; |
| | | private final PendingChanges pendingChanges; |
| | | |
| | | /** |
| | | * It contain the updates that were done on other servers, transmitted |
| | |
| | | * are correctly fulfilled and to to make sure that the ServerState is |
| | | * not updated too early. |
| | | */ |
| | | private RemotePendingChanges remotePendingChanges; |
| | | private final RemotePendingChanges remotePendingChanges; |
| | | |
| | | private short serverId; |
| | | private final short serverId; |
| | | |
| | | private DN baseDn; |
| | | private final DN baseDn; |
| | | |
| | | private boolean shutdown = false; |
| | | |
| | | private InternalClientConnection conn = |
| | | private final InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | private boolean solveConflictFlag = true; |
| | |
| | | |
| | | // This list is used to temporary store operations that needs |
| | | // to be replayed at session establishment time. |
| | | private TreeSet<FakeOperation> replayOperations = |
| | | private final TreeSet<FakeOperation> replayOperations = |
| | | new TreeSet<FakeOperation>(new FakeOperationComparator());; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * The DN of the configuration entry of this domain. |
| | | */ |
| | | private DN configDn; |
| | | private final DN configDn; |
| | | |
| | | /** |
| | | * A boolean indicating if the thread used to save the persistentServerState |
| | |
| | | * different operation. |
| | | */ |
| | | op = msg.createOperation(conn); |
| | | if (op instanceof DeleteOperation) |
| | | op.addRequestControl(new SubtreeDeleteControl()); |
| | | if (op instanceof DeleteOperation) { |
| | | op.addRequestControl(new SubtreeDeleteControl(false)); |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | |
| | | AttributeType attrType = DirectoryServer.getAttributeType(DS_SYNC_CONFLICT, |
| | | true); |
| | | Attribute attr = Attributes.create(attrType, new AttributeValue( |
| | | Attribute attr = Attributes.create(attrType, AttributeValues.create( |
| | | attrType, conflictDN.toString())); |
| | | List<Modification> mods = new ArrayList<Modification>(); |
| | | Modification mod = new Modification(ModificationType.REPLACE, attr); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getGenerationID() |
| | | { |
| | | return generationId; |
| | |
| | | public ResultCode saveGenerationId(long generationId) |
| | | { |
| | | // The generationId is stored in the root entry of the domain. |
| | | ASN1OctetString asn1BaseDn = new ASN1OctetString(baseDn.toString()); |
| | | ByteString asn1BaseDn = ByteString.valueOf(baseDn.toString()); |
| | | |
| | | ArrayList<ASN1OctetString> values = new ArrayList<ASN1OctetString>(); |
| | | ASN1OctetString value = new ASN1OctetString(Long.toString(generationId)); |
| | | ArrayList<ByteString> values = new ArrayList<ByteString>(); |
| | | ByteString value = ByteString.valueOf(Long.toString(generationId)); |
| | | values.add(value); |
| | | |
| | | LDAPAttribute attr = |
| | |
| | | TRACER.debugInfo( |
| | | "Attempt to read generation ID from DB " + baseDn.toString()); |
| | | |
| | | ASN1OctetString asn1BaseDn = new ASN1OctetString(baseDn.toString()); |
| | | ByteString asn1BaseDn = ByteString.valueOf(baseDn.toString()); |
| | | boolean found = false; |
| | | LDAPFilter filter; |
| | | try |
| | |
| | | found=true; |
| | | try |
| | | { |
| | | generationId = Long.decode(attr.iterator().next(). |
| | | getStringValue()); |
| | | generationId = Long.decode(attr.iterator().next().toString()); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | |
| | | * be produced. |
| | | * @throws DirectoryException When needed. |
| | | */ |
| | | @Override |
| | | protected void exportBackend(OutputStream output) throws DirectoryException |
| | | { |
| | | exportBackend(output, false); |
| | |
| | | * @param input The InputStream from which |
| | | * @throws DirectoryException When needed. |
| | | */ |
| | | @Override |
| | | public void importBackend(InputStream input) throws DirectoryException |
| | | { |
| | | LDIFImportConfig importConfig = null; |
| | |
| | | attrs.add(Historical.ENTRYUIDNAME); |
| | | attrs.add("*"); |
| | | return conn.processSearch( |
| | | new ASN1OctetString(baseDn.toString()), |
| | | ByteString.valueOf(baseDn.toString()), |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | 0, 0, false, filter, |
| | |
| | | * |
| | | * @return The number of objects in the replication domain. |
| | | */ |
| | | @Override |
| | | public long countEntries() throws DirectoryException |
| | | { |
| | | Backend backend = retrievesBackend(baseDn); |
| | |
| | | * |
| | | * @return Monitoring attributes specific to the LDAPReplicationDomain. |
| | | */ |
| | | @Override |
| | | public Collection<Attribute> getAdditionalMonitoring() |
| | | { |
| | | ArrayList<Attribute> attributes = new ArrayList<Attribute>(); |