@Test public void testParseForeignId() { final String[] values = DefaultGraphResultsService.parseResourceId("nodeSource[foreignSource:foreignId].nodeSnmp[]"); assertEquals(3, values.length); assertEquals("nodeSource[foreignSource:foreignId]", values[0]); assertEquals("nodeSnmp", values[1]); assertEquals("", values[2]); }
public static String[] parseResourceId(String resourceId) { try { String parent = resourceId.substring(0, resourceId.indexOf(']') + 1); String child = resourceId.substring(resourceId.indexOf(']') + 2); String childType = child.substring(0, child.indexOf('[')); String childName = child.substring(child.indexOf('[') + 1, child.indexOf(']')); return new String[]{parent, childType, childName}; } catch (Throwable e) { log().warn("Illegally formatted resourceId found in DefaultGraphResultsService: " + resourceId, e); return null; } }
DefaultGraphResultsService implements GraphResultsService, InitializingBean { public static String[] parseResourceId(String resourceId) { try { String parent = resourceId.substring(0, resourceId.indexOf(']') + 1); String child = resourceId.substring(resourceId.indexOf(']') + 2); String childType = child.substring(0, child.indexOf('[')); String childName = child.substring(child.indexOf('[') + 1, child.indexOf(']')); return new String[]{parent, childType, childName}; } catch (Throwable e) { log().warn("Illegally formatted resourceId found in DefaultGraphResultsService: " + resourceId, e); return null; } } }
DefaultGraphResultsService implements GraphResultsService, InitializingBean { public static String[] parseResourceId(String resourceId) { try { String parent = resourceId.substring(0, resourceId.indexOf(']') + 1); String child = resourceId.substring(resourceId.indexOf(']') + 2); String childType = child.substring(0, child.indexOf('[')); String childName = child.substring(child.indexOf('[') + 1, child.indexOf(']')); return new String[]{parent, childType, childName}; } catch (Throwable e) { log().warn("Illegally formatted resourceId found in DefaultGraphResultsService: " + resourceId, e); return null; } } DefaultGraphResultsService(); }
DefaultGraphResultsService implements GraphResultsService, InitializingBean { public static String[] parseResourceId(String resourceId) { try { String parent = resourceId.substring(0, resourceId.indexOf(']') + 1); String child = resourceId.substring(resourceId.indexOf(']') + 2); String childType = child.substring(0, child.indexOf('[')); String childName = child.substring(child.indexOf('[') + 1, child.indexOf(']')); return new String[]{parent, childType, childName}; } catch (Throwable e) { log().warn("Illegally formatted resourceId found in DefaultGraphResultsService: " + resourceId, e); return null; } } DefaultGraphResultsService(); @Override GraphResults findResults(String[] resourceIds, String[] reports, long start, long end, String relativeTime); static String[] parseResourceId(String resourceId); @Override void afterPropertiesSet(); ResourceDao getResourceDao(); void setResourceDao(ResourceDao resourceDao); NodeDao getNodeDao(); void setNodeDao(NodeDao nodeDao); GraphDao getGraphDao(); void setGraphDao(GraphDao graphDao); RrdDao getRrdDao(); void setRrdDao(RrdDao rrdDao); void setEventProxy(EventProxy eventProxy); }
DefaultGraphResultsService implements GraphResultsService, InitializingBean { public static String[] parseResourceId(String resourceId) { try { String parent = resourceId.substring(0, resourceId.indexOf(']') + 1); String child = resourceId.substring(resourceId.indexOf(']') + 2); String childType = child.substring(0, child.indexOf('[')); String childName = child.substring(child.indexOf('[') + 1, child.indexOf(']')); return new String[]{parent, childType, childName}; } catch (Throwable e) { log().warn("Illegally formatted resourceId found in DefaultGraphResultsService: " + resourceId, e); return null; } } DefaultGraphResultsService(); @Override GraphResults findResults(String[] resourceIds, String[] reports, long start, long end, String relativeTime); static String[] parseResourceId(String resourceId); @Override void afterPropertiesSet(); ResourceDao getResourceDao(); void setResourceDao(ResourceDao resourceDao); NodeDao getNodeDao(); void setNodeDao(NodeDao nodeDao); GraphDao getGraphDao(); void setGraphDao(GraphDao graphDao); RrdDao getRrdDao(); void setRrdDao(RrdDao rrdDao); void setEventProxy(EventProxy eventProxy);  }