use of org.opennms.netmgt.dao.support.InterfaceSnmpResourceType in project opennms by OpenNMS.
the class CustomSpringConfiguration method createResourceDao.
@Bean(name = "resourceDao")
public ResourceDao createResourceDao() {
return new ResourceDao() {
@Override
public Collection<OnmsResourceType> getResourceTypes() {
throw new UnsupportedOperationException();
}
@Override
public List<OnmsResource> findTopLevelResources() {
throw new UnsupportedOperationException();
}
@Override
public OnmsResource getResourceById(ResourceId id) {
if (id.toString().startsWith("node[1]")) {
final OnmsResource onmsResource = new OnmsResource(id.toString(), id.toString(), new InterfaceSnmpResourceType(null), new HashSet<OnmsAttribute>(), new ResourcePath());
if (id.toString().contains("interfaceSnmp[127.0.0.1]")) {
final RrdGraphAttribute attribute = new RrdGraphAttribute();
attribute.setName("ifInErrors");
attribute.setResource(onmsResource);
onmsResource.getAttributes().add(attribute);
}
return onmsResource;
}
return null;
}
@Override
public OnmsResource getResourceForNode(OnmsNode node) {
throw new UnsupportedOperationException();
}
@Override
public OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface, OnmsLocationMonitor locationMonitor) {
throw new UnsupportedOperationException();
}
@Override
public boolean deleteResourceById(ResourceId resourceId) {
throw new UnsupportedOperationException();
}
};
}
Aggregations