/** {@inheritDoc} */ @Override public Set<OnmsMonitoredService> findByApplication(OnmsApplication application) { return application.getMonitoredServices(); }
/** * <p>addMonitoredService</p> * * @param service a {@link org.opennms.netmgt.model.OnmsMonitoredService} object. * @since 1.8.1 */ public void addMonitoredService(OnmsMonitoredService service) { getMonitoredServices().add(service); }
public static Set<String> getReductionKeys(final OnmsApplication application) { Objects.requireNonNull(application); Set<String> reductionKeys = new HashSet<>(); for (OnmsMonitoredService monitoredService : application.getMonitoredServices()) { reductionKeys.addAll(getReductionKeys(monitoredService)); } return reductionKeys; }
@Override public Set<Integer> getNodeIds() { return Collections.unmodifiableSet(m_entity.getMonitoredServices().stream().map(s -> s.getNodeId()).collect(Collectors.toSet())); }
@Override public Set<IpService> getIpServices() { return Collections.unmodifiableSet(m_entity.getMonitoredServices().stream().map(e -> new IpServiceImpl(m_manager, e)).collect(Collectors.toSet())); }
@Override public List<Application> getAllApplications() { return applicationDao.findAll().stream() .map(s -> { Hibernate.initialize(s.getMonitoredServices()); return new ApplicationImpl(this, s); }) .collect(Collectors.toList()); }
@Override public Application getApplicationById(Integer id) { OnmsApplication onmsApplication = getApplicationEntity(id); Hibernate.initialize(onmsApplication.getMonitoredServices()); return new ApplicationImpl(this, onmsApplication); }
for (OnmsApplication application : applications) { final Set<String> reductionKeys = new HashSet<>(); for (OnmsMonitoredService eachService : application.getMonitoredServices()) { reductionKeys.addAll(ReductionKeyHelper.getReductionKeys(eachService));
private void load() { resetContainer(); for (OnmsApplication application : applicationDao.findAll()) { ApplicationVertex applicationVertex = new ApplicationVertex(application); addVertices(applicationVertex); for (OnmsMonitoredService eachMonitoredService : application.getMonitoredServices()) { final ApplicationVertex serviceVertex = new ApplicationVertex(eachMonitoredService); applicationVertex.addChildren(serviceVertex); addVertices(serviceVertex); // connect with application String id = String.format("connection:%s:%s", applicationVertex.getId(), serviceVertex.getId()); Edge edge = new AbstractEdge(getNamespace(), id, applicationVertex, serviceVertex); addEdges(edge); } } }
private void load() { resetContainer(); for (OnmsApplication application : applicationDao.findAll()) { ApplicationVertex applicationVertex = new ApplicationVertex(application); addVertices(applicationVertex); for (OnmsMonitoredService eachMonitoredService : application.getMonitoredServices()) { final ApplicationVertex serviceVertex = new ApplicationVertex(eachMonitoredService); applicationVertex.addChildren(serviceVertex); addVertices(serviceVertex); // connect with application String id = String.format("connection:%s:%s", applicationVertex.getId(), serviceVertex.getId()); Edge edge = new AbstractEdge(getEdgeNamespace(), id, applicationVertex, serviceVertex); addEdges(edge); } } }
private void load() { resetContainer(); for (OnmsApplication application : applicationDao.findAll()) { ApplicationVertex applicationVertex = new ApplicationVertex(application); addVertices(applicationVertex); for (OnmsMonitoredService eachMonitoredService : application.getMonitoredServices()) { final ApplicationVertex serviceVertex = new ApplicationVertex(eachMonitoredService); applicationVertex.addChildren(serviceVertex); addVertices(serviceVertex); // connect with application String id = String.format("connection:%s:%s", applicationVertex.getId(), serviceVertex.getId()); Edge edge = new AbstractEdge(getNamespace(), id, applicationVertex, serviceVertex); addEdges(edge); } } }