Package nz.co.abrahams.asithappens.flow

Examples of nz.co.abrahams.asithappens.flow.FlowOptions


    }// </editor-fold>//GEN-END:initComponents
   
    /** Creates a new flow graph. */
    private void flowGraphButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_flowGraphButtonActionPerformed
        String fileName;
        FlowOptions options;
        PacketTraceLoadTask task;
        ProgressBar progressBar;
        FlowData data;
        TimeSeriesContext context;
        DataGraph graphFrame;
        SimpleDateFormat dateFormat;
        long fromDate;
        long toDate;
       
        try {
            fileName = fileField.getText();
            dateFormat = new SimpleDateFormat("dd/MM/yyyy H:mm:ss");
            fromDate = dateFormat.parse(fromDateField.getText() + " " + fromTimeField.getText()).getTime();
            toDate = dateFormat.parse(toDateField.getText() + " " + toTimeField.getText()).getTime();
           
            options = new FlowOptions(ipProtocolCheckBox.isSelected(), sourceAddressCheckBox.isSelected(),
                    destinationAddressCheckBox.isSelected(), false, sourcePortCheckBox.isSelected(), destinationPortCheckBox.isSelected());
           
            // create an asynchronous thread to fetch data while freeing up GUI
            task = new PacketTraceLoadTask(this, fileName, fromDate, toDate, options);
            progressBar = new ProgressBar("Reading capture file", "Graph title: Packet capture for " + fileName, task);
View Full Code Here


        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();
View Full Code Here

        flow3 = new Flow(1115641188, device1, device5, 2048, 6, 1025, 80, 300);
        flow4 = new Flow(1115641198, device1, device5, 2048, 6, 1029, 80, 300);
        flow5 = new Flow(1115641198, device2, device5, 2048, 6, 1034, 80, 300);
       
       
        destinationAddressPortOptions = new FlowOptions(true, false, true, false, false, true);
        ipProtocolOptions = new FlowOptions(true, false, false, false, false, false);
        destinationAddressOptions = new FlowOptions(true, false, true, false, false, false);
        destinationPortOptions = new FlowOptions(true, false, false, false, false, true);
    }
View Full Code Here

    /** Creates a new NetFlow graph. */
    private void netflowButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_netflowButtonActionPerformed
        Device device;
        int ifIndex;
        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());
View Full Code Here

TOP

Related Classes of nz.co.abrahams.asithappens.flow.FlowOptions

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.