/** {@inheritDoc} */ @Override public InputStream getPrefabGraph(ResourceId resourceId, String report, long start, long end, Integer width, Integer height) { Assert.notNull(resourceId, "resourceId argument cannot be null"); Assert.notNull(report, "report argument cannot be null"); Assert.isTrue(end > start, "end time " + end + " must be after start time" + start); PrefabGraphType t = m_graphDao.findPrefabGraphTypeByName("performance"); if (t == null) { throw new IllegalArgumentException("graph type \"" + "performance" + "\" is not valid"); } OnmsResource r = m_resourceDao.getResourceById(resourceId); Assert.notNull(r, "resource could not be located"); PrefabGraph prefabGraph = m_graphDao.getPrefabGraph(report); Graph graph = new Graph(prefabGraph, r, new Date(start), new Date(end)); String command = createPrefabCommand(graph, t.getCommandPrefix(), report, width, height); return getInputStreamForCommand(command); }
/** {@inheritDoc} */ @Override public InputStream getPrefabGraph(ResourceId resourceId, String report, long start, long end, Integer width, Integer height) { Assert.notNull(resourceId, "resourceId argument cannot be null"); Assert.notNull(report, "report argument cannot be null"); Assert.isTrue(end > start, "end time " + end + " must be after start time" + start); PrefabGraphType t = m_graphDao.findPrefabGraphTypeByName("performance"); if (t == null) { throw new IllegalArgumentException("graph type \"" + "performance" + "\" is not valid"); } OnmsResource r = m_resourceDao.getResourceById(resourceId); Assert.notNull(r, "resource could not be located"); PrefabGraph prefabGraph = m_graphDao.getPrefabGraph(report); Graph graph = new Graph(prefabGraph, r, new Date(start), new Date(end)); String command = createPrefabCommand(graph, t.getCommandPrefix(), report, width, height); return getInputStreamForCommand(command); }