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

jvergara
26.57.2007 486ffa6d0abfa0b91dc7ab22ee71758b5eecfb88
opends/src/ads/org/opends/admin/ads/ServerDescriptor.java
@@ -113,6 +113,10 @@
     */
    IS_REPLICATION_ENABLED,
    /**
     * The associated value is a Boolean.
     */
    IS_REPLICATION_SECURE,
    /**
     * List of servers specified in the Replication Server configuration.
     * This is a Set of String.
     */
@@ -245,6 +249,27 @@
  }
  /**
   * Returns whether the communication with the replication port on the server
   * is encrypted or not.
   * @return <CODE>true</CODE> if the communication with the replication port on
   * the server is encrypted and <CODE>false</CODE> otherwise.
   */
  public boolean isReplicationSecure()
  {
    boolean isReplicationSecure;
    if (isReplicationServer())
    {
      isReplicationSecure = Boolean.TRUE.equals(serverProperties.get(
          ServerProperty.IS_REPLICATION_SECURE));
    }
    else
    {
      isReplicationSecure = false;
    }
    return isReplicationSecure;
  }
  /**
   * Sets the ADS properties of the server.
   * @param adsProperties a Map containing the ADS properties of the server.
   */
@@ -873,6 +898,30 @@
      {
      }
    }
    boolean replicationSecure = false;
    if (replicationEnabled)
    {
      ctls = new SearchControls();
      ctls.setSearchScope(SearchControls.OBJECT_SCOPE);
      ctls.setReturningAttributes(
      new String[] {"ds-cfg-ssl-encryption"});
      filter = "(objectclass=ds-cfg-crypto-manager)";
      jndiName = new LdapName("cn=Crypto Manager,cn=config");
      NamingEnumeration entries = ctx.search(jndiName, filter, ctls);
      while(entries.hasMore())
      {
        SearchResult sr = (SearchResult)entries.next();
        String v = getFirstValue(sr, "ds-cfg-ssl-encryption");
        replicationSecure = "true".equalsIgnoreCase(v);
      }
    }
    desc.serverProperties.put(ServerProperty.IS_REPLICATION_SECURE,
        replicationSecure ? Boolean.TRUE : Boolean.FALSE);
  }
  /**