UNOMI-124 : Introduction of private (internal address)

Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/98e7419c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/98e7419c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/98e7419c

Branch: refs/heads/feature-UNOMI-117
Commit: 98e7419cbbfa1450127c56bf0e415110417ad098
Parents: d40d3a4
Author: Abdelkader Midani <[email protected]>
Authored: Wed Sep 27 18:30:00 2017 +0200
Committer: Abdelkader Midani <[email protected]>
Committed: Wed Sep 27 18:30:00 2017 +0200

----------------------------------------------------------------------
 .../unomi/router/rest/ExportConfigurationServiceEndPoint.java    | 4 ++--
 .../unomi/router/rest/ImportConfigurationServiceEndPoint.java    | 4 ++--
 services/src/main/resources/OSGI-INF/blueprint/blueprint.xml     | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/98e7419c/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ExportConfigurationServiceEndPoint.java
----------------------------------------------------------------------
diff --git 
a/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ExportConfigurationServiceEndPoint.java
 
b/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ExportConfigurationServiceEndPoint.java
index 9995668..366049f 100644
--- 
a/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ExportConfigurationServiceEndPoint.java
+++ 
b/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ExportConfigurationServiceEndPoint.java
@@ -84,7 +84,7 @@ public class ExportConfigurationServiceEndPoint extends 
AbstractConfigurationSer
         ExportConfiguration exportConfigSaved = 
configurationService.save(exportConfiguration);
         CloseableHttpClient httpClient = HttpClients.createDefault();
         try {
-            HttpPut httpPut = new HttpPut("http://localhost:"; + 
configSharingService.getProperty("internalServerPort") + 
"/configUpdate/exportConfigAdmin");
+            HttpPut httpPut = new 
HttpPut(configSharingService.getProperty("internalServerAddress") + 
"/configUpdate/exportConfigAdmin");
             StringEntity input = new StringEntity(new 
ObjectMapper().writeValueAsString(exportConfigSaved));
             input.setContentType(MediaType.APPLICATION_JSON);
             httpPut.setEntity(input);
@@ -93,7 +93,7 @@ public class ExportConfigurationServiceEndPoint extends 
AbstractConfigurationSer
 
             if (response.getStatusLine().getStatusCode() != 200) {
                 logger.error("Failed to update the running config: Please 
check the acceccibilty to the URI: \n{}",
-                        "http://localhost:"; + 
configSharingService.getProperty("internalServerPort") + 
"/configUpdate/importConfigAdmin");
+                        
configSharingService.getProperty("internalServerAddress") + 
"/configUpdate/importConfigAdmin");
                 logger.error("HTTP Status code returned {}", 
response.getStatusLine().getStatusCode());
                 throw new 
PartialContentException("RUNNING_CONFIG_UPDATE_FAILED");
             }

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/98e7419c/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java
----------------------------------------------------------------------
diff --git 
a/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java
 
b/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java
index 2087e53..7cc6b4e 100644
--- 
a/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java
+++ 
b/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java
@@ -74,7 +74,7 @@ public class ImportConfigurationServiceEndPoint extends 
AbstractConfigurationSer
         ImportConfiguration importConfigSaved = 
configurationService.save(importConfiguration);
         CloseableHttpClient httpClient = HttpClients.createDefault();
         try {
-            HttpPut httpPut = new HttpPut("http://localhost:"; + 
configSharingService.getProperty("internalServerPort") + 
"/configUpdate/importConfigAdmin");
+            HttpPut httpPut = new 
HttpPut(configSharingService.getProperty("internalServerAddress") + 
"/configUpdate/importConfigAdmin");
             StringEntity input = new StringEntity(new 
ObjectMapper().writeValueAsString(importConfigSaved));
             input.setContentType(MediaType.APPLICATION_JSON);
             httpPut.setEntity(input);
@@ -83,7 +83,7 @@ public class ImportConfigurationServiceEndPoint extends 
AbstractConfigurationSer
 
             if (response.getStatusLine().getStatusCode() != 200) {
                 logger.error("Failed to update the running config: Please 
check the accessibility to the URI: \n{}",
-                        "http://localhost:"; + 
configSharingService.getProperty("internalServerPort") + 
"/configUpdate/importConfigAdmin");
+                        
configSharingService.getProperty("internalServerAddress") + 
"/configUpdate/importConfigAdmin");
                 logger.error("HTTP Status code returned {}", 
response.getStatusLine().getStatusCode());
                 throw new 
PartialContentException("RUNNING_CONFIG_UPDATE_FAILED");
             }

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/98e7419c/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
----------------------------------------------------------------------
diff --git a/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml 
b/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index fafb5fd..75fbc01 100644
--- a/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -230,7 +230,7 @@
     <bean id="configSharingServiceImpl" 
class="org.apache.unomi.services.services.ConfigSharingServiceImpl" 
destroy-method="preDestroy">
         <property name="configProperties">
             <map>
-                <entry key="internalServerPort" 
value="${cluster.contextserver.port}" />
+                <entry key="internalServerAddress" 
value="${cluster.contextserver.internalAddress}" />
             </map>
         </property>
         <property name="bundleContext" ref="blueprintBundleContext"/>

Reply via email to