Coverage Report - org.mule.tools.visualizer.postprocessors.ExternalSystemPostProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
ExternalSystemPostProcessor
18%
3/17
12%
1/8
5
 
 1  
 /*
 2  
  * $Id: ExternalSystemPostProcessor.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.tools.visualizer.postprocessors;
 12  
 
 13  
 import org.mule.tools.visualizer.components.PostProcessor;
 14  
 import org.mule.tools.visualizer.config.ColorRegistry;
 15  
 import org.mule.tools.visualizer.config.GraphEnvironment;
 16  
 import org.mule.tools.visualizer.processor.TagProcessor;
 17  
 
 18  
 import com.oy.shared.lm.graph.Graph;
 19  
 import com.oy.shared.lm.graph.GraphNode;
 20  
 
 21  4
 public class ExternalSystemPostProcessor implements PostProcessor
 22  
 {
 23  
 
 24  
     public void postProcess(Graph graph, GraphEnvironment env)
 25  
     {
 26  4
         if (env.getConfig().getMappings().size() > 0)
 27  
         {
 28  0
             GraphNode[] nodes = graph.getNodes();
 29  0
             for (int i = 0; i < nodes.length; i++)
 30  
             {
 31  0
                 GraphNode node = nodes[i];
 32  0
                 String ext = env.getConfig().getMappings().getProperty(
 33  
                     node.getInfo().getHeader() + ".external", null);
 34  0
                 if (ext != null)
 35  
                 {
 36  0
                     env.log("Adding External system '" + ext + "'");
 37  
 
 38  0
                     String type = env.getConfig().getMappings().getProperty(
 39  
                         node.getInfo().getHeader() + ".external.type", null);
 40  0
                     GraphNode n = graph.addNode();
 41  0
                     n.getInfo().setShapeEllipse();
 42  0
                     n.getInfo().setCaption(ext);
 43  0
                     n.getInfo().setFillColor(ColorRegistry.COLOR_EXTERNAL);
 44  0
                     if ("server".equalsIgnoreCase(type))
 45  
                     {
 46  0
                         TagProcessor.addEdge(graph, node, n, null, true);
 47  
                     }
 48  
                     else
 49  
                     {
 50  0
                         TagProcessor.addEdge(graph, n, node, null, true);
 51  
                     }
 52  
                 }
 53  
             }
 54  
         }
 55  4
     }
 56  
 
 57  
 }