Package nz.co.abrahams.asithappens.storage

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


    public PortsSelectorSNMP getSNMP() {
        return snmp;
    }

    public void enumeratePorts() throws SNMPException, DBException {
        DeviceDAO deviceDAO;
       
        snmp.enumeratePorts();
        deviceDAO = DAOFactory.getDeviceDAO();
        if ( retrieveRWCommunity )
            deviceDAO.updateDevice(snmp.getDevice().getName(), null, snmp.getDevice().getCommunityWrite(), null, null);
        else
            deviceDAO.updateDevice(snmp.getDevice().getName(), snmp.getDevice().getCommunityRead(), null, null, null);
        deviceDAO.closeConnection();
       
    }
View Full Code Here


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

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

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

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

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

     *
     * @param sessionID      the session ID of the collector
     * @return               the collector created from the database definition
     */
    public NetFlowCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        NetFlowMatchCriteriaDAO criteriaDAO;
        FlowOptionsDAO optionsDAO;
        String name;
        Device device;
        PortsSelectorSNMP portsSNMP;
        NetFlowSNMP netflowSNMP;
        long pollInterval;
        int ifIndex;
        String ifDescr;
        int direction;
        int tableSize;
        NetFlowMatchCriteria criteria;
        FlowOptions options;
       
        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 ResponseWindowsCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        long pollInterval;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
        deviceDAO = DAOFactory.getDeviceDAO();
        device = deviceDAO.retrieveDevice(name, false);
        deviceDAO.closeConnection();
        pollInterval = ((Long)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_POLLINTERVAL, sessionID))).longValue();
        return new ResponseWindowsCollector(device, pollInterval);
    }
View Full Code Here

        String ifDescrValue;
        String ifAliasOID;
        String ifAliasValue;
        int ifIndexValue;
        LinkedList getNextPair;
        DeviceDAO deviceDAO;
        boolean fetchIfAlias;

        numInterfaces = snmpAccess.getMIBValueInteger(SNMPAccess.OID_IFNUMBER);
        logger.debug("Number of interfaces: " + numInterfaces);
        tempPortsDescr = new String[numInterfaces];
View Full Code Here

     *
     * @param sessionID      the session ID of the collector
     * @return               the collector created from the database definition
     */
    public MemoryHRCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        MemoryHRSNMP snmp;
        long pollInterval;
        int snmpIndex;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
        deviceDAO = DAOFactory.getDeviceDAO(connection);
        device = deviceDAO.retrieveDevice(name, false);
        snmp = new MemoryHRSNMP(device);
        pollInterval = ((Long)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_POLLINTERVAL, sessionID))).longValue();
        snmpIndex = ((Integer)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_INDEX, sessionID))).intValue();
        //device.enumeratePorts();
        return new MemoryHRCollector(snmp, pollInterval, snmpIndex);
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.