Package com.socrata.datasync.config

Examples of com.socrata.datasync.config.CommandLineOptions


    @Before
    public void initialize() {
        job = new PortJob();
        parser = new PosixParser();
        cmd = new CommandLineOptions();
    }
View Full Code Here


     * NB: it is expected that this is run before 'configure'.
     * @param cmd the commandLine object constructed from the user's options
     * @return true if the commandLine is approved, false otherwise
     */
    public static boolean validateArgs(CommandLine cmd) {
        CommandLineOptions options = new CommandLineOptions();
        return  validateDatasetIdArg(cmd, options) &&
                validateFileToPublishArg(cmd, options) &&
                validatePublishMethodArg(cmd, options) &&
                validateHeaderRowArg(cmd, options) &&
                validatePublishViaFtpArg(cmd, options) &&
View Full Code Here

     * set from the cmd line and the controlFile contents are deserialized
     * NB: This should be run after 'validateArgs' and before 'run'
     * @param cmd the commandLine object constructed from the user's options
     */
    public void configure(CommandLine cmd) {
        CommandLineOptions options = new CommandLineOptions();
        String method = cmd.getOptionValue(options.PUBLISH_METHOD_FLAG);

        setDatasetID(cmd.getOptionValue(options.DATASET_ID_FLAG));
        setFileToPublish(cmd.getOptionValue(options.FILE_TO_PUBLISH_FLAG));
        if(method != null)
View Full Code Here

            }
    } else {
        // generate & run job from command line args
            checkVersion();

            CommandLineOptions options = new CommandLineOptions();
            CommandLine cmd = options.getCommandLine(args);
            UserPreferences userPrefs = null;
            try {
                userPrefs = loadUserPreferences(options, cmd);
            } catch (IOException e) {
                System.err.println("Failed to load configuration: " + e.toString());
View Full Code Here

        return JobStatus.SUCCESS;
    }

    private static boolean validateDestinationDomainArg(CommandLine cmd) {
        CommandLineOptions options = new CommandLineOptions();
        if(cmd.getOptionValue(options.DESTINATION_DOMAIN_FLAG) == null) {
            System.err.println("Missing required argument: -pd2,--" + options.DESTINATION_DOMAIN_FLAG + " is required");
            return false;
        }
        return true;
View Full Code Here

        }
        return true;
    }

    private static boolean validateSourceIdArg(CommandLine cmd) {
        CommandLineOptions options = new CommandLineOptions();
        if(cmd.getOptionValue(options.SOURCE_DATASET_ID_FLAG) == null) {
            System.err.println("Missing required argument: -pi1,--" + options.SOURCE_DATASET_ID_FLAG + " is required");
            return false;
        }
        return true;
View Full Code Here

        }
        return true;
    }

    private static boolean validateSourceDomainArg(CommandLine cmd) {
        CommandLineOptions options = new CommandLineOptions();
        if(cmd.getOptionValue(options.SOURCE_DOMAIN_FLAG) == null) {
            System.err.println("Missing required argument: -pd1,--" + options.SOURCE_DOMAIN_FLAG + " is required");
            return false;
        }
        return true;
View Full Code Here

        }
        return true;
    }

    private static boolean validatePortMethodArg(CommandLine cmd) {
        CommandLineOptions options = new CommandLineOptions();
        String portMethod = cmd.getOptionValue(options.PORT_METHOD_FLAG);
        if(portMethod == null) {
            System.err.println("Missing required argument: -pm,--" + options.PORT_METHOD_FLAG + " is required");
            return false;
        }
View Full Code Here

TOP

Related Classes of com.socrata.datasync.config.CommandLineOptions

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.