@Transient @XmlTransient @JsonIgnore public String getForeignSource() { if (getIpInterface() != null) { return getIpInterface().getForeignSource(); } return null; }
@Transient @XmlTransient @JsonIgnore public String getForeignId() { if (getIpInterface() != null) { return getIpInterface().getForeignId(); } return null; } }
@Override public void visitMonitoredService(OnmsMonitoredService monSvc) { scheduleInterface(monSvc.getIpInterface(), monSvc.getServiceName(), existing); }
private void updateParent(final OnmsMonitoredService svc) { if (svc.getIpInterface() != null && svc.getIpInterface().getId() != null) { final OnmsIpInterface iface = getIpInterfaceDao().get(svc.getIpInterface().getId()); if (iface != null && iface != svc.getIpInterface()) { LOG.debug("merging interface {} into interface {}", svc.getIpInterface(), iface); iface.mergeInterface(svc.getIpInterface(), new NullEventForwarder(), false); svc.setIpInterface(iface); } if (!svc.getIpInterface().getMonitoredServices().contains(svc)) { svc.getIpInterface().addMonitoredService(svc); } } }
private void updateParent(final OnmsMonitoredService svc) { if (svc.getIpInterface() != null && svc.getIpInterface().getId() != null) { final OnmsIpInterface iface = getIpInterfaceDao().get(svc.getIpInterface().getId()); if (iface != null && iface != svc.getIpInterface()) { LOG.debug("merging interface {} into interface {}", svc.getIpInterface(), iface); iface.mergeInterface(svc.getIpInterface(), new NullEventForwarder(), false); svc.setIpInterface(iface); } if (!svc.getIpInterface().getMonitoredServices().contains(svc)) { svc.getIpInterface().addMonitoredService(svc); } } }
/** * <p>getForeignSource</p> * * @return a {@link java.lang.String} object. */ @Transient @XmlElement(name="foreignSource") public String getForeignSource(){ return getMonitoredService().getIpInterface().getNode().getForeignSource(); }
/** * This method is necessary for CXF to be able to introspect * the type of {@link OnmsNode} parameters. * * @return a {@link OnmsNode} object. */ @Transient @XmlTransient @JsonIgnore public OnmsNode getNode() { return getMonitoredService().getIpInterface().getNode(); }
/** * <p>getNodeLabel</p> * * @return a {@link java.lang.String} object. */ @Transient @XmlElement(name="nodeLabel") public String getNodeLabel(){ return getMonitoredService().getIpInterface().getNode().getLabel(); }
/** * <p>getForeignId</p> * * @return a {@link java.lang.String} object. */ @Transient @XmlElement(name="foreignId") public String getForeignId(){ return getMonitoredService().getIpInterface().getNode().getForeignId(); }
/** * Returns true if the specified service's interface is included by at least one * package which has the specified service and that service is enabled (set * to "on"). * * @param service * {@link OnmsMonitoredService} to check * @return true if Collectd config contains a package which includes the * specified interface and has the specified service enabled. */ public boolean isServiceCollectionEnabled(final OnmsMonitoredService service) { return isServiceCollectionEnabled(service.getIpInterface(), service.getServiceName()); }
/** * <p>getLocationName</p> * * @return a {@link java.lang.String} object. */ @Transient @XmlElement(name="locationName") public String getLocationName(){ return getMonitoredService().getIpInterface().getNode().getLocation().getLocationName(); }
/** {@inheritDoc} */ @Override public ServiceEditModel findServiceApplications(String ifServiceIdString) { if (ifServiceIdString == null) { throw new IllegalArgumentException("ifServiceIdString must not be null"); } OnmsMonitoredService service = findService(ifServiceIdString); List<OnmsApplication> applications = findAllApplications(); m_monitoredServiceDao.initialize(service.getIpInterface()); m_monitoredServiceDao.initialize(service.getIpInterface().getNode()); return new ServiceEditModel(service, applications); }
/** {@inheritDoc} */ @Override public ServiceEditModel findServiceApplications(String ifServiceIdString) { if (ifServiceIdString == null) { throw new IllegalArgumentException("ifServiceIdString must not be null"); } OnmsMonitoredService service = findService(ifServiceIdString); List<OnmsApplication> applications = findAllApplications(); m_monitoredServiceDao.initialize(service.getIpInterface()); m_monitoredServiceDao.initialize(service.getIpInterface().getNode()); return new ServiceEditModel(service, applications); }
@Override public Collection<LocationMonitorIpInterface> findStatusChangesForNodeForUniqueMonitorAndInterface(final int nodeId) { final Set<LocationMonitorIpInterface> ifaces = new HashSet<>(); for (final OnmsLocationSpecificStatus status : m_statuses) { if (status.getMonitoredService().getNodeId() == nodeId) { ifaces.add(new LocationMonitorIpInterface(status.getLocationMonitor(), status.getMonitoredService().getIpInterface())); } } return ifaces; }
@Override public OnmsMonitoredService getPrimaryService(final Integer nodeId, final String svcName) { for (final OnmsMonitoredService svc : findAll()) { if (svc.getNodeId() == nodeId && svcName.equals(svc.getServiceName()) && svc.getIpInterface().isPrimary()) { return svc; } } return null; }
@Override public OnmsMonitoredService getPrimaryService(final Integer nodeId, final String svcName) { for (final OnmsMonitoredService svc : findAll()) { if (svc.getNodeId() == nodeId && svcName.equals(svc.getServiceName()) && svc.getIpInterface().isPrimary()) { return svc; } } return null; }
@Override public Collection<LocationMonitorIpInterface> findStatusChangesForNodeForUniqueMonitorAndInterface(final int nodeId) { final Set<LocationMonitorIpInterface> ifaces = new HashSet<>(); for (final OnmsLocationSpecificStatus status : m_statuses) { if (status.getMonitoredService().getNodeId() == nodeId) { ifaces.add(new LocationMonitorIpInterface(status.getLocationMonitor(), status.getMonitoredService().getIpInterface())); } } return ifaces; }
@Override public int compare(OnmsMonitoredService o1, OnmsMonitoredService o2) { int diff; diff = o1.getIpInterface().getNode().getLabel().compareToIgnoreCase(o2.getIpInterface().getNode().getLabel()); if (diff != 0) { return diff; } diff = toInteger(o1.getIpAddress()).compareTo(toInteger(o2.getIpAddress())); if (diff != 0) { return diff; } return o1.getServiceName().compareToIgnoreCase(o2.getServiceName()); } }
/** {@inheritDoc} */ public void visitMonitoredService(OnmsMonitoredService monSvc) { OnmsIpInterface iface = monSvc.getIpInterface(); OnmsNode node = iface.getNode(); m_events.add(EventUtils.createNodeGainedServiceEvent("ModelImporter", monSvc.getNodeId().intValue(), iface.getIpAddress(), monSvc.getServiceType().getName(), node.getLabel(), node.getLabelSource(), node.getSysName(), node.getSysDescription())); } }
public OnmsMonitoredServiceDetail(OnmsMonitoredService service) { m_nodeLabel = service.getIpInterface().getNode().getLabel(); m_ipAddress = service.getIpAddress(); m_serviceName = service.getServiceName(); m_isMonitored = "A".equals(service.getStatus()); m_isDown = service.isDown(); m_statusCode = service.getStatus(); m_status = service.getStatusLong(); m_id = service.getXmlId(); }