Package nz.co.abrahams.asithappens.cartgraph

Examples of nz.co.abrahams.asithappens.cartgraph.TimeSeriesContext


        String fileName;
        FlowOptions options;
        PacketTraceLoadTask task;
        ProgressBar progressBar;
        FlowData data;
        TimeSeriesContext context;
        DataGraph graphFrame;
        SimpleDateFormat dateFormat;
        long fromDate;
        long toDate;
       
View Full Code Here


            fileField.setText(chooser.getSelectedFile().getAbsolutePath());
        }
    }//GEN-LAST:event_fileButtonActionPerformed
   
    public static void createGraph(Component parent, DataSets dataSets) {
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        try {
            context = new TimeSeriesContext(dataSets);
            graphFrame = new DataGraph(context);
            //graphFrame.setVisible(true);
        } catch (Exception e) {
            ErrorHandler.modalError(parent, e.toString(), "Problem creating graph", e);
        }       
View Full Code Here

        String[] ifDescriptions;
        String portString;
        BandwidthSNMP snmp;
        BandwidthCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        if ( ! portsSelectorPanel.getModel().hasEnumerated() ) {
            ErrorHandler.modalError(this, "Please enumerate ports on a device and select a port",
                    "No port selected");
            return;
        } else if ( portsSelectorPanel.rowsSelected().length == 0 ) {
            ErrorHandler.modalError(this, "Please select a port", "No port selected");
            return;
        }
       
        try {
            device = portsSelectorPanel.getModel().getDevice();
            ifIndices = portsSelectorPanel.getIfIndices();
            ifDescriptions = portsSelectorPanel.getIfDescriptions();
            portString = portsSelectorPanel.getPortsString();

            snmp = new BandwidthSNMP(device);
            collector = new BandwidthCollector(snmp, Integer.parseInt(pollField.getText()), ifIndices, ifDescriptions, prefer64BitCheckBox.isSelected());
            data = new DataSets(DataType.BANDWIDTH, collector, device, Integer.parseInt(pollField.getText()), portString, DataSets.DIRECTION_BOTH, null, storeDataCheckBox.isSelected());
            context = new TimeSeriesContext(data);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                    "Error opening database connection", e);
        } catch (UnknownHostException e) {
View Full Code Here

    private void responseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_responseButtonActionPerformed
        Device device;
        int pollInterval;
        DataCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        try {
            //data = new ResponseData(new Device(deviceField.getText()), Integer.parseInt(pollField.getText()) * 1000, "Response Graph", "ms", storeDataCheckBox.isSelected());
            device = new Device(deviceField.getText());
            //pollInterval = Integer.parseInt(pollField.getText()) * 1000;
            pollInterval = Integer.parseInt(pollField.getText());
            if ( Configuration.getProperty("collector.response.class").equals("windows") )
                collector = new ResponseWindowsCollector(device, pollInterval);
            else
                collector = new ResponseCollector(device, pollInterval);
            data = new DataSets(DataType.RESPONSE, collector, device, pollInterval, null, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
            context = new TimeSeriesContext(data);
            //graphFrame = new DataGraph(context);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                    "Error opening database connection", e);
View Full Code Here

        }
    }
   
    public static void createGraph(Component parent, DataSets dataSets, int dataTypeID, TimeSeriesContext.Aggregation aggregation, TimeSeriesContext.Interpolation interpolation) {
        int graphID;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        try {
            context = new TimeSeriesContext(dataSets);
            context.setXAxisScaling(TimeSeriesContext.XAxisScaling.AbsoluteBoundaries);
            context.setAggregation(aggregation);
            context.setInterpolation(interpolation);
            graphFrame = new DataGraph(context);
        } catch (Exception e) {
            ErrorHandler.modalError(parent, e.toString(),
                    "Error creating graph from stored session", e);
        }
View Full Code Here

    }
   
    public static void createGraphWithContext(Component parent, int sessionID, DataSets dataSets, TimeSeriesContext.Aggregation aggregation, TimeSeriesContext.Interpolation interpolation) {
        DataGraphDAO graphDAO;
        int graphID;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        try {
           
            graphDAO = DAOFactory.getDataGraphDAO();
View Full Code Here

    }//GEN-LAST:event_collectorTypeComboBoxActionPerformed
   
    private void storageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_storageButtonActionPerformed
        DataCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
        int storageIndex;
        String storageString;
        Device currentDevice;
        MemoryUCDSNMP memoryUCDSNMP;
        int pollInterval;
       
        pollInterval = Integer.parseInt(pollField.getText());
        //pollInterval = Integer.parseInt(pollField.getText()) * 1000;
        if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_HR ) {
            try {
                storageIndex = memoryHRSNMP.getStorageIndex()[((JList)(storagePane.getViewport().getView())).getSelectedIndex()];
                storageString = (String)((JList)storagePane.getViewport().getView()).getSelectedValue();
                collector = new MemoryHRCollector(memoryHRSNMP, pollInterval, storageIndex);
                data = new DataSets(DataType.STORAGE, collector, device, pollInterval, storageString, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (NullPointerException e) {
                ErrorHandler.modalError(this, "Please enumerate resources on a device and select a storage object",
                        "No storage object selected");
            } catch (ArrayIndexOutOfBoundsException e) {
                ErrorHandler.modalError(this, "Please select a storage object", "No storage object selected");
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
                ErrorHandler.modalError(null, "Please ensure that device name \"" + deviceField.getText() + "\" is valid",
                        "Unknown host " + deviceField.getText());
            } catch (SNMPException e) {
                ErrorHandler.modalError(null, "Please ensure that device name and community string are correct",
                        "Cannot access SNMP service on device " + deviceField.getText(), e);
            }
        }
       
        else if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_UCD ) {
            try {
                storageIndex = ((JList)(storagePane.getViewport().getView())).getSelectedIndex();
                storageString = (String)((JList)storagePane.getViewport().getView()).getSelectedValue();
                //currentDevice = new Device(deviceField.getText(), communityField.getText());
                memoryUCDSNMP = new MemoryUCDSNMP(device);
                collector = new MemoryUCDCollector(memoryUCDSNMP, pollInterval, storageIndex);
                data = new DataSets(DataType.STORAGE, collector, device, pollInterval, storageString, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (NullPointerException e) {
                ErrorHandler.modalError(this, "Please enumerate resources on a device and select a memory type",
                        "No memory type selected");
            } catch (ArrayIndexOutOfBoundsException e) {
                ErrorHandler.modalError(this, "Please select a memory type", "No memory type selected");
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
                ErrorHandler.modalError(null, "Please ensure that device name \"" + deviceField.getText() + "\" is valid",
                        "Unknown host " + deviceField.getText());
            } catch (SNMPException e) {
                ErrorHandler.modalError(null, "Please ensure that device name and community string are correct",
                        "Cannot access SNMP service on device " + deviceField.getText(), e);
            }
        }
       
        else if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_CISCO ) {
            try {
                storageIndex = memoryCiscoSNMP.getStorageIndex()[((JList)(storagePane.getViewport().getView())).getSelectedIndex()];
                storageString = (String)((JList)storagePane.getViewport().getView()).getSelectedValue();
                //currentDevice = new Device(deviceField.getText(), communityField.getText());
                collector = new MemoryCiscoCollector(memoryCiscoSNMP, pollInterval, storageIndex);
                data = new DataSets(DataType.STORAGE, collector, device, pollInterval, storageString, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (NullPointerException e) {
                ErrorHandler.modalError(this, "Please enumerate resources on a Cisco device and select a memory pool",
                        "No memory pool selected");
            } catch (ArrayIndexOutOfBoundsException e) {
View Full Code Here

   
    /** Creates a new processor graph. */
    private void processorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_processorButtonActionPerformed
        DataCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
        int processorIndex;
        String processorString;
        Device currentDevice;
        ProcessorUCDSNMP processorUCDSNMP;
        ProcessorCiscoSNMP processorCiscoSNMP;
        int pollInterval;
       
        //pollInterval = Integer.parseInt(pollField.getText()) * 1000;
        pollInterval = Integer.parseInt(pollField.getText());
        if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_HR ) {
           
            try {
                processorIndex = processorHRSNMP.getProcessorsIndex()[((JList)(processorsPane.getViewport().getView())).getSelectedIndex()];
                processorString = (String)((JList)processorsPane.getViewport().getView()).getSelectedValue();
                collector = new ProcessorHRCollector(processorHRSNMP, pollInterval, processorIndex);
                data = new DataSets(DataType.PROCESSOR, collector, device, pollInterval, processorString, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (NullPointerException e) {
                ErrorHandler.modalError(this, "Please enumerate resources on a device and select a processor",
                        "No processor selected");
            } catch (ArrayIndexOutOfBoundsException e) {
                ErrorHandler.modalError(this, "Please select a processor", "No processor selected");
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
                ErrorHandler.modalError(null, "Please ensure that device name \"" + deviceField.getText() + "\" is valid",
                        "Unknown host " + deviceField.getText());
            } catch (SNMPException e) {
                ErrorHandler.modalError(null, "Please ensure that device name and community string are correct",
                        "Cannot access SNMP service on device " + deviceField.getText(), e);
            } catch (ClassCastException e) {
                ErrorHandler.modalError(null, "Please ensure that device supports processor usage in the Host Resources MIB",
                        "Cannot find processor usage information on device " + deviceField.getText(), e);
            }
           
        } else if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_UCD ) {
            try {
                currentDevice = new Device(deviceField.getText(), communityField.getText(), null, false);
                processorUCDSNMP = new ProcessorUCDSNMP(currentDevice);
                collector = new ProcessorUCDCollector(processorUCDSNMP, (long)pollInterval);
                data = new DataSets(DataType.NETSNMP_PROCESSOR, collector, currentDevice, pollInterval, null, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
                ErrorHandler.modalError(null, "Please ensure that device name \"" + deviceField.getText() + "\" is valid",
                        "Unknown host " + deviceField.getText());
            } catch (SNMPException e) {
                ErrorHandler.modalError(null, "Please ensure that device name and community string are correct",
                        "Cannot access SNMP service on device " + deviceField.getText(), e);
            }
        } else if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_CISCO ) {
            try {
                currentDevice = new Device(deviceField.getText(), communityField.getText(), null, false);
                processorCiscoSNMP = new ProcessorCiscoSNMP(currentDevice);
                collector = new ProcessorCiscoCollector(processorCiscoSNMP, pollInterval);
                data = new DataSets(DataType.PROCESSOR, collector, currentDevice, pollInterval, null, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
View Full Code Here

        String portString;
        FlowOptions options;
        NetFlowSNMP snmp;
        NetFlowCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        if ( ! portsSelectorPanel.getModel().hasEnumerated() ) {
            ErrorHandler.modalError(this, "Please enumerate ports on a device and select a port",
                    "No port selected");
            return;
        } else if ( portsSelectorPanel.rowsSelected().length == 0 ) {
            ErrorHandler.modalError(this, "Please select a port", "No port selected");
            return;
        }
       
        device = portsSelectorPanel.getModel().getDevice();
        try {
            snmp = new NetFlowSNMP(device);
            if ( snmp.getNetFlowTopFlowsTopNTable() > 0 ) {
                logger.debug("NetFlow Top-N table already exists");
                if ( JOptionPane.showConfirmDialog(this, "A Netflow Top-N table already exists - overwrite this?",
                        "Confirm NetFlow Top-N table creation", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.CANCEL_OPTION)
                    return;
            }
            /*
            ifIndex = device.getPortsIndex()[((JList)(portsPane.getViewport().getView())).getSelectedIndex()];
            portString = (String)((JList)portsPane.getViewport().getView()).getSelectedValue();
             */
            ifIndex = portsSelectorPanel.getIfIndex();
            portString = portsSelectorPanel.getIfDescription();
            options = new FlowOptions(ipProtocolCheckBox.isSelected(), sourceAddressCheckBox.isSelected(),
                    destinationAddressCheckBox.isSelected(), tosCheckBox.isSelected(), sourcePortCheckBox.isSelected(), destinationPortCheckBox.isSelected());
           
            collector = new NetFlowCollector(snmp, ifIndex, portString, directionCombo.getSelectedIndex() + 1, Configuration.getPropertyInt("collector.netflow.table.size"), Integer.parseInt(pollField.getText()) * 1000, criteria, options);
            data = new DataSets(DataType.NETFLOW, collector, device, Integer.parseInt(pollField.getText()) * 1000, portString, directionCombo.getSelectedIndex() + 1, null, storeDataCheckBox.isSelected());
            //data = new DataSets(3, device, Integer.parseInt(pollField.getText()) * 1000, ifIndex, portString, directionCombo.getSelectedIndex() + 1, "NetFlow Graph", storeDataCheckBox.isSelected());
            context = new TimeSeriesContext(data);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(this, "Please ensure that database is running and accessible",
                    "Error opening database connection", e);
        } catch (UnknownHostException e) {
View Full Code Here

        int ifIndex;
        String portString;
        NBARSNMP snmp;
        NBARCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        if ( ! portsSelectorPanel.getModel().hasEnumerated() ) {
            ErrorHandler.modalError(this, "Please enumerate ports on a device and select a port",
                    "No port selected");
            return;
        } else if ( portsSelectorPanel.rowsSelected().length == 0 ) {
            ErrorHandler.modalError(this, "Please select a port", "No port selected");
            return;
        }
       
        device = portsSelectorPanel.getModel().getDevice();
        try {
            /*
            ifIndex = device.getPortsIndex()[((JList)(portsPane.getViewport().getView())).getSelectedIndex()];
            portString = (String)((JList)portsPane.getViewport().getView()).getSelectedValue();
             */
           
            ifIndex = portsSelectorPanel.getIfIndex();
            portString = portsSelectorPanel.getIfDescription();
            snmp = new NBARSNMP(device);
            collector = new NBARCollector(snmp, Integer.parseInt(pollField.getText()) * 1000, ifIndex, portString, directionCombo.getSelectedIndex() + 1, Configuration.getPropertyInt("collector.nbar.table.size"));
            data = new DataSets(DataType.NBAR, collector, device, Integer.parseInt(pollField.getText()) * 1000, portString, directionCombo.getSelectedIndex() + 1, null, storeDataCheckBox.isSelected());
            context = new TimeSeriesContext(data);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                    "Error opening database connection", e);
        } catch (UnknownHostException e) {
View Full Code Here

TOP

Related Classes of nz.co.abrahams.asithappens.cartgraph.TimeSeriesContext

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.