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

Violette Roche-Montane
13.37.2013 2df0995642fe74c30c26d72720f1a913b316644b
CR-1837 - OPENDJ-760- mis-leading message displays when attempting to initialize replication and hostSource is typed incorrectly
- removed 'the host/remote server' && fix typo in _ERR_CANNOT_CONNECT_TO_REMOTE_COMMUNICATION
2 files modified
61 ■■■■■ changed files
opendj-sdk/opends/src/messages/messages/quicksetup.properties 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java 57 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/quicksetup.properties
@@ -82,8 +82,8 @@
INFO_CANNOT_CONNECT_TO_REMOTE_GENERIC=Could not connect to %s.  Check that the \
 server is running and that the provided credentials are valid.%nError \
 details:%n%s
SEVERE_ERR_CANNOT_CONNECT_TO_REMOTE_COMMUNICATION=Could not connect to the \
 remote server %s.  Check that the server is running and that is accessible \
SEVERE_ERR_CANNOT_CONNECT_TO_REMOTE_COMMUNICATION=Could not connect to \
 %s. Check that the server is running and that it is accessible \
 from the local machine.  Details: %s
INFO_CANNOT_CONNECT_TO_REMOTE_PERMISSIONS=You do not have enough access \
 rights to read the configuration in %s. %nProvide credentials with enough \
opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -4631,39 +4631,20 @@
    ReplicationCliReturnCode returnValue = SUCCESSFUL_NOP;
    InitialLdapContext ctxSource = null;
    InitialLdapContext ctxDestination = null;
    try
    {
      ctxSource = createAdministrativeContext(uData.getHostNameSource(),
     ctxSource = getAdministrativeContext(uData.getHostNameSource(),
          uData.getPortSource(), useSSL,
          useStartTLS,
          ADSContext.getAdministratorDN(uData.getAdminUid()),
          uData.getAdminPwd(), getConnectTimeout(), getTrustManager());
    }
    catch (NamingException ne)
    {
      String hostPort = getServerRepresentation(uData.getHostNameSource(),
          uData.getPortSource());
      println();
      println(getMessageForException(ne, hostPort));
      LOG.log(Level.SEVERE, "Complete error stack:", ne);
    }
    try
    {
      ctxDestination = createAdministrativeContext(
     ctxDestination = getAdministrativeContext(
          uData.getHostNameDestination(),
          uData.getPortDestination(), useSSL,
          useStartTLS,
          ADSContext.getAdministratorDN(uData.getAdminUid()),
          uData.getAdminPwd(), getConnectTimeout(), getTrustManager());
    }
    catch (NamingException ne)
    {
      String hostPort = getServerRepresentation(uData.getHostNameDestination(),
      uData.getPortDestination());
      println();
      println(getMessageForException(ne, hostPort));
      LOG.log(Level.SEVERE, "Complete error stack:", ne);
    }
    if ((ctxSource != null) && (ctxDestination != null))
    {
      LinkedList<String> baseDNs = uData.getBaseDNs();
@@ -4744,6 +4725,34 @@
    return returnValue;
  }
  private InitialLdapContext getAdministrativeContext(final String host,
      final int port, final boolean useSSL, final boolean useStartTLS,
      final String bindDn, final String pwd, final int connectTimeout,
      final ApplicationTrustManager trustManager)
  {
    InitialLdapContext context = null;
    try
    {
      context = createAdministrativeContext(
          host,
          port,
          useSSL,
          useStartTLS,
          bindDn,
          pwd,
          connectTimeout,
          trustManager);
    }
    catch (NamingException ne)
    {
      final String hostPort = getServerRepresentation(host, port);
      println();
      println(Utils.getMessageForException(ne, hostPort));
      LOG.log(Level.SEVERE, "Complete error stack:", ne);
    }
    return context;
  }
  /**
   * Initializes the contents of a whole topology with the contents of the other
   * using the parameters in the provided InitializeAllReplicationUserData.