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

Jean-Noel Rouvignac
19.27.2013 c7077670daca3b689ed75e4bf71dad0483af8473
opends/src/server/org/opends/server/replication/server/ServerHandler.java
@@ -155,12 +155,12 @@
  // window
  private int rcvWindow;
  private int rcvWindowSizeHalf;
  private final int rcvWindowSizeHalf;
  /**
   * The size of the receiving window.
   */
  protected int maxRcvWindow;
  protected final int maxRcvWindow;
  /**
   * Semaphore that the writer uses to control the flow to the remote server.
   */
@@ -288,7 +288,7 @@
   *
   * @throws IOException when the session becomes unavailable.
   */
  public synchronized void decAndCheckWindow() throws IOException
  private synchronized void decAndCheckWindow() throws IOException
  {
    rcvWindow--;
    checkWindow();
@@ -318,8 +318,7 @@
   * and monitoring system.
   * @throws DirectoryException When an exception is raised.
   */
  protected void finalizeStart()
  throws DirectoryException
  protected void finalizeStart() throws DirectoryException
  {
    // FIXME:ECL We should refactor so that a SH always have a session
    if (session != null)
@@ -906,11 +905,10 @@
  /**
   * Process the reception of a WindowProbeMsg message.
   *
   * @param  windowProbeMsg The message to process.
   *
   * @throws IOException    When the session becomes unavailable.
   * @throws IOException
   *           When the session becomes unavailable.
   */
  public void process(WindowProbeMsg windowProbeMsg) throws IOException
  public void replyToWindowProbe() throws IOException
  {
    if (rcvWindow > 0)
    {
@@ -1250,6 +1248,7 @@
   */
  public void put(UpdateMsg update) throws IOException
  {
    decAndCheckWindow();
    if (replicationServerDomain!=null)
      replicationServerDomain.put(update, this);
  }
@@ -1262,4 +1261,18 @@
    if (replicationServerDomain!=null)
      replicationServerDomain.stopServer(this, false);
  }
  /**
   * Creates a ReplServerStartMsg for the current ServerHandler.
   *
   * @return a new ReplServerStartMsg for the current ServerHandler.
   */
  protected ReplServerStartMsg createReplServerStartMsg()
  {
    return new ReplServerStartMsg(getReplicationServerId(),
        getReplicationServerURL(), getBaseDN(), maxRcvWindow,
        replicationServerDomain.getDbServerState(), localGenerationId,
        sslEncryption, getLocalGroupId(),
        replicationServer.getDegradedStatusThreshold());
  }
}