[ 
https://issues.apache.org/jira/browse/KNOX-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16005310#comment-16005310
 ] 

Larry McCay commented on KNOX-928:
----------------------------------

Hi [~moresandeep] - The patch is looking good.
One area of concern for me is the undeployment of a port mapped topology.
I imagine that the server would probably return a 404 for any requests on the 
mapped port until restart. Upon attempting to restart which may be long after 
the undeployment the server will not be able to start do to the check in 
checkTopologysExist.

I suggest that:

* this be changed to a very clear ERROR level log message but that we not fail 
to start the server.
* checkTopologysExist() be renamed to checkMappedTopologiesExist()
* if we are able to remove the portmapping for an undeployed topology or at 
least log an error for a request to an undeployed topology through the mapping 
that would be good.

{code}
+  /**
+   * Checks whether the topologies defined in gateway-xml as part of Topology
+   * Port mapping feature exists. If it does not throw an exception and quit.
+   *
+   * @param configTopologies
+   * @param topologies
+   * @return
+   * @since 0.13
+   */
+  private void checkTopologysExist(final Map<String, Integer> configTopologies,
+      final Collection<Topology> topologies) throws IOException {
+
+    final List<String> topos = new ArrayList<String>();
+
+    for (final Topology t : topologies) {
+      topos.add(t.getName());
+    }
+
+    for (final String topology : configTopologies.keySet()) {
+
+      /* If the topologies defined in gateway-config.xml are not found in 
gateway */
+      if (!topos.contains(topology)) {
+        log.topologyPortMappingCannotFindTopology(topology);
+        throw new IOException("cannot find topology " + topology);
+      }
+
+    }
+
+  }
{code}

> Topology Port Mapping
> ---------------------
>
>                 Key: KNOX-928
>                 URL: https://issues.apache.org/jira/browse/KNOX-928
>             Project: Apache Knox
>          Issue Type: New Feature
>          Components: Server
>            Reporter: Sandeep More
>            Assignee: Sandeep More
>              Labels: KIP-6
>             Fix For: 0.13.0
>
>         Attachments: KNOX-928.001.patch
>
>
> Instead of having a single "default topology" we can map topologies to
> specific ports and have a dedicated URL without the gateway specific app
> context.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to