Package org.codehaus.mojo.keytool
Class AbstractKeyToolCommandLineBuilder
- java.lang.Object
-
- org.codehaus.mojo.keytool.AbstractKeyToolCommandLineBuilder
-
- All Implemented Interfaces:
KeyToolCommandLineBuilder
- Direct Known Subclasses:
DefaultKeyToolCommandLineBuilder
public abstract class AbstractKeyToolCommandLineBuilder extends java.lang.Object implements KeyToolCommandLineBuilder
To build the command line for a givenKeyToolRequest
.- Since:
- 1.1
- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
keyToolFile
Keytool executable location.private org.codehaus.plexus.logging.Logger
logger
Builder logger.-
Fields inherited from interface org.codehaus.mojo.keytool.KeyToolCommandLineBuilder
ROLE
-
-
Constructor Summary
Constructors Constructor Description AbstractKeyToolCommandLineBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addArg(org.apache.maven.shared.utils.cli.Commandline cli, java.io.File value)
Convinience method to add a file argument to thecommand line
.protected void
addArg(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.String value)
Convinience method to add an argument to thecommand line
.protected void
addArgIfNotEmpty(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.String key, java.io.File value)
Convenience method to add an argument to thecommand line
if the the value is not null or empty.protected void
addArgIfNotEmpty(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.String key, java.lang.String value)
Convenience method to add an argument to thecommand line
if the the value is not null or empty.protected void
addArgIfTrue(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.String key, boolean value)
Convenience method to add an argument to thecommand line
if the the value is true.protected void
addKeytoolCommandAndDefaultoptions(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.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.apache.maven.shared.utils.cli.Commandline cli)
Fill the commandline client for the givenrequest
.protected void
buildWithKeyStoreParameters(KeyToolRequestWithKeyStoreParameters request, org.apache.maven.shared.utils.cli.Commandline cli)
Fill the commandline client for the givenrequest
.void
checkRequiredState()
Checks that builder is ready to produce commandline from incoming request.void
checkSupportedRequest(KeyToolRequest request)
Checks that builder can build the given type of request.protected java.lang.String
getKeyToolFile()
Get the builder keytool program location.protected org.codehaus.plexus.logging.Logger
getLogger()
Get the builder logger.void
setKeyToolFile(java.lang.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, supportRequestType
-
-
-
-
Method Detail
-
setLogger
public final void setLogger(org.codehaus.plexus.logging.Logger logger)
Sets the logger used by the builder.- Specified by:
setLogger
in interfaceKeyToolCommandLineBuilder
- Parameters:
logger
- logger to use in this builder
-
setKeyToolFile
public final void setKeyToolFile(java.lang.String keyToolFile)
Sets the keytool executable location.- Specified by:
setKeyToolFile
in interfaceKeyToolCommandLineBuilder
- 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 interfaceKeyToolCommandLineBuilder
-
checkSupportedRequest
public final void checkSupportedRequest(KeyToolRequest request) throws UnsupportedKeyToolRequestException
Checks that builder can build the given type of request.- Specified by:
checkSupportedRequest
in interfaceKeyToolCommandLineBuilder
- Parameters:
request
- request to test- Throws:
UnsupportedKeyToolRequestException
-
getLogger
protected final org.codehaus.plexus.logging.Logger getLogger()
Get the builder logger.- Returns:
- the builder logger
-
getKeyToolFile
protected final java.lang.String getKeyToolFile()
Get the builder keytool program location.- Returns:
- the builder keytool program location
-
addKeytoolCommandAndDefaultoptions
protected final void addKeytoolCommandAndDefaultoptions(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.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 preparekeytoolcommand
- keytool command option to pass to keytool programmrequest
- the keytool request to consume- See Also:
KeyToolRequestWithKeyStoreParameters
,KeyToolRequestWithKeyStoreAndAliasParameters
-
buildWithKeyStoreParameters
protected void buildWithKeyStoreParameters(KeyToolRequestWithKeyStoreParameters request, org.apache.maven.shared.utils.cli.Commandline cli)
Fill the commandline client for the givenrequest
.- Parameters:
request
- the keytool import requestcli
- the commandline client to prepare
-
buildWithKeyStoreAndAliasParameters
protected void buildWithKeyStoreAndAliasParameters(KeyToolRequestWithKeyStoreAndAliasParameters request, org.apache.maven.shared.utils.cli.Commandline cli)
Fill the commandline client for the givenrequest
.- Parameters:
request
- the keytool import requestcli
- the commandline client to prepare
-
addArgIfNotEmpty
protected final void addArgIfNotEmpty(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.String key, java.lang.String value)
Convenience method to add an argument to thecommand line
if the the value is not null or empty.- Parameters:
cli
- command line to fillkey
- the argument name.value
- the argument value to be added.
-
addArgIfNotEmpty
protected final void addArgIfNotEmpty(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.String key, java.io.File value)
Convenience method to add an argument to thecommand line
if the the value is not null or empty.- Parameters:
cli
- command line to fillkey
- the argument name.value
- the argument value to be added.
-
addArgIfTrue
protected final void addArgIfTrue(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.String key, boolean value)
Convenience method to add an argument to thecommand line
if the the value is true.- Parameters:
cli
- command line to fillkey
- the argument name.value
- the argument value to be test.
-
addArg
protected final void addArg(org.apache.maven.shared.utils.cli.Commandline cli, java.lang.String value)
Convinience method to add an argument to thecommand line
.- Parameters:
cli
- command line to fillvalue
- the argument value to be added
-
addArg
protected final void addArg(org.apache.maven.shared.utils.cli.Commandline cli, java.io.File value)
Convinience method to add a file argument to thecommand line
.- Parameters:
cli
- command line to fillvalue
- the file argument value to be added
-
-