Package gov.nysenate.openleg.processors

Examples of gov.nysenate.openleg.processors.DataProcessor


                System.exit(1);
            }
        }

        Environment env = Application.getEnvironment();
        DataProcessor process = new DataProcessor();
        for (String task : tasks) {
            // TODO: With Java7 we can make this a switch case
            if (task.equals("stage")) {
                process.stage(env.getStagingDirectory(), env.getWorkingDirectory());
            }
            else if (task.equals("collate")) {
                process.collate(env.getWorkingDirectory());
            }
            else if (task.equals("ingest")) {
                process.ingest(env.getWorkingDirectory(), Application.getStorage());
                if (changeFile != null) {
                    ChangeLogger.writeToFile(changeFile);
                }
            }
            else if (task.equals("push")) {
                if (ChangeLogger.getChangeLog().isEmpty()) {
                    if (changeFile != null) {
                        ChangeLogger.readFromFile(changeFile);
                    }
                    else {
                        System.err.println("Unable to push with an empty change log.");
                    }
                }
                process.push(Application.getStorage(), ChangeLogger.getEntries(), services);
            }
            else if (task.equalsIgnoreCase("archive")) {
                process.archive(env.getWorkingDirectory(), env.getArchiveDirectory());
            }
            else {
                System.err.println("Invalid task.");
                System.exit(1);
            }
View Full Code Here


        // push changes to lucene and varnish
        ArrayList<ServiceBase> services = new ArrayList<ServiceBase>();
        services.add(new Lucene());
        services.add(new Varnish("127.0.0.1", 80));

        DataProcessor process = new DataProcessor();
        process.push(storage, ChangeLogger.getEntries(), services);

        // Add the bill to the unpublished bill list
        UnpublishListManager unpublishListManager = new UnpublishListManager();
        unpublishListManager.addUnpublishedBill(billId + '-' + sessionYear);
    }
View Full Code Here

TOP

Related Classes of gov.nysenate.openleg.processors.DataProcessor

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.