if (!ul.getSource().getProperties().containsKey(ServiceGraphLayout.WIDTH)) { if (LOG.isLoggable(Level.FINER)) { LOG.fine("Source node on usage link with definition '"+ul.getSource().getService()+"' does not have layout information"); if (!ul.getTarget().getProperties().containsKey(ServiceGraphLayout.WIDTH)) { if (LOG.isLoggable(Level.FINER)) { LOG.fine("Target node on usage link with definition '"+ul.getTarget().getService()+"' does not have layout information"); int x1=(int)(((Integer)ul.getSource().getProperties().get(ServiceGraphLayout.X_POSITION) +(Integer)ul.getSource().getProperties().get(ServiceGraphLayout.WIDTH)) * ratio); int y1=(int)(((Integer)ul.getSource().getProperties().get(ServiceGraphLayout.Y_POSITION)) * ratio); int x2=(int)(((Integer)ul.getTarget().getProperties().get(ServiceGraphLayout.X_POSITION)) * ratio); int y2=(int)(((Integer)ul.getTarget().getProperties().get(ServiceGraphLayout.Y_POSITION)) * ratio); int x3=(int)(((Integer)ul.getTarget().getProperties().get(ServiceGraphLayout.X_POSITION)) * ratio); int y3=(int)(((Integer)ul.getTarget().getProperties().get(ServiceGraphLayout.Y_POSITION) +(Integer)ul.getTarget().getProperties().get(ServiceGraphLayout.HEIGHT)) * ratio); int x4=(int)(((Integer)ul.getSource().getProperties().get(ServiceGraphLayout.X_POSITION) +(Integer)ul.getSource().getProperties().get(ServiceGraphLayout.WIDTH)) * ratio); int y4=(int)(((Integer)ul.getSource().getProperties().get(ServiceGraphLayout.Y_POSITION) +(Integer)ul.getSource().getProperties().get(ServiceGraphLayout.HEIGHT)) * ratio); Severity severity=getInvocationSeverity(ul.getInvocations());
UsageLink ul=new UsageLink(); ul.setSource(sn); ul.setTarget(tsn); ul.getInvocations().add(id); existingul.getInvocations().add(id);
/** * This method returns the usage link associated with the supplied * source and target service nodes. * * @param source The source * @param target The target * @return The usage link, or null if not found */ public UsageLink getUsageLink(ServiceNode source, ServiceNode target) { UsageLink ret=null; for (UsageLink eul : getUsageLinks()) { if (eul.getSource() == source && eul.getTarget() == target) { ret = eul; break; } } return (ret); }
/** * This method returns the description to be used for the * invocation link. * * @param il The invocation link * @return The description */ protected String getDescription(UsageLink ul) { return (ul.getSource().getService().getServiceType() +" -> "+ul.getTarget().getService().getServiceType()); }