Package nz.co.abrahams.asithappens.storage

Examples of nz.co.abrahams.asithappens.storage.DeviceDAO


     *
     * @param sessionID      the session ID of the collector
     * @return               the collector created from the database definition
     */
    public BandwidthCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        PortsSelectorSNMP portsSNMP;
        BandwidthSNMP bandwidthSNMP;
        long pollInterval;
        boolean prefer64BitCounters;
        String[] ifDescriptions;
        int[] ifIndicies;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
        deviceDAO = DAOFactory.getDeviceDAO();
        device = deviceDAO.retrieveDevice(name, false);
        deviceDAO.closeConnection();
        bandwidthSNMP = new BandwidthSNMP(device);
        pollInterval = ((Long)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_POLLINTERVAL, sessionID))).longValue();
        prefer64BitCounters = ((Byte)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_USE64BITCOUNTERS, sessionID))).intValue() == 1;
        ifDescriptions = retrieveBandwidthCollectorPorts(sessionID);
        portsSNMP = new PortsSelectorSNMP(device);
View Full Code Here


    public static DataLabelsDAO getDataLabelsDAO(Connection connection) throws DBException {
        return new DataLabelsDAO(connection);
    }
   
    public static DeviceDAO getDeviceDAO() throws DBException {
        return new DeviceDAO(DBUtil.getConnection());
    }
View Full Code Here

    public static DeviceDAO getDeviceDAO() throws DBException {
        return new DeviceDAO(DBUtil.getConnection());
    }
   
    public static DeviceDAO getDeviceDAO(Connection connection) throws DBException {
        return new DeviceDAO(connection);
    }
View Full Code Here

     *
     * @param sessionID      the session ID of the collector
     * @return               the collector created from the database definition
     */
    public ProcessorUCDCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        ProcessorUCDSNMP snmp;
        long pollInterval;
        int snmpIndex;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
        deviceDAO = DAOFactory.getDeviceDAO(connection);
        device = deviceDAO.retrieveDevice(name, false);
        snmp = new ProcessorUCDSNMP(device);
        pollInterval = ((Long)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_POLLINTERVAL, sessionID))).longValue();
        //device.enumeratePorts();
        return new ProcessorUCDCollector(snmp, pollInterval);
    }
View Full Code Here

     *
     * @param sessionID      the session ID of the collector
     * @return               the collector created from the database definition
     */
    public NBARCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        PortsSelectorSNMP portsSNMP;
        NBARSNMP nbarSNMP;
        long pollInterval;
        int ifIndex;
        String ifDescr;
        int direction;
        int tableSize;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
        deviceDAO = DAOFactory.getDeviceDAO();
        device = deviceDAO.retrieveDevice(name, true);
        deviceDAO.closeConnection();
        pollInterval = ((Long)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_POLLINTERVAL, sessionID))).longValue();
        ifDescr = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_IFDESCR, sessionID));
        direction = ((Integer)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DIRECTION, sessionID))).intValue();
        tableSize = ((Integer)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_TABLESIZE, sessionID))).intValue();
        portsSNMP = new PortsSelectorSNMP(device);
View Full Code Here

     *
     * @param sessionID      the session ID of the collector
     * @return               the collector created from the database definition
     */
    public CustomOIDCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        CustomOIDDAO customOIDDAO;
        String name;
        Device device;
        CustomOIDSNMP snmp;
        long pollInterval;
        String valueUnits;
        Vector<Integer> oidIDs;
        Vector<CustomOID> customOIDs;
        PreparedStatement statement;
        ResultSet results;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
        deviceDAO = DAOFactory.getDeviceDAO(connection);
        device = deviceDAO.retrieveDevice(name, false);
        snmp = new CustomOIDSNMP(device);
        pollInterval = ((Long)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_POLLINTERVAL, sessionID))).longValue();
        valueUnits = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_VALUEUNITS, sessionID));
        oidIDs = new Vector();
        customOIDs = new Vector();
View Full Code Here

TOP

Related Classes of nz.co.abrahams.asithappens.storage.DeviceDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.