/**
   * This method starts the appropriation flow. Saves the information in the database and store the
   * asset in the file system.
   *
   * @param digitalAssetMetadata the asset to be appropriated
   * @param assetIssuerWalletPublicKey the public key from the asset user wallet where this asset
   *     will be debited.
   * @param bitcoinWalletPublicKey the bitcoin wallet public key where the bitcoins will be sent.
   * @throws CantExecuteAppropriationTransactionException in case something bad happen and the
   *     appropriation flow can't start.
   * @throws TransactionAlreadyStartedException in case for some reason you try to appropriate the
   *     same asset twice.
   */
  @Override
  public void appropriateAsset(
      DigitalAssetMetadata digitalAssetMetadata,
      String assetIssuerWalletPublicKey,
      String bitcoinWalletPublicKey,
      BlockchainNetworkType networkType)
      throws CantExecuteAppropriationTransactionException, TransactionAlreadyStartedException {
    String context =
        "Asset: "
            + digitalAssetMetadata
            + " - User Wallet: "
            + assetIssuerWalletPublicKey
            + " - BTC Wallet: "
            + bitcoinWalletPublicKey
            + " - Network: "
            + networkType;

    try {
      IssuerAppropriationDAO dao =
          new IssuerAppropriationDAO(pluginDatabaseSystem, pluginId, assetVault);
      String transactionId =
          dao.startAppropriation(
              digitalAssetMetadata,
              assetIssuerWalletPublicKey,
              bitcoinWalletPublicKey,
              networkType);
    } catch (TransactionAlreadyStartedException | CantExecuteAppropriationTransactionException e) {
      throw e;
    } catch (Exception e) {
      throw new CantExecuteAppropriationTransactionException(context, e);
    }
  }