aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient-java/src/main/java/com/yahoo/vespa/security/tool/Tool.java
blob: 251b2d40e3caa13185f5127a4b32823809c64773 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.security.tool;

/**
 * A named tool that can be invoked via the parent Main program.
 *
 * @author vekterli
 */
public interface Tool {

    /**
     * Name of the tool used verbatim on the command line.
     */
    String name();

    /**
     * Description used when "--help" is invoked for a particular tool
     */
    ToolDescription description();

    /**
     * Invokes the tool logic with a ToolInvocation that encapsulates the command line
     * and input/ouput environment the tool was called in.
     *
     * @param invocation parameters and environment to be used by the tool
     * @return exit code that will be returned by the main process
     */
    int invoke(ToolInvocation invocation);

}