/** * Returns the name to which the given node is associated, or null if the if node * is associated to either the default location, or no location. * * @param node * @return */ public static String getLocationNameOrNullIfDefault(OnmsNode node) { final String locationName = node.getLocation() != null ? node.getLocation().getLocationName() : null; return isDefaultLocationName(locationName) ? null : locationName; }
@Override public List<OnmsNode> findByForeignIdForLocation(String foreignId, String location) { List<OnmsNode> nodes = new ArrayList<OnmsNode>(); for (final OnmsNode node : findAll()) { if (node.getLabel().equals(foreignId) && (node.getLocation().getLocationName().equals(location))) { nodes.add(node); } } return nodes; }
@Override public List<OnmsNode> findByLabelForLocation(String label, String location) { List<OnmsNode> nodes = new ArrayList<OnmsNode>(); for (final OnmsNode node : findAll()) { if (node.getLabel().equals(label) && (node.getLocation().getLocationName().equals(location))) { nodes.add(node); } } return nodes; }
@Override public List<OnmsNode> findByForeignIdForLocation(String foreignId, String location) { List<OnmsNode> nodes = new ArrayList<OnmsNode>(); for (final OnmsNode node : findAll()) { if (node.getLabel().equals(foreignId) && (node.getLocation().getLocationName().equals(location))) { nodes.add(node); } } return nodes; }
@Override public List<OnmsNode> findByLabelForLocation(String label, String location) { List<OnmsNode> nodes = new ArrayList<OnmsNode>(); for (final OnmsNode node : findAll()) { if (node.getLabel().equals(label) && (node.getLocation().getLocationName().equals(location))) { nodes.add(node); } } return nodes; }
@Override public String getLocationForId(final Integer id) { final OnmsNode node = get(id); if (node == null) { return null; } else { OnmsMonitoringLocation onmsMonitoringLocation = node.getLocation(); return onmsMonitoringLocation == null ? null : onmsMonitoringLocation.getLocationName(); } }
/** {@inheritDoc} */ @Override public String getNodeLocation(int nodeId) { final OnmsNode onmsNode = m_nodeDao.get(nodeId); if (onmsNode == null) { return null; } return onmsNode.getLocation().getLocationName(); }
@Override public String getLocationForId(final Integer id) { final OnmsNode node = get(id); if (node == null) { return null; } else { OnmsMonitoringLocation onmsMonitoringLocation = node.getLocation(); return onmsMonitoringLocation == null ? null : onmsMonitoringLocation.getLocationName(); } }
@Override public CollectionAgent createCollectionAgent(OnmsIpInterface ipIf) { return transactionOperations.execute((status) -> { final OnmsNode node = ipIf.getNode(); if (node.getLocation() != null) { return createAgent(ipIf, node, node.getLocation().getLocationName()); } return createAgent(ipIf, node, null); }); }
/** * <p>getLocationName</p> * * @return a {@link java.lang.String} object. */ @Transient @XmlElement(name="locationName") public String getLocationName(){ return getMonitoredService().getIpInterface().getNode().getLocation().getLocationName(); }
private void updateLocation(final OnmsNode node) { if (node.getLocation() == null) { node.setLocation(m_monitoringLocationDao.getDefaultLocation()); } else { node.setLocation(createLocationIfNecessary(node.getLocation().getLocationName())); } }
@Override public CollectionAgent createCollectionAgent(OnmsIpInterface ipIf) { return transactionOperations.execute((status) -> { final OnmsNode node = ipIf.getNode(); if (node.getLocation() != null) { return createAgent(ipIf, node, node.getLocation().getLocationName()); } return createAgent(ipIf, node, null); }); }
private void updateLocation(final OnmsNode node) { if (node.getLocation() == null) { node.setLocation(m_monitoringLocationDao.getDefaultLocation()); } else { node.setLocation(createLocationIfNecessary(node.getLocation().getLocationName())); } }
@Override public final String getLocationName() { final OnmsMonitoringLocation location = getIpInterface().getNode().getLocation(); if (location != null) { return location.getLocationName(); } return null; }
@Override public CollectionAgent createCollectionAgent(String nodeCriteria, InetAddress ipAddr) { return transactionOperations.execute((status) -> { final OnmsNode node = lookupNode(nodeCriteria); final OnmsIpInterface ipInterface = lookupIpInterface(node, InetAddressUtils.str(ipAddr)); final CollectionAgent agent = createAgent(ipInterface, node, node.getLocation() != null ? node.getLocation().getLocationName() : null); return agent; }); }
@Override public final String getLocationName() { final OnmsMonitoringLocation location = getIpInterface().getNode().getLocation(); if (location != null) { return location.getLocationName(); } return null; }
/** {@inheritDoc} */ @Transactional @Override public OnmsNode getDbNodeInitCat(final Integer nodeId) { final OnmsNode node = m_nodeDao.get(nodeId); // TODO: Does calling initialize() on an entity do anything? m_nodeDao.initialize(node); m_nodeDao.initialize(node.getCategories()); m_nodeDao.initialize(node.getLocation()); return node; }
/** {@inheritDoc} */ @Transactional @Override public OnmsNode getDbNodeInitCat(final Integer nodeId) { final OnmsNode node = m_nodeDao.get(nodeId); // TODO: Does calling initialize() on an entity do anything? m_nodeDao.initialize(node); m_nodeDao.initialize(node.getCategories()); m_nodeDao.initialize(node.getLocation()); return node; }
/** {@inheritDoc} */ @Transactional @Override public OnmsNode getNode(final Integer nodeId) { final OnmsNode node = m_nodeDao.get(nodeId); // TODO: Does calling initialize() on an entity do anything? m_nodeDao.initialize(node); m_nodeDao.initialize(node.getCategories()); m_nodeDao.initialize(node.getIpInterfaces()); m_nodeDao.initialize(node.getLocation()); return node; }
/** {@inheritDoc} */ @Transactional @Override public OnmsNode getNode(final Integer nodeId) { final OnmsNode node = m_nodeDao.get(nodeId); // TODO: Does calling initialize() on an entity do anything? m_nodeDao.initialize(node); m_nodeDao.initialize(node.getCategories()); m_nodeDao.initialize(node.getIpInterfaces()); m_nodeDao.initialize(node.getLocation()); return node; }