| | |
| | | package org.opends.server.replication.server; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import static org.opends.server.loggers.debug.DebugLogger.getTracer; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import static org.opends.server.messages.ReplicationMessages.*; |
| | | |
| | |
| | | import java.util.NoSuchElementException; |
| | | |
| | | import org.opends.server.api.DirectoryThread; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.replication.protocol.ProtocolSession; |
| | | import org.opends.server.replication.protocol.UpdateMessage; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | |
| | | */ |
| | | public class ServerWriter extends DirectoryThread |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | private ProtocolSession session; |
| | | private ServerHandler handler; |
| | | private ReplicationCache replicationCache; |
| | | private short serverId; |
| | | |
| | | /** |
| | | * Create a ServerWriter. |
| | |
| | | { |
| | | super(handler.toString() + " writer"); |
| | | |
| | | this.serverId = serverId; |
| | | this.session = session; |
| | | this.handler = handler; |
| | | this.replicationCache = replicationCache; |
| | |
| | | */ |
| | | public void run() |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | if (handler.isReplicationServer()) |
| | | { |
| | | TRACER.debugInfo("Replication server writer starting " + serverId); |
| | | } |
| | | else |
| | | { |
| | | TRACER.debugInfo("LDAP server writer starting " + serverId); |
| | | } |
| | | } |
| | | try { |
| | | while (true) |
| | | { |
| | |
| | | // Can't do much more : ignore |
| | | } |
| | | replicationCache.stopServer(handler); |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | if (handler.isReplicationServer()) |
| | | { |
| | | TRACER.debugInfo("Replication server writer stopping " + serverId); |
| | | } |
| | | else |
| | | { |
| | | TRACER.debugInfo("LDAP server writer stopping " + serverId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |