org.codehaus.mojo.keytool
Class AbstractKeyToolCommandLineBuilder

java.lang.Object
  extended by org.codehaus.mojo.keytool.AbstractKeyToolCommandLineBuilder
All Implemented Interfaces:
KeyToolCommandLineBuilder
Direct Known Subclasses:
DefaultKeyToolCommandLineBuilder

public abstract class AbstractKeyToolCommandLineBuilder
extends Object
implements KeyToolCommandLineBuilder

To build the command line for a given KeyToolRequest.

Since:
1.1
Version:
$Id: AbstractKeyToolCommandLineBuilder.java 16259 2012-04-08 11:11:07Z tchemit $
Author:
tchemit

Field Summary
 
Fields inherited from interface org.codehaus.mojo.keytool.KeyToolCommandLineBuilder
ROLE
 
Constructor Summary
AbstractKeyToolCommandLineBuilder()
           
 
Method Summary
protected  void addArg(org.codehaus.plexus.util.cli.Commandline cli, File value)
          Convinience method to add a file argument to the command line.
protected  void addArg(org.codehaus.plexus.util.cli.Commandline cli, String value)
          Convinience method to add an argument to the command line.
protected  void addArgIfNotEmpty(org.codehaus.plexus.util.cli.Commandline cli, String key, File value)
          Convenience method to add an argument to the command line if the the value is not null or empty.
protected  void addArgIfNotEmpty(org.codehaus.plexus.util.cli.Commandline cli, String key, String value)
          Convenience method to add an argument to the command line if the the value is not null or empty.
protected  void addArgIfTrue(org.codehaus.plexus.util.cli.Commandline cli, String key, boolean value)
          Convenience method to add an argument to the command line if the the value is true.
protected  void addKeytoolCommandAndDefaultoptions(org.codehaus.plexus.util.cli.Commandline cli, String keytoolcommand, KeyToolRequest request)
          Fill the commandline client with keytool command, optional verbose option and common options from the given request.
protected  void buildWithKeyStoreAndAliasParameters(KeyToolRequestWithKeyStoreAndAliasParameters request, org.codehaus.plexus.util.cli.Commandline cli)
          Fill the commandline client for the given request.
protected  void buildWithKeyStoreParameters(KeyToolRequestWithKeyStoreParameters request, org.codehaus.plexus.util.cli.Commandline cli)
          Fill the commandline client for the given request.
 void checkRequiredState()
          Checks that builder is ready to produce commandline from incoming request.
protected  String getKeyToolFile()
          Get the builder keytool program location.
protected  org.codehaus.plexus.logging.Logger getLogger()
          Get the builder logger.
 void setKeyToolFile(String keyToolFile)
          Sets the keytool executable location.
 void setLogger(org.codehaus.plexus.logging.Logger logger)
          Sets the logger used by the builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.mojo.keytool.KeyToolCommandLineBuilder
build
 

Constructor Detail

AbstractKeyToolCommandLineBuilder

public AbstractKeyToolCommandLineBuilder()
Method Detail

setLogger

public final void setLogger(org.codehaus.plexus.logging.Logger logger)
Sets the logger used by the builder.

Specified by:
setLogger in interface KeyToolCommandLineBuilder
Parameters:
logger - logger to use in this builder

setKeyToolFile

public final void setKeyToolFile(String keyToolFile)
Sets the keytool executable location.

Specified by:
setKeyToolFile in interface KeyToolCommandLineBuilder
Parameters:
keyToolFile - keytool executable location to use in this builder

checkRequiredState

public final void checkRequiredState()
Checks that builder is ready to produce commandline from incoming request.

Says a logger is set and a keytool executable location is setted.

Specified by:
checkRequiredState in interface KeyToolCommandLineBuilder

getLogger

protected final org.codehaus.plexus.logging.Logger getLogger()
Get the builder logger.

Returns:
the builder logger

getKeyToolFile

protected final String getKeyToolFile()
Get the builder keytool program location.

Returns:
the builder keytool program location

addKeytoolCommandAndDefaultoptions

protected final void addKeytoolCommandAndDefaultoptions(org.codehaus.plexus.util.cli.Commandline cli,
                                                        String keytoolcommand,
                                                        KeyToolRequest request)
Fill the commandline client with keytool command, optional verbose option and common options from the given request.

Parameters:
cli - the commandline client to prepare
keytoolcommand - keytool command option to pass to keytool programm
request - the keytool request to consume
See Also:
KeyToolRequestWithKeyStoreParameters, KeyToolRequestWithKeyStoreAndAliasParameters

buildWithKeyStoreParameters

protected void buildWithKeyStoreParameters(KeyToolRequestWithKeyStoreParameters request,
                                           org.codehaus.plexus.util.cli.Commandline cli)
Fill the commandline client for the given request.

Parameters:
request - the keytool import request
cli - the commandline client to prepare

buildWithKeyStoreAndAliasParameters

protected void buildWithKeyStoreAndAliasParameters(KeyToolRequestWithKeyStoreAndAliasParameters request,
                                                   org.codehaus.plexus.util.cli.Commandline cli)
Fill the commandline client for the given request.

Parameters:
request - the keytool import request
cli - the commandline client to prepare

addArgIfNotEmpty

protected final void addArgIfNotEmpty(org.codehaus.plexus.util.cli.Commandline cli,
                                      String key,
                                      String value)
Convenience method to add an argument to the command line if the the value is not null or empty.

Parameters:
cli - command line to fill
key - the argument name.
value - the argument value to be added.

addArgIfNotEmpty

protected final void addArgIfNotEmpty(org.codehaus.plexus.util.cli.Commandline cli,
                                      String key,
                                      File value)
Convenience method to add an argument to the command line if the the value is not null or empty.

Parameters:
cli - command line to fill
key - the argument name.
value - the argument value to be added.

addArgIfTrue

protected final void addArgIfTrue(org.codehaus.plexus.util.cli.Commandline cli,
                                  String key,
                                  boolean value)
Convenience method to add an argument to the command line if the the value is true.

Parameters:
cli - command line to fill
key - the argument name.
value - the argument value to be test.

addArg

protected final void addArg(org.codehaus.plexus.util.cli.Commandline cli,
                            String value)
Convinience method to add an argument to the command line.

Parameters:
cli - command line to fill
value - the argument value to be added

addArg

protected final void addArg(org.codehaus.plexus.util.cli.Commandline cli,
                            File value)
Convinience method to add a file argument to the command line.

Parameters:
cli - command line to fill
value - the file argument value to be added


Copyright © 2005-2012 Codehaus. All Rights Reserved.