001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008 Sun Microsystems, Inc.
025 *      Portions Copyright 2011-2015 ForgeRock AS
026 */
027package org.opends.server.replication.server;
028
029import org.opends.server.api.DirectoryThread;
030
031/**
032 * This Class is used to create a thread that is responsible for listening
033 * on the Replication Server thread and accept new incoming connections
034 * from other replication servers or from LDAP servers.
035 */
036public class ReplicationServerListenThread extends DirectoryThread
037{
038  /**
039   * The Replication Server that created this thread.
040   */
041  private final ReplicationServer server;
042
043  /**
044   * Creates a new instance of this directory thread with the
045   * specified name.
046   *
047   * @param  server      The ReplicationServer that will be called to
048   *                     handle the connections.
049   */
050  public ReplicationServerListenThread(ReplicationServer server)
051  {
052    super("Replication server RS(" + server.getServerId()
053        + ") connection listener on port "
054        + server.getReplicationPort());
055    this.server = server;
056  }
057
058  /** {@inheritDoc} */
059  @Override
060  public void run()
061  {
062    server.runListen();
063  }
064}