org.codehaus.mojo.keytool
Class AbstractKeyToolRequestMojo<R extends KeyToolRequest>

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.keytool.AbstractKeyToolMojo
          extended by org.codehaus.mojo.keytool.AbstractKeyToolRequestMojo<R>
Type Parameters:
R - generic type of request used by the mojo
All Implemented Interfaces:
ContextEnabled, Mojo
Direct Known Subclasses:
AbstractKeyToolRequestWithKeyStoreParametersMojo, ImportKeystoreMojo, PrintCertificateMojo, PrintCertificateRequestMojo, PrintCRLFileMojo

public abstract class AbstractKeyToolRequestMojo<R extends KeyToolRequest>
extends AbstractKeyToolMojo

Abstract keytool mojo implementing the KeyToolRequest.

Since:
1.2
Author:
tchemit

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
protected AbstractKeyToolRequestMojo(Class<R> requestType)
          Constructor of abstract mojo.
 
Method Summary
protected  void consumeResult(KeyToolResult result)
          To consume the keytool comand execution.
protected  R createKeytoolRequest()
          To prepare the incoming request, says fill it with mojo parameters.
 void execute()
          
protected  String getCommandlineInfo(org.codehaus.plexus.util.cli.Commandline commandLine)
          Gets a string representation of a Commandline.
 
Methods inherited from class org.codehaus.mojo.keytool.AbstractKeyToolMojo
getMessage, getMessage, getMessage, isSkip, isVerbose, setSkip, setVerbose
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractKeyToolRequestMojo

protected AbstractKeyToolRequestMojo(Class<R> requestType)
Constructor of abstract mojo.

Parameters:
requestType - type of keytool request used by the mojo
Method Detail

execute

public final void execute()
                   throws MojoExecutionException

Throws:
MojoExecutionException

createKeytoolRequest

protected R createKeytoolRequest()
To prepare the incoming request, says fill it with mojo parameters.

Returns:
the created keytool request
See Also:
KeyToolRequest

getCommandlineInfo

protected String getCommandlineInfo(org.codehaus.plexus.util.cli.Commandline commandLine)
Gets a string representation of a Commandline.

This method creates the string representation by calling commandLine.toString() by default.

Parameters:
commandLine - The Commandline to get a string representation of (can not be null).
Returns:
The string representation of commandLine.

consumeResult

protected final void consumeResult(KeyToolResult result)
                            throws MojoExecutionException
To consume the keytool comand execution.

Parameters:
result - result of the command line action
Throws:
MojoExecutionException - if the result is not 0 (means something bad occurs)


Copyright © 2005-2012 Codehaus. All Rights Reserved.