Class Handler


  • public class Handler
    extends Object
    Handler provides helper methods to send and retrieve tx without directly interacting with the HTTP Client.
    • Constructor Detail

      • Handler

        public Handler​(String apiUrl,
                       Serializer serializer)
        Handler constructor.
        Parameters:
        apiUrl - String
        serializer - Serializer
    • Method Detail

      • sendCertificate

        public TxStatus sendCertificate​(Tx tx)
                                 throws IOException
        accepts a tx and sends it to the appropriate certificate API route.
        Parameters:
        tx - Tx
        Returns:
        TxStatus tx status
        Throws:
        IOException - the io exception
      • sendSecret

        public TxStatus sendSecret​(Tx tx)
                            throws IOException
        accepts a tx and sends it to the appropriate API route.
        Parameters:
        tx - Tx
        Returns:
        TxStatus tx status
        Throws:
        IOException - the io exception
      • retrieveCertificate

        public TxWrapper retrieveCertificate​(String id)
                                      throws IOException
        fetches the API and returns a tx wrapper.
        Parameters:
        id - String
        Returns:
        TxWrapper tx wrapper
        Throws:
        IOException - the io exception
      • retrieveCertificatesHistory

        public TxWrappers retrieveCertificatesHistory​(String id)
                                               throws IOException
        fetches the API and returns a tx wrappers.
        Parameters:
        id - String
        Returns:
        TxWrappers tx wrappers
        Throws:
        IOException - the io exception
      • retrieveSecrets

        public TxWrappers retrieveSecrets​(String id)
                                   throws IOException
        fetches the API and returns a tx wrapper list.
        Parameters:
        id - String
        Returns:
        TxWrappers tx wrappers
        Throws:
        IOException - the io exception
      • sendTx

        public TxStatus sendTx​(String route,
                               Tx tx)
                        throws IOException
        tries to send a tx to the API and returns a tx status or throws an api error.
        Parameters:
        route - String
        tx - Tx
        Returns:
        TxStatus tx status
        Throws:
        IOException - the io exception