void parseArguments(String args[]) throws ParseException, HelpShownException {
        Options options = createOptions();

        CommandLineParser parser = new DefaultParser();
        CommandLine line = parser.parse(options, args);

        if (line.hasOption("h")) {
            printSyntax(options);
            throw new HelpShownException();
        }
        if (line.hasOption("s")) {
            slobrokAddress = line.getOptionValue("s");
        }
        if (line.hasOption("t")) {
            port = ((Number) line.getParsedOptionValue("t")).intValue();
        }
        if (line.hasOption("i")) {
            printIds = true;
        }
        if (line.hasOption("p")) {
            processTime = ((Number) line.getParsedOptionValue("p")).intValue();
        }
        if (line.hasOption("v")) {
            verbose = true;
        }
        if (line.hasOption("c")) {
            handlerClassName = line.getOptionValue("c");
        }
        if (line.hasOption("o")) {
            handlerArgs = line.getOptionValue("o").split(" ");
        }

        if (!(slobrokAddress == null ^ port == -1)) {
            throw new IllegalArgumentException("You must specify one, and only one, binding option");
        }
        if (port != -1 && port < 0 || port > 65535) {
            throw new IllegalArgumentException("The port must be in the range 0-65535");
        }
        if (verbose) {
            if (port != -1) {
                System.err.println("Binding to socket " + getTcpAddress());
            } else {
                System.err.println("Binding to slobrok address: " + slobrokAddress + "/visit-destination");
            }
        }
    }
Example client using visiting

@author Einar M R Rosenvinge
vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisitTarget.java