use of org.opennms.netmgt.model.ncs.NCSComponentRepository in project opennms by OpenNMS.
the class NCSRestServiceIT method testPostAService.
@Test
public void testPostAService() throws Exception {
setupLogging("DEBUG");
anticipateEvents(EventConstants.COMPONENT_ADDED_UEI);
sendPost("/NCS", m_serviceXML, 200, null);
final NCSComponentRepository repo = m_webApplicationContext.getBean("ncsComponentRepository", NCSComponentRepository.class);
for (final NCSComponent component : repo.findAll()) {
LOG.debug("Found Component: {}/{}/{}", component.getType(), component.getForeignSource(), component.getForeignId());
}
String url = "/NCS/ServiceElementComponent/NA-SvcElemComp:9876%2Cvcid(50)";
// Testing GET Collection
System.err.println("GET!!!");
String xml = sendRequest(GET, url, 200);
assertTrue(xml.contains("jnxVpnPwVpnName"));
}
use of org.opennms.netmgt.model.ncs.NCSComponentRepository in project opennms by OpenNMS.
the class ComponentCommand method doExecute.
@Override
protected Object doExecute() throws Exception {
final ServiceReference<NCSComponentRepository> sr = this.bundleContext.getServiceReference(NCSComponentRepository.class);
if (sr == null)
return null;
final NCSComponentRepository repository = this.bundleContext.getService(sr);
for (final NCSComponent component : repository.findAll()) {
System.out.println(" " + component.toString());
}
System.out.println();
return null;
}
Aggregations