stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject stratos git commit: Removing port mapping name validation and generating name value by concatenating protocol and port
Date Wed, 24 Jun 2015 08:54:29 GMT
Repository: stratos
Updated Branches:
  refs/heads/master ba6f30ea9 -> 82e50a897


Removing port mapping name validation and generating name value by concatenating protocol
and port


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/82e50a89
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/82e50a89
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/82e50a89

Branch: refs/heads/master
Commit: 82e50a897a7f1c0d0b3f3567e25066fd2f542200
Parents: ba6f30e
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Wed Jun 24 14:24:02 2015 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Wed Jun 24 14:24:24 2015 +0530

----------------------------------------------------------------------
 .../apache/stratos/rest/endpoint/api/StratosApiV41Utils.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/82e50a89/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 1a80bc2..0d685bf 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -129,8 +129,12 @@ public class StratosApiV41Utils {
 
             for(PortMappingBean portMapping : cartridgeBean.getPortMapping()) {
                 if(StringUtils.isBlank(portMapping.getName())) {
-                    throw new RestAPIException(String.format("A name is required for each
port mapping: " +
-                            "[cartridge] %s", cartridgeBean.getType()));
+                    portMapping.setName(portMapping.getProtocol() + "-" + portMapping.getPort());
+                    if(log.isInfoEnabled()) {
+                        log.info(String.format("Port mapping name not found, default value
generated: " +
+                                        "[cartridge-type] %s [port-mapping-name] %s",
+                                cartridgeBean.getType(), portMapping.getName()));
+                    }
                 }
             }
 


Mime
View raw message