/** * <p>hasNewCollectionTypeValue</p> * * @param newVal a {@link org.opennms.netmgt.model.PrimaryType} object. * @param existingVal a {@link org.opennms.netmgt.model.PrimaryType} object. * @return a boolean. */ protected static boolean hasNewCollectionTypeValue(PrimaryType newVal, PrimaryType existingVal) { return newVal != null && !newVal.equals(existingVal) && newVal != PrimaryType.NOT_ELIGIBLE; }
/** * <p>isPrimary</p> * * @return a boolean. */ @Transient @XmlTransient public boolean isPrimary(){ return m_isSnmpPrimary.equals(PrimaryType.PRIMARY); }
} else if (!getSnmpPrimary().equals(other.getSnmpPrimary())) { return false;
List<OnmsIpInterface> primaryInterfaces = new ArrayList<>(); for(OnmsIpInterface iface : getIpInterfaces()) { if (PrimaryType.PRIMARY.equals(iface.getIsSnmpPrimary())) { primaryInterfaces.add(iface);
private void validateIsSnmpPrimary() throws CollectionInitializationException { if (!PrimaryType.PRIMARY.equals(getIsSnmpPrimary())) { throw new CollectionInitializationException("Interface " + getHostAddress() + " is not the primary SNMP interface for nodeid " + getNodeId()); } }
try { for (IpInterfaceTopologyEntity ip: m_topologyEntityCache.getIpInterfaceTopologyEntities()) { if (ip.getIsSnmpPrimary().equals(PrimaryType.PRIMARY)) { m_nodeToOnmsIpPrimaryMap.put(ip.getNodeId(), ip); } else {
public OpennmsModelProtos.IpInterface.Builder toIpInterface(OnmsIpInterface ipInterface) { if (ipInterface == null) { return null; } final OpennmsModelProtos.IpInterface.Builder builder = OpennmsModelProtos.IpInterface.newBuilder() .setId(ipInterface.getId()) .setIpAddress(InetAddressUtils.toIpAddrString(ipInterface.getIpAddress())); final OnmsSnmpInterface snmpInterface = ipInterface.getSnmpInterface(); if (snmpInterface != null && snmpInterface.getIfIndex() != null) { builder.setIfIndex(snmpInterface.getIfIndex()); } final PrimaryType primaryType = ipInterface.getIsSnmpPrimary(); if (PrimaryType.PRIMARY.equals(primaryType)) { builder.setPrimaryType(OpennmsModelProtos.IpInterface.PrimaryType.PRIMARY); } else if (PrimaryType.SECONDARY.equals(primaryType)) { builder.setPrimaryType(OpennmsModelProtos.IpInterface.PrimaryType.SECONDARY); } else if (PrimaryType.NOT_ELIGIBLE.equals(primaryType)) { builder.setPrimaryType(OpennmsModelProtos.IpInterface.PrimaryType.NOT_ELIGIBLE); } ipInterface.getMonitoredServices().forEach(svc -> builder.addService(svc.getServiceName())); return builder; }
public OpennmsModelProtos.IpInterface.Builder toIpInterface(OnmsIpInterface ipInterface) { if (ipInterface == null) { return null; } final OpennmsModelProtos.IpInterface.Builder builder = OpennmsModelProtos.IpInterface.newBuilder() .setId(ipInterface.getId()) .setIpAddress(InetAddressUtils.toIpAddrString(ipInterface.getIpAddress())); final OnmsSnmpInterface snmpInterface = ipInterface.getSnmpInterface(); if (snmpInterface != null && snmpInterface.getIfIndex() != null) { builder.setIfIndex(snmpInterface.getIfIndex()); } final PrimaryType primaryType = ipInterface.getIsSnmpPrimary(); if (PrimaryType.PRIMARY.equals(primaryType)) { builder.setPrimaryType(OpennmsModelProtos.IpInterface.PrimaryType.PRIMARY); } else if (PrimaryType.SECONDARY.equals(primaryType)) { builder.setPrimaryType(OpennmsModelProtos.IpInterface.PrimaryType.SECONDARY); } else if (PrimaryType.NOT_ELIGIBLE.equals(primaryType)) { builder.setPrimaryType(OpennmsModelProtos.IpInterface.PrimaryType.NOT_ELIGIBLE); } ipInterface.getMonitoredServices().forEach(svc -> builder.addService(svc.getServiceName())); return builder; }
if (PrimaryType.PRIMARY.equals(primaryType)) { if (addr != null) { m_scanManager = new ScanManager(getProvisionService().getLocationAwareSnmpClient(), addr);
if (PrimaryType.PRIMARY.equals(primaryType)) { if (addr != null) { m_scanManager = new ScanManager(getProvisionService().getLocationAwareSnmpClient(), addr);