Examples of Txn


Examples of org.exist.storage.txn.Txn

    private void store(String name,  String data) throws EXistException {
      Database pool = BrokerPool.getInstance();;
     
        DBBroker broker = null;
        TransactionManager transact = null;
        Txn transaction = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            assertNotNull(broker);
            transact = pool.getTransactionManager();
            assertNotNull(transact);
View Full Code Here

Examples of org.exist.storage.txn.Txn

                    remove_account.setRemoved(true);
                    remove_account.setCollection(broker, collectionRemovedAccounts, XmldbURI.create(UUIDGenerator.getUUID()+".xml"));

                    final TransactionManager transaction = getDatabase().getTransactionManager();
                    Txn txn = null;
                    try {
                        txn = transaction.beginTransaction();

                        collectionAccounts.removeXMLResource(txn, broker, XmldbURI.create( remove_account.getName() + ".xml"));
View Full Code Here

Examples of org.exist.storage.txn.Txn

   
                remove_group.setRemoved(true);
                remove_group.setCollection(broker, collectionRemovedGroups, XmldbURI.create(UUIDGenerator.getUUID() + ".xml"));
   
                final TransactionManager transaction = getDatabase().getTransactionManager();
                Txn txn = null;
                try {
                    txn = transaction.beginTransaction();

                    collectionGroups.removeXMLResource(txn, broker, XmldbURI.create(remove_group.getName() + ".xml" ));
View Full Code Here

Examples of org.exist.storage.txn.Txn

//      users = new Int2ObjectHashMap<User>(65);

      this.pool = pool;
     
        final TransactionManager transaction = pool.getTransactionManager();
        Txn txn = null;
   
        Collection systemCollection = null;
        try {
          systemCollection = broker.getCollection(XmldbURI.SYSTEM_COLLECTION_URI);
                if(systemCollection == null) {
View Full Code Here

Examples of org.exist.storage.txn.Txn

                    return new SkippedEntryDeferredPermission();
                }
            }

          final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
          final Txn txn = txnManager.beginTransaction();
          try {
            currentCollection = broker.getOrCreateCollection(txn, collUri);
           
            rh.startCollectionRestore(currentCollection, atts);
           
View Full Code Here

Examples of org.exist.storage.txn.Txn

            if(currentCollection instanceof Observable) {
                listener.observe((Observable)currentCollection);
            }

      final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
      final Txn txn = txnManager.beginTransaction();
 
      DocumentImpl resource = null;
      try {
        if ("XMLResource".equals(type)) {
          // store as xml resource
View Full Code Here

Examples of org.exist.storage.txn.Txn

          try {
            final Collection col = broker.getCollection(currentCollection.getURI().append(name));
            if(col != null) {
              //delete
              final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
              final Txn txn = txnManager.beginTransaction();
              try {
                    broker.removeCollection(txn, col);
                txnManager.commit(txn);
              } catch (final Exception e) {
                txnManager.abort(txn);
               
                    listener.warn("Failed to remove deleted collection: " + name + ": " + e.getMessage());
          } finally {
                        txnManager.close(txn);
                    }
            }
          } catch (final Exception e) {
                listener.warn("Failed to remove deleted collection: " + name + ": " + e.getMessage());
      }

        } else if("resource".equals(type)) {

          try {
            final XmldbURI uri = XmldbURI.create(name);
            final DocumentImpl doc = currentCollection.getDocument(broker, uri);
           
            if (doc != null) {
              final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
              final Txn txn = txnManager.beginTransaction();
                try {
                 
                  if (doc.getResourceType() == DocumentImpl.BINARY_FILE) {
                      currentCollection.removeBinaryResource(txn, broker, uri);
                  } else {
View Full Code Here

Examples of securepay.jxa.api.Txn

        Payment payment = new Payment();
        payment.setServerURL(serverURL);
        payment.setProcessTimeout(Integer.valueOf(processtimeout));
        payment.setMerchantId(merchantId);

        Txn txn = payment.addTxn(10, orderId);
        txn.setTxnSource(8);
        txn.setAmount(Integer.toString(amont));
        if (UtilValidate.isNotEmpty(currency)) {
            txn.setCurrencyCode(currency);
        } else {
            txn.setCurrencyCode("AUD");
        }

        txn.setCardNumber((String) creditCard.get("cardNumber"));
        txn.setExpiryDate(expiryDate.substring(0, 3) + expiryDate.substring(5));
        if (UtilValidate.isNotEmpty(cardSecurityCode)) {
            txn.setCVV(cardSecurityCode);
        }
        // Send payment to SecurePay for processing
        boolean processed = payment.process(pwd);

        Map<String, Object> result = ServiceUtil.returnSuccess();
        if (UtilValidate.isEmpty(processed)) {
            return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                    "AccountingSecurityPayPaymentWasNotSent", locale));
        } else {
            if (payment.getCount() == 1) {
                Txn resp = payment.getTxn(0);
                boolean approved = resp.getApproved();
                if (approved == false){
                    result.put("authResult", new Boolean(false));
                    result.put("authRefNum", "N/A");
                    result.put("processAmount", BigDecimal.ZERO);
                } else {
                    result.put("authRefNum", resp.getTxnId());
                    result.put("authResult", new Boolean(true));
                    result.put("processAmount", processAmount);
                }
                result.put("authCode", resp.getResponseCode());
                result.put("authMessage", resp.getResponseText());
            }
        }
        return result;
    }
View Full Code Here

Examples of securepay.jxa.api.Txn

        Payment payment = new Payment();
        payment.setServerURL(serverURL);
        payment.setProcessTimeout(Integer.valueOf(processtimeout));
        payment.setMerchantId(merchantId);
        Txn txn = payment.addTxn(11, (String) orderPaymentPreference.get("orderId"));
        txn.setTxnSource(8);
        txn.setAmount(Integer.toString(amont));
        txn.setPreauthId(authTransaction.getString("referenceNum"));

        // Send payment to SecurePay for processing
        boolean processed = payment.process(pwd);

        Map<String, Object> result = ServiceUtil.returnSuccess();
        if (UtilValidate.isEmpty(processed)) {
            return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                    "AccountingSecurityPayPaymentWasNotSent", locale));
        } else {
            if (payment.getCount() == 1){
                Txn resp = payment.getTxn(0);
                boolean approved = resp.getApproved();
                if (approved == false){
                    result.put("captureResult", false);
                    result.put("captureRefNum", authTransaction.getString("referenceNum"));
                    result.put("captureAmount", BigDecimal.ZERO);
                } else {
                    result.put("captureResult", true);
                    result.put("captureAmount", captureAmount);
                    result.put("captureRefNum", resp.getTxnId());
                }
                result.put("captureFlag", "C");
                result.put("captureCode", resp.getResponseCode());
                result.put("captureMessage", resp.getResponseText());
            }
        }
        return result;
    }
View Full Code Here

Examples of securepay.jxa.api.Txn

        Payment payment = new Payment();
        payment.setServerURL(serverURL);
        payment.setProcessTimeout(Integer.valueOf(processtimeout));
        payment.setMerchantId(merchantId);
        Txn txn = payment.addTxn(6, (String) orderPaymentPreference.get("orderId"));
        txn.setTxnSource(8);
        txn.setAmount(Integer.toString(amont));
        txn.setTxnId(authTransaction.getString("referenceNum"));

        // Send payment to SecurePay for processing
        boolean processed = payment.process(pwd);

        Map<String, Object> result = ServiceUtil.returnSuccess();
        if (UtilValidate.isEmpty(processed)) {
            return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                    "AccountingSecurityPayPaymentWasNotSent", locale));
        } else {
            if (payment.getCount() == 1){
                Txn resp = payment.getTxn(0);
                boolean approved = resp.getApproved();
                if (approved == false){
                    result.put("releaseResult", false);
                    result.put("releaseRefNum", authTransaction.getString("referenceNum"));
                    result.put("releaseAmount", BigDecimal.ZERO);
                } else {
                    result.put("releaseResult", true);
                    result.put("releaseAmount", releaseAmount);
                    result.put("releaseRefNum", resp.getTxnId());
                }
                result.put("releaseFlag", "U");
                result.put("releaseCode", resp.getResponseCode());
                result.put("releaseMessage", resp.getResponseText());
            }
        }
        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.