コード例 #1
0
  public void setToCryptoStatus(
      OutgoingDraftTransactionWrapper transactionWrapper, CryptoStatus cryptoStatus)
      throws CantUpdateRecordException, CantLoadTableToMemoryException,
          com.bitdubai.fermat_ccp_plugin.layer.crypto_transaction.outgoing_draft.developer.bitdubai
              .version_1.exceptions.OutgoingIntraActorInconsistentTableStateException {
    try {
      DatabaseTable transactionTable =
          this.database.getTable(
              OutgoingDraftTransactionDatabaseConstants.OUTGOING_DRAFT_TABLE_NAME);
      DatabaseTableRecord recordToUpdate = getByPrimaryKey(transactionWrapper.getRequestId());

      recordToUpdate.setStringValue(
          OutgoingDraftTransactionDatabaseConstants.OUTGOING_DRAFT_CRYPTO_STATUS_COLUMN_NAME,
          cryptoStatus.getCode());
      transactionTable.addStringFilter(
          OutgoingDraftTransactionDatabaseConstants.OUTGOING_DRAFT_TRANSACTION_ID_COLUMN_NAME,
          transactionWrapper.getRequestId().toString(),
          DatabaseFilterType.EQUAL);

      transactionTable.updateRecord(recordToUpdate);

    } catch (CantUpdateRecordException
        | com.bitdubai.fermat_ccp_plugin.layer.crypto_transaction.outgoing_draft.developer.bitdubai
            .version_1.exceptions.OutgoingIntraActorInconsistentTableStateException
        | CantLoadTableToMemoryException exception) {
      throw exception;
    } catch (Exception exception) {
      throw new CantLoadTableToMemoryException(
          CantLoadTableToMemoryException.DEFAULT_MESSAGE,
          FermatException.wrapException(exception),
          null,
          null);
    }
  }
コード例 #2
0
  private void setToState(
      OutgoingDraftTransactionWrapper bitcoinTransaction,
      com.bitdubai.fermat_ccp_plugin.layer.crypto_transaction.outgoing_draft.developer.bitdubai
              .version_1.enums.TransactionState
          status)
      throws CantUpdateRecordException,
          com.bitdubai.fermat_ccp_plugin.layer.crypto_transaction.outgoing_draft.developer.bitdubai
              .version_1.exceptions.OutgoingIntraActorInconsistentTableStateException,
          CantLoadTableToMemoryException {
    DatabaseTable transactionTable =
        this.database.getTable(OutgoingDraftTransactionDatabaseConstants.OUTGOING_DRAFT_TABLE_NAME);
    DatabaseTableRecord recordToUpdate = getByPrimaryKey(bitcoinTransaction.getRequestId());

    recordToUpdate.setStringValue(
        OutgoingDraftTransactionDatabaseConstants.OUTGOING_DRAFT_TRANSACTION_STATUS_COLUMN_NAME,
        status.getCode());

    transactionTable.addStringFilter(
        OutgoingDraftTransactionDatabaseConstants.OUTGOING_DRAFT_TRANSACTION_ID_COLUMN_NAME,
        bitcoinTransaction.getRequestId().toString(),
        DatabaseFilterType.EQUAL);
    transactionTable.updateRecord(recordToUpdate);
  }