Package com.github.katenachain.api
Class Handler
- java.lang.Object
-
- com.github.katenachain.api.Handler
-
public class Handler extends Object
Handler provides helper methods to send and retrieve tx without directly interacting with the HTTP Client.
-
-
Constructor Summary
Constructors Constructor Description Handler(String apiUrl, Serializer serializer)Handler constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TxWrapperretrieveCertificate(String id)fetches the API and returns a tx wrapper.TxWrappersretrieveCertificatesHistory(String id)fetches the API and returns a tx wrappers.TxWrappersretrieveSecrets(String id)fetches the API and returns a tx wrapper list.TxStatussendCertificate(Tx tx)accepts a tx and sends it to the appropriate certificate API route.TxStatussendSecret(Tx tx)accepts a tx and sends it to the appropriate API route.TxStatussendTx(String route, Tx tx)tries to send a tx to the API and returns a tx status or throws an api error.
-
-
-
Constructor Detail
-
Handler
public Handler(String apiUrl, Serializer serializer)
Handler constructor.
-
-
Method Detail
-
sendCertificate
public TxStatus sendCertificate(Tx tx) throws IOException, ApiException
accepts a tx and sends it to the appropriate certificate API route.- Throws:
IOExceptionApiException
-
sendSecret
public TxStatus sendSecret(Tx tx) throws IOException, ApiException
accepts a tx and sends it to the appropriate API route.- Throws:
IOExceptionApiException
-
retrieveCertificate
public TxWrapper retrieveCertificate(String id) throws IOException, ApiException
fetches the API and returns a tx wrapper.- Throws:
IOExceptionApiException
-
retrieveCertificatesHistory
public TxWrappers retrieveCertificatesHistory(String id) throws IOException, ApiException
fetches the API and returns a tx wrappers.- Throws:
IOExceptionApiException
-
retrieveSecrets
public TxWrappers retrieveSecrets(String id) throws IOException, ApiException
fetches the API and returns a tx wrapper list.- Throws:
IOExceptionApiException
-
sendTx
public TxStatus sendTx(String route, Tx tx) throws IOException, ApiException
tries to send a tx to the API and returns a tx status or throws an api error.- Throws:
IOExceptionApiException
-
-