Package com.socrata.datasync.job

Examples of com.socrata.datasync.job.Job


    public SimpleIntegrationRunner(String jobFileToRun) {
        File jobFile = new File(jobFileToRun);
        if(jobFile.exists()) {
            try {
              Job job;
              //TODO BW: Follow how port jobs are run from command line?
              if (jobFileToRun.endsWith(MetadataJobTab.JOB_FILE_EXTENSION)) {
                job = new MetadataJob(jobFileToRun);
              }
              else {
                job = new IntegrationJob(jobFileToRun);
              }
                JobStatus status = job.run();
                if(status.isError()) {
                    System.err.print("Job completed with errors: ");
                    System.err.println(status.getMessage());
                    System.exit(1);
                } else {
View Full Code Here


            }

            String jobTypeFlag = options.JOB_TYPE_FLAG;
            String jobType = cmd.getOptionValue(jobTypeFlag, options.DEFAULT_JOBTYPE);

            Job jobToRun = new com.socrata.datasync.job.IntegrationJob(userPrefs);
            if(jobType.equals(Jobs.PORT_JOB.toString())) {
                jobToRun = new PortJob(userPrefs);
            } else if(jobType.equals(Jobs.LOAD_PREFERENCES_JOB.toString())) {
                jobToRun = new LoadPreferencesJob(userPrefs);
            } else if (!jobType.equals(Jobs.INTEGRATION_JOB.toString())){
                System.err.println("Invalid " + jobTypeFlag + ": " + cmd.getOptionValue(jobTypeFlag) +
                        " (must be " + Arrays.toString(Jobs.values()) + ")");
                System.exit(1);
            }

            if (jobToRun.validateArgs(cmd)) {
                jobToRun.configure(cmd);
                new SimpleIntegrationRunner(jobToRun);
            } else {
                printHelp();
                System.exit(1);
            }
View Full Code Here

TOP

Related Classes of com.socrata.datasync.job.Job

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.