From 7e6a78d2e784007f40c2dc2f73aade1e67d3850a Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 07 Nov 2007 23:58:07 +0000
Subject: [PATCH] Be consistent in dsreplication and the setup with the value we propose to represent the local host fully qualified name.
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java | 7 +++++--
opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java | 11 ++---------
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
index d3657a4..64138aa 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
@@ -32,13 +32,13 @@
import static org.opends.server.tools.ToolConstants.*;
import java.io.OutputStream;
-import java.net.InetAddress;
import java.util.ArrayList;
import java.util.LinkedList;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.opends.quicksetup.Constants;
+import org.opends.quicksetup.UserData;
import org.opends.quicksetup.util.Utils;
import org.opends.server.admin.client.cli.SecureConnectionCliParser;
import org.opends.server.util.args.Argument;
@@ -1905,14 +1905,7 @@
{
if (defaultLocalHostValue == null)
{
- try
- {
- InetAddress localAddress = InetAddress.getLocalHost();
- defaultLocalHostValue = localAddress.getHostName();
- }
- catch (Throwable t)
- {
- }
+ defaultLocalHostValue = UserData.getDefaultHostName();
if (defaultLocalHostValue == null)
{
defaultLocalHostValue = "localhost";
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java
index 37d5227..bc4a967 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java
@@ -600,9 +600,12 @@
}
/**
- * Provides the default host name that will be displayed.
+ * Provides the default host name that will be proposed to the user for the
+ * local host.
+ * @return the default host name that will be proposed to the user for the
+ * local host.
*/
- private String getDefaultHostName()
+ public static String getDefaultHostName()
{
String name = "";
try
--
Gitblit v1.10.0