Package convex.cli

Class Main

java.lang.Object
convex.cli.Main
All Implemented Interfaces:
Runnable

public class Main extends Object implements Runnable
Convex CLI implementation
  • Constructor Details

    • Main

      public Main()
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • main

      public static void main(String[] args)
      Java main(...) entry point when run as a Java application. Exits JVM process with specified exit code
    • mainExecute

      public int mainExecute(String[] args)
      Command line execution entry point. Can be run from Java code without terminating the JVM.
      Parameters:
      args - Command line arguments
      Returns:
      Process result value
    • loadConfig

      protected boolean loadConfig()
      Loads the specified config file.
      Returns:
      true if config file correctly loaded, false otherwise (e.g. if it does not exist)
    • getSessionFilename

      public String getSessionFilename()
    • getPassword

      public String getPassword()
      Get the currently configured password for the keystore. Will emit warning and default to blank password if not provided
      Returns:
      Password string
    • setPassword

      public void setPassword(String password)
      Sets the currently defined keystore password
      Parameters:
      password - Password to use
    • getKeyStoreFilename

      public String getKeyStoreFilename()
      Gets the keystore file name currently used for the CLI
      Returns:
      File name, or null if not specified
    • getEtchStoreFilename

      public String getEtchStoreFilename()
    • getKeystore

      public KeyStore getKeystore()
      Gets the current key store
      Returns:
      KeyStore instance, or null if it does not exist
    • getKeystore

      public KeyStore getKeystore(boolean create)
      Gets the current key store.
      Parameters:
      create - Flag to indicate if keystore should be created
      Returns:
      KeyStore instance
    • loadKeyFromStore

      public AKeyPair loadKeyFromStore(String publicKey)
      Loads a keypair from configured keystore
      Parameters:
      publicKey - String identifying the public key. May be a prefix
      Returns:
      Keypair instance, or null if not found
    • connectToSessionPeer

      public Convex connectToSessionPeer(String hostname, int port, Address address, AKeyPair keyPair)
    • connectAsPeer

      public Convex connectAsPeer(int peerIndex) throws Error
      Throws:
      Error
    • generateKeyPairs

      public List<AKeyPair> generateKeyPairs(int count)
      Generate key pairs and add to store. Does not save store!
      Parameters:
      count - Number of key pairs to generate
      Returns:
      List of key pairs
    • addKeyPairToStore

      public void addKeyPairToStore(AKeyPair keyPair)
      Adds key pair to store. Does not save keystore!
      Parameters:
      keyPair - Keypair to add
    • println

      public void println(String s)
    • printError

      public void printError(Result result)
    • printResult

      public void printResult(Result result)
    • printRecord

      public void printRecord(RecordOutput output)
    • println

      public void println(Object value)