Package com.art.anette.common.logging

Examples of com.art.anette.common.logging.Logger


    @SuppressWarnings("empty-statement")
    public static void main(String[] args) throws InterruptedException {
        setupHome();
        ServerConfiguration.getInstance().writeConfiguration();
        LogController.setUpServerLogging(Global.LOG_DIR);
        Logger logger = LogController.getLogger(Main.class);

        try {
            ServerDB.getInstance().checkVersion();
        } catch (DatabaseException e) {
            logger.severe("Database version check failed", e);
            return;
        }

        NetworkControl.getInstance();
        {
            int port = Integer.parseInt(ServerConfiguration.getInstance().getProperty("server.ttport"));
            if (port > 0) {
                logger.info("Starting TimeTracker export on port " + port);
                TTExport ttExport = new TTExport(port);
                ttExport.start();
            } else {
                logger.info("TimeTracker export is disabled");
            }
        }


        //noinspection ConstantIfStatement
        if (false) {
            ServerDB sdb = ServerDB.getInstance();

            //         delta = dd * hh * mm * sec * msec
            final long delta = 90L * 24L * 60L * 60L * 1000L;
            //noinspection InfiniteLoopStatement
            while (true) {
                try {
                    long time = (System.currentTimeMillis() - delta) / -1000;
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", Employee.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", Employee.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", Project.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", Department.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", WorkPackage.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", EmployeeProjectRelation.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", EmployeeWorkPackageRelation.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", WorkPackageDependsRelation.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", Task.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("DELETE FROM %s WHERE timestamp > %d AND timestamp < 0", Duration.getTableName(), time));
                    sdb.execute(SQLFormatter.generateQuery("UPDATE %s SET dirty = 1 WHERE lastlogin < %d", Employee.getTableName(), -time));
                } catch (SQLException ex) {
                    logger.severe(null, ex);
                }

                Thread.sleep(delta);
            }
        } else {
View Full Code Here

TOP

Related Classes of com.art.anette.common.logging.Logger

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.