Search in sources :

Example 16 with OnmsHwEntity

use of org.opennms.netmgt.model.OnmsHwEntity in project opennms by OpenNMS.

the class HwEntityDaoHibernate method getAttributeValue.

/* (non-Javadoc)
     * @see org.opennms.netmgt.dao.api.HwEntityDao#getAttributeValue(java.lang.Integer, java.lang.String, java.lang.String)
     */
@Override
public String getAttributeValue(Integer nodeId, String nameSource, String attributeName) {
    boolean isRegex = nameSource.startsWith("~");
    if (isRegex) {
        OnmsHwEntity r = findRootByNodeId(nodeId);
        return r == null ? null : findAttribute(r, nameSource.substring(1), attributeName);
    }
    OnmsHwEntity e = findEntityByName(nodeId, nameSource);
    return e == null ? null : getAttributeValue(e, attributeName);
}
Also used : OnmsHwEntity(org.opennms.netmgt.model.OnmsHwEntity)

Aggregations

OnmsHwEntity (org.opennms.netmgt.model.OnmsHwEntity)16 OnmsNode (org.opennms.netmgt.model.OnmsNode)8 Consumes (javax.ws.rs.Consumes)3 Path (javax.ws.rs.Path)3 Test (org.junit.Test)3 HwEntityAttributeType (org.opennms.netmgt.model.HwEntityAttributeType)3 FileWriter (java.io.FileWriter)2 POST (javax.ws.rs.POST)2 OnmsHwEntityAttribute (org.opennms.netmgt.model.OnmsHwEntityAttribute)2 SnmpObjId (org.opennms.netmgt.snmp.SnmpObjId)2 BeanWrapper (org.springframework.beans.BeanWrapper)2 Transactional (org.springframework.transaction.annotation.Transactional)2 InetAddress (java.net.InetAddress)1 Map (java.util.Map)1 ExecutionException (java.util.concurrent.ExecutionException)1 Matcher (java.util.regex.Matcher)1 DELETE (javax.ws.rs.DELETE)1 GET (javax.ws.rs.GET)1 PUT (javax.ws.rs.PUT)1 Produces (javax.ws.rs.Produces)1