Search in sources :

Example 6 with SingleResultQuerier

use of org.opennms.core.utils.SingleResultQuerier in project opennms by OpenNMS.

the class MockDatabase method getServiceName.

public String getServiceName(int serviceId) {
    SingleResultQuerier querier = new SingleResultQuerier(this, "select serviceName from service where serviceId = ?");
    querier.execute(Integer.valueOf(serviceId));
    return (String) querier.getResult();
}
Also used : SingleResultQuerier(org.opennms.core.utils.SingleResultQuerier)

Example 7 with SingleResultQuerier

use of org.opennms.core.utils.SingleResultQuerier in project opennms by OpenNMS.

the class MockDatabase method getInterfaceStatus.

public char getInterfaceStatus(MockInterface iface) {
    SingleResultQuerier querier = new SingleResultQuerier(this, "select isManaged from ipInterface where nodeId = ? and ipAddr = ?");
    querier.execute(Integer.valueOf(iface.getNodeId()), iface.getIpAddr());
    String result = (String) querier.getResult();
    if (result == null || "".equals(result)) {
        return 'X';
    }
    return result.charAt(0);
}
Also used : SingleResultQuerier(org.opennms.core.utils.SingleResultQuerier)

Example 8 with SingleResultQuerier

use of org.opennms.core.utils.SingleResultQuerier in project opennms by OpenNMS.

the class NotificationManager method getQueueForNotification.

/**
 * <p>getQueueForNotification</p>
 *
 * @param notifId a int.
 * @return a {@link java.lang.String} object.
 */
public String getQueueForNotification(final int notifId) {
    final SingleResultQuerier querier = new SingleResultQuerier(m_dataSource, "select queueID from notifications where notifyId = ?");
    querier.execute(notifId);
    return (String) querier.getResult();
}
Also used : SingleResultQuerier(org.opennms.core.utils.SingleResultQuerier)

Aggregations

SingleResultQuerier (org.opennms.core.utils.SingleResultQuerier)8 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Querier (org.opennms.core.utils.Querier)1 RowProcessor (org.opennms.core.utils.RowProcessor)1 Event (org.opennms.netmgt.xml.event.Event)1 Tticket (org.opennms.netmgt.xml.event.Tticket)1