Package nz.co.abrahams.asithappens.cartgraph

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


                    "Error creating graph from stored session", e);
        }
    }
   
    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();
            graphID = graphDAO.retrieveGraphIDForSession(sessionID);

            graphFrame = graphDAO.retrieveGraph(graphID, dataSets);

            graphDAO.closeConnection();
            graphFrame.getContext().setAggregation(aggregation);
            graphFrame.getContext().setInterpolation(interpolation);
            graphFrame.getContext().setXAxisScaling(TimeSeriesContext.XAxisScaling.AbsoluteBoundaries);
        } catch (Exception e) {
            ErrorHandler.modalError(parent, e.toString(),
View Full Code Here


        list.remove(graph);
    }
   
    public static synchronized void saveLayout(String layout) throws DBException, UnknownHostException, DAOCreationException {
        LayoutDAO layoutDAO;
        DataGraphDAO graphDAO;
        DataGraph graph;
        Iterator<DataGraph> iterator;
       
        layoutDAO = DAOFactory.getLayoutDAO();
        layoutDAO.create(layout, list.iterator());
View Full Code Here

    }
   
    public static synchronized void loadLayout(String name) throws DBException, UnknownHostException, SNMPException, DAOCreationException {
        Connection connection;
        LayoutDAO layoutDAO;
        DataGraphDAO graphDAO;
        int[] graphIDs;
       
        connection = DBUtil.getConnection();
        logger.debug("Loading layout \'" + name + "\'");
        layoutDAO = DAOFactory.getLayoutDAO(connection);
        graphIDs = layoutDAO.retrieveLayoutGraphs(name);
        //layoutDAO.closeConnection();
       
        graphDAO = DAOFactory.getDataGraphDAO(connection);
        for ( int graph = 0 ; graph < graphIDs.length ; graph++ ) {
            graphDAO.retrieveGraph(graphIDs[graph], null);
        }
        graphDAO.closeConnection();
       
    }
View Full Code Here

    public static LayoutDAO getLayoutDAO(Connection connection) throws DBException {
        return new LayoutDAO(connection);
    }
   
    public static DataGraphDAO getDataGraphDAO() throws DBException {
        return new DataGraphDAO(DBUtil.getConnection());
    }
View Full Code Here

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

    }
   
    public void create(String layout, Iterator<DataGraph> iterator) throws DBException, UnknownHostException, DAOCreationException {
        PreparedStatement statement;
        DataGraph graph;
        DataGraphDAO graphDAO;
       
        try {
            statement = connection.prepareStatement(CREATE);
            statement.setString(1, layout);
            statement.executeUpdate();
           
            graphDAO = DAOFactory.getDataGraphDAO();
            while ( iterator.hasNext() ) {
                graph = iterator.next();
                logger.info("Graph: " + graph.getContext().getData().getTitle());
                if ( graph.getContext().getData().isCollector() ) {
                    logger.info("  (a collector)");
                    //collector = graph.getContext().getData().getCollector();
                    //graph.getContext().getData().getCollector().store(layout);
                    //graph.store(layout);
                    graphDAO.createGraph(layout, graph);
                } else
                    logger.info("  (not a collector)");
            }
        } catch (SQLException e) {
            logger.error("Problem creating layout " + layout + " in database");
View Full Code Here

TOP

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

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.