karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anierb...@apache.org
Subject svn commit: r1466407 - in /karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud: BlobStoreDiscoveryService.java ServiceContainer.java
Date Wed, 10 Apr 2013 09:40:36 GMT
Author: anierbeck
Date: Wed Apr 10 09:40:36 2013
New Revision: 1466407

URL: http://svn.apache.org/r1466407
Log:
[KARAF-2262] - cellar-cloud: The IP is not enough, sometimes the IP is hidden but a valid
dns name is available
-----
reverted parts of it, it looks a lot like IP is better used since the host name is not really
fully qualified

Modified:
    karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java
    karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/ServiceContainer.java

Modified: karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java?rev=1466407&r1=1466406&r2=1466407&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java
(original)
+++ karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java
Wed Apr 10 09:40:36 2013
@@ -119,7 +119,7 @@ public class BlobStoreDiscoveryService i
             	DateTime registeredTime = serviceContainer.getRegisteredTime();
             	if (registeredTime != null && registeredTime.plusSeconds(validityPeriod).isAfterNow())
{
             		LOGGER.debug("CELLAR CLOUD: adding member {} for IP {}", serviceContainer.getHostName(),
ip);
-                    members.add(serviceContainer.getHostName());
+                    members.add(serviceContainer.getHostIp());
                 } else {
                 	LOGGER.debug("CELLAR CLOUD: remove container {}", ip);
                     blobStore.removeBlob(container, ip);
@@ -135,7 +135,7 @@ public class BlobStoreDiscoveryService i
      */
     public void signIn() {
         DateTime now = new DateTime();
-        createBlob(container, ipAddress, new ServiceContainer(getHostAdress(),now));
+        createBlob(container, ipAddress, new ServiceContainer(getHostAdress(), getIpAddress(),
now));
     }
 
     /**
@@ -143,7 +143,7 @@ public class BlobStoreDiscoveryService i
      */
     public void refresh() {
         DateTime now = new DateTime();
-        createBlob(container, ipAddress, new ServiceContainer(getHostAdress(),now));
+        createBlob(container, ipAddress, new ServiceContainer(getHostAdress(), getIpAddress(),
now));
     }
 
     /**

Modified: karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/ServiceContainer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/ServiceContainer.java?rev=1466407&r1=1466406&r2=1466407&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/ServiceContainer.java
(original)
+++ karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/ServiceContainer.java
Wed Apr 10 09:40:36 2013
@@ -27,6 +27,8 @@ public class ServiceContainer implements
 	private DateTime registeredTime;
 	private String hostName;
 
+	private String hostIp;
+
 	public DateTime getRegisteredTime() {
 		return registeredTime;
 	}
@@ -35,8 +37,13 @@ public class ServiceContainer implements
 		return hostName;
 	}
 	
-	public ServiceContainer(String hostName, DateTime registeredTime) {
+	public String getHostIp() {
+		return hostIp;
+	}
+
+	public ServiceContainer(String hostName, String hostIp, DateTime registeredTime) {
 		this.registeredTime = registeredTime;
 		this.hostName = hostName;
+		this.hostIp = hostIp;
 	}
 }



Mime
View raw message