Class SsmActionBase

java.lang.Object
org.jpos.q2.cli.ssm.SsmActionBase
All Implemented Interfaces:
CLICommand
Direct Known Subclasses:
CK, CVV, FK, GC, IK, KE

public abstract class SsmActionBase extends Object implements CLICommand
Provides base for most SSM based commands. The exec method wraps the processing for derived classes.
  • Constructor Details

    • SsmActionBase

      protected SsmActionBase()
      Default constructor; no instance state to initialise.
  • Method Details

    • checkUsage

      protected abstract boolean checkUsage(CLIContext cli, String[] strings)
      Validates the command-line arguments before any side effects, returning false to abort the command (the implementation should print its own usage message).
      Parameters:
      cli - CLI context
      strings - command-line tokens
      Returns:
      true when the arguments are acceptable
    • doCommand

      protected abstract void doCommand(CLIContext cli, JCESecurityModule sm, short keyLength, String[] strings) throws SMException
      Performs the actual SSM operation against sm.
      Parameters:
      cli - CLI context
      sm - resolved security module
      keyLength - resolved key length in bits
      strings - command-line tokens
      Throws:
      SMException - if the security module operation fails
    • exec

      public void exec(CLIContext cli, String[] strings) throws Exception
      Description copied from interface: CLICommand
      Executes the CLI command.
      Specified by:
      exec in interface CLICommand
      Parameters:
      cli - the CLI context
      strings - command arguments
      Throws:
      Exception - on error