diff --git a/src/main/java/database/transaction/Transaction.java b/src/main/java/database/transaction/Transaction.java index a3087a8..52906b2 100644 --- a/src/main/java/database/transaction/Transaction.java +++ b/src/main/java/database/transaction/Transaction.java @@ -3,8 +3,10 @@ package database.transaction; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; +import java.util.Date; + @DatabaseTable(tableName = "T_TRANSACTION") -public class Transaction { +public class Transaction implements Comparable{ @DatabaseField(generatedId = true) private int transaction_id; @DatabaseField(canBeNull = false) @@ -101,4 +103,11 @@ public class Transaction { ", transaction_unit='" + transaction_unit + '\'' + '}'; } + + @Override + public int compareTo(Transaction t){ + Date date1 = new Date(getTransaction_date()); + Date date2 = new Date(t.getTransaction_date()); + return date1.compareTo(date2); + } } diff --git a/src/main/java/database/transaction/TransactionDao.java b/src/main/java/database/transaction/TransactionDao.java index 0296ea1..42cf198 100644 --- a/src/main/java/database/transaction/TransactionDao.java +++ b/src/main/java/database/transaction/TransactionDao.java @@ -26,46 +26,48 @@ public class TransactionDao { transactionDao.create(transaction); } - public List getUserTransactions(String userHash)throws Exception{ + public List getWalletTransactions(String wallet_hash)throws Exception{ transactionDao = createTransactionDaoConnection(); QueryBuilder queryBuilder = transactionDao.queryBuilder(); - queryBuilder.where().eq("transaction_from",userHash).or().eq("transaction_to",userHash); + queryBuilder.where().eq("transaction_from",wallet_hash).or().eq("transaction_to",wallet_hash); queryBuilder.orderBy("transaction_date",false); PreparedQuery preparedQuery = queryBuilder.prepare(); return transactionDao.query(preparedQuery); } - public List getTenLastUserTransactions(String userHash)throws Exception{ + /* + public List getTenLastUserTransactions(String wallet_hash)throws Exception{ transactionDao = createTransactionDaoConnection(); QueryBuilder queryBuilder = transactionDao.queryBuilder(); - queryBuilder.where().eq("transaction_from",userHash).or().eq("transaction_to",userHash); + queryBuilder.where().eq("transaction_from",wallet_hash).or().eq("transaction_to",wallet_hash); queryBuilder.limit(new Long(10)); queryBuilder.orderBy("transaction_date",false); PreparedQuery preparedQuery = queryBuilder.prepare(); return transactionDao.query(preparedQuery); } + */ - public Transaction getTransaction(String userHash, String transactionHash)throws Exception{ + public Transaction getTransaction(String wallet_hash, String transaction_hash)throws Exception{ transactionDao = createTransactionDaoConnection(); QueryBuilder queryBuilder = transactionDao.queryBuilder(); - queryBuilder.where().eq("transaction_to",userHash).or().eq("transaction_from",userHash).and().eq("transaction_hash",transactionHash); + queryBuilder.where().eq("transaction_to",wallet_hash).or().eq("transaction_from",wallet_hash).and().eq("transaction_hash",transaction_hash); PreparedQuery preparedQuery = queryBuilder.prepare(); return transactionDao.queryForFirst(preparedQuery); } - public List getUserSentTransaction(String userHash)throws Exception{ + public List getUserSentTransaction(String wallet_hash)throws Exception{ transactionDao = createTransactionDaoConnection(); QueryBuilder queryBuilder = transactionDao.queryBuilder(); - queryBuilder.where().eq("transaction_from",userHash); + queryBuilder.where().eq("transaction_from",wallet_hash); queryBuilder.orderBy("transaction_date",false); PreparedQuery preparedQuery = queryBuilder.prepare(); return transactionDao.query(preparedQuery); } - public List getUserReceivedTransaction(String userHash)throws Exception{ + public List getUserReceivedTransaction(String wallet_hash)throws Exception{ transactionDao = createTransactionDaoConnection(); QueryBuilder queryBuilder = transactionDao.queryBuilder(); - queryBuilder.where().eq("transaction_to",userHash); + queryBuilder.where().eq("transaction_to",wallet_hash); queryBuilder.orderBy("transaction_date",false); PreparedQuery preparedQuery = queryBuilder.prepare(); return transactionDao.query(preparedQuery); diff --git a/src/main/java/restImplementation/TransactionImplementation.java b/src/main/java/restImplementation/TransactionImplementation.java index f06a67e..a99c8a5 100644 --- a/src/main/java/restImplementation/TransactionImplementation.java +++ b/src/main/java/restImplementation/TransactionImplementation.java @@ -2,6 +2,8 @@ package restImplementation; import blockchain.query.QueryWrapper; import blockchain.query.TransactionWrapper; +import database.Wallet.Wallet; +import database.Wallet.WalletDao; import database.transaction.Transaction; import database.transaction.TransactionDao; import database.user.User; @@ -14,8 +16,7 @@ import javax.json.JsonObject; import javax.json.JsonReader; import java.io.StringReader; import java.time.Instant; -import java.util.HashMap; -import java.util.List; +import java.util.*; public class TransactionImplementation { @@ -82,29 +83,100 @@ public class TransactionImplementation { } - public List getSentTransaction(String userHash) throws Exception { + //GET + public Transaction getTransaction(String wallet_hash, String transaction_hash) throws Exception { TransactionDao transactionDao = new TransactionDao(); - return transactionDao.getUserSentTransaction(userHash); + return transactionDao.getTransaction(wallet_hash,transaction_hash); } - public List getReceivedTransaction(String userHash) throws Exception { + + //SENT + public List getSentTransaction(String wallet_hash) throws Exception { TransactionDao transactionDao = new TransactionDao(); - return transactionDao.getUserReceivedTransaction(userHash); + return transactionDao.getUserSentTransaction(wallet_hash); + } + public List> getAllSentTransaction(String user_hash) throws Exception { + TransactionDao transactionDao = new TransactionDao(); + WalletDao walletDao = new WalletDao(); + List> transactionList = new ArrayList<>(); + List userWallets = walletDao.getUserWallet(user_hash); + + for(Wallet w : userWallets){ + transactionList.add(transactionDao.getUserSentTransaction(w.getWallet_hash())); + } + return transactionList; } - public Transaction getTransaction(String userHash, String transactionHash) throws Exception { + + //RECEIVED + public List getReceivedTransaction(String wallet_hash) throws Exception { TransactionDao transactionDao = new TransactionDao(); - return transactionDao.getTransaction(userHash,transactionHash); + return transactionDao.getUserReceivedTransaction(wallet_hash); + } + public List> getAllReceivedTransaction(String user_hash) throws Exception { + TransactionDao transactionDao = new TransactionDao(); + WalletDao walletDao = new WalletDao(); + List> transactionList = new ArrayList<>(); + List userWallets = walletDao.getUserWallet(user_hash); + + for(Wallet w : userWallets){ + transactionList.add(transactionDao.getUserReceivedTransaction(w.getWallet_hash())); + } + return transactionList; } - public List getLatestTransactions(String userHash) throws Exception { + + + + public List getLatestTransactions(String user_hash) throws Exception { TransactionDao transactionDao = new TransactionDao(); - return transactionDao.getTenLastUserTransactions(userHash); + WalletDao walletDao = new WalletDao(); + List returnList = new ArrayList<>(); + List userWallets = walletDao.getUserWallet(user_hash); + List allTransactions = new ArrayList<>(); + + for(Wallet w : userWallets){ + List list = transactionDao.getWalletTransactions(w.getWallet_hash()); + for(Transaction t : list){ + allTransactions.add(t); + } + } + Collections.sort(allTransactions); + + int iterator = 0; + int reverseListIndex = allTransactions.size()-1; + while (iterator<10){ + returnList.add(allTransactions.get(reverseListIndex)); + iterator++; + reverseListIndex--; + } + + return returnList; } - public List getUserTransactions(String userHash) throws Exception { + + + public List getAllTransactions(String user_hash) throws Exception { TransactionDao transactionDao = new TransactionDao(); - return transactionDao.getUserTransactions(userHash); + WalletDao walletDao = new WalletDao(); + List userWallets = walletDao.getUserWallet(user_hash); + List allTransactions = new ArrayList<>(); + List returnList = new ArrayList<>(); + + for(Wallet w : userWallets){ + List list = transactionDao.getWalletTransactions(w.getWallet_hash()); + for(Transaction t : list){ + allTransactions.add(t); + } + } + Collections.sort(allTransactions); + for(int i=allTransactions.size()-1;i>0;i--){ + returnList.add(allTransactions.get(i)); + } + + return returnList; } + //TODO SELECT BETWEEN + } diff --git a/src/main/java/restService/TransactionResource.java b/src/main/java/restService/TransactionResource.java index 99b621c..033f35a 100644 --- a/src/main/java/restService/TransactionResource.java +++ b/src/main/java/restService/TransactionResource.java @@ -15,6 +15,7 @@ import java.util.List; @RequestMapping(value = "/api/rest/transaction") public class TransactionResource { + //DO TRANSACTION @RequestMapping(value = "/send", method = RequestMethod.POST, produces = "application/json") @ResponseStatus(HttpStatus.CREATED) public ResponseEntity doTransaction(@Valid @RequestBody SendingTransaction SendingTransaction){ @@ -35,25 +36,45 @@ public class TransactionResource { } } - @RequestMapping(value = "/get", method = RequestMethod.GET, params = {"userHash","txID"},produces = "application/json") + //GET A TRANSACTION + @RequestMapping(value = "/get", method = RequestMethod.GET, params = {"wallet_hash","txID"},produces = "application/json") @ResponseStatus(HttpStatus.OK) - public ResponseEntity getTransaction(@RequestParam(value = "txID") String txID, @RequestParam(value = "userHash") String userHash){ + public ResponseEntity getTransaction(@RequestParam(value = "txID") String txID, @RequestParam(value = "wallet_hash") String wallet_hash){ TransactionImplementation transactionImplementation = new TransactionImplementation(); try { - Transaction transaction = transactionImplementation.getTransaction(userHash,txID); - return ResponseEntity.status(HttpStatus.OK).body(transaction); + Transaction transaction = transactionImplementation.getTransaction(wallet_hash,txID); + if(transaction!=null){ + return ResponseEntity.status(HttpStatus.OK).body(transaction); + } else { + return new ResponseEntity("{\"response\":\"error\"}", HttpStatus.NOT_FOUND); + } }catch (Exception e){ StringResponse responseS = new StringResponse(e.getMessage()); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseS); } } - @RequestMapping(value = "/get/sent", method = RequestMethod.GET, params = {"userHash"}, produces = "application/json") + //SENT + //GET ALL SENT TRANSACTION + @RequestMapping(value = "/get/allSent", method = RequestMethod.GET, params = {"user_hash"}, produces = "application/json") @ResponseStatus(HttpStatus.OK) - public ResponseEntity getSentTransaction(@RequestParam(value = "userHash") String userHash){ + public ResponseEntity getAllSentTransaction(@RequestParam(value = "user_hash") String user_hash){ TransactionImplementation transactionImplementation = new TransactionImplementation(); try { - List listTransaction = transactionImplementation.getSentTransaction(userHash); + List> listTransaction = transactionImplementation.getAllSentTransaction(user_hash); + return ResponseEntity.status(HttpStatus.OK).body(listTransaction); + } catch (Exception e){ + StringResponse responseS = new StringResponse(e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseS); + } + } + //GET SENT FROM WALLET + @RequestMapping(value = "/get/sent", method = RequestMethod.GET, params = {"wallet_hash"}, produces = "application/json") + @ResponseStatus(HttpStatus.OK) + public ResponseEntity getSentTransaction(@RequestParam(value = "wallet_hash") String wallet_hash){ + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try { + List listTransaction = transactionImplementation.getSentTransaction(wallet_hash); return ResponseEntity.status(HttpStatus.OK).body(listTransaction); } catch (Exception e){ StringResponse responseS = new StringResponse(e.getMessage()); @@ -61,12 +82,28 @@ public class TransactionResource { } } - @RequestMapping(value = "/get/received", method = RequestMethod.GET, params = {"userHash"}, produces = "application/json") + + //RECEIVED + //GET ALL RECEIVED TRANSACTION + @RequestMapping(value = "/get/allReceived", method = RequestMethod.GET, params = {"user_hash"}, produces = "application/json") @ResponseStatus(HttpStatus.OK) - public ResponseEntity getReceivedTransaction(@RequestParam(value = "userHash") String userHash){ + public ResponseEntity getAllReceivedTransaction(@RequestParam(value = "user_hash") String user_hash){ TransactionImplementation transactionImplementation = new TransactionImplementation(); try { - List listTransaction = transactionImplementation.getReceivedTransaction(userHash); + List> listTransaction = transactionImplementation.getAllReceivedTransaction(user_hash); + return ResponseEntity.status(HttpStatus.OK).body(listTransaction); + } catch (Exception e){ + StringResponse responseS = new StringResponse(e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseS); + } + } + //GET RECEIVED FROM WALLET + @RequestMapping(value = "/get/received", method = RequestMethod.GET, params = {"wallet_hash"}, produces = "application/json") + @ResponseStatus(HttpStatus.OK) + public ResponseEntity getReceivedTransaction(@RequestParam(value = "wallet_hash") String wallet_hash){ + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try { + List listTransaction = transactionImplementation.getReceivedTransaction(wallet_hash); return ResponseEntity.status(HttpStatus.OK).body(listTransaction); } catch (Exception e){ StringResponse responseS = new StringResponse(e.getMessage()); @@ -74,12 +111,14 @@ public class TransactionResource { } } - @RequestMapping(value = "/get/latest", method = RequestMethod.GET, params = {"userHash"}, produces = "application/json") + + + @RequestMapping(value = "/get/latest", method = RequestMethod.GET, params = {"user_hash"}, produces = "application/json") @ResponseStatus(HttpStatus.OK) - public ResponseEntity getLatestTransaction(@RequestParam(value = "userHash") String userHash){ + public ResponseEntity getLatestTransaction(@RequestParam(value = "user_hash") String user_hash){ TransactionImplementation transactionImplementation = new TransactionImplementation(); try { - List listTransaction = transactionImplementation.getLatestTransactions(userHash); + List listTransaction = transactionImplementation.getLatestTransactions(user_hash); return ResponseEntity.status(HttpStatus.OK).body(listTransaction); } catch (Exception e){ StringResponse responseS = new StringResponse(e.getMessage()); @@ -87,16 +126,18 @@ public class TransactionResource { } } - @RequestMapping(value = "/getAll", method = RequestMethod.GET, params = {"userHash"}, produces = "application/json") + + @RequestMapping(value = "/getAll", method = RequestMethod.GET, params = {"user_hash"}, produces = "application/json") @ResponseStatus(HttpStatus.OK) - public ResponseEntity getAllTransaction(@RequestParam(value = "userHash") String userHash){ + public ResponseEntity getAllTransaction(@RequestParam(value = "user_hash") String user_hash){ TransactionImplementation transactionImplementation = new TransactionImplementation(); try { - List listTransaction = transactionImplementation.getUserTransactions(userHash); + List listTransaction = transactionImplementation.getAllTransactions(user_hash); return ResponseEntity.status(HttpStatus.OK).body(listTransaction); } catch (Exception e){ StringResponse responseS = new StringResponse(e.getMessage()); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseS); } } + } diff --git a/src/test/java/restImplementation/TransactionImplementationTest.java b/src/test/java/restImplementation/TransactionImplementationTest.java index 6ec39b0..d22b862 100644 --- a/src/test/java/restImplementation/TransactionImplementationTest.java +++ b/src/test/java/restImplementation/TransactionImplementationTest.java @@ -1,21 +1,69 @@ package restImplementation; +import database.transaction.Transaction; +import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Logger; import org.junit.Ignore; import org.junit.Test; +import java.util.Date; import java.util.HashMap; +import java.util.List; @Ignore public class TransactionImplementationTest { private static Logger logger = Logger.getLogger(TransactionImplementationTest.class); + + /* + @Test + public void doMultipleTransaction(){ + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try { + + for(int i=0;i<12;i++){ + HashMap transactionResponse = transactionImplementation.sendTransaction("$2a$10$J7B8sXULfiPfnlKRlTjqQuSrbumTyv.acB8NpxDrUQ3WmnfKdjx0.","thomasPwd158$*", + "$2a$10$6Z4uNeOgAKhpWYGVYwPWhe6G91lIKHOCA2yYcpzS1pbJyosNNw3Gu","$2a$10$hdvk6LuOxVOI1EXtmswh0eJco0nOJVTEaJdEKuy/6tGcdxetDbY4i",1.0,"gonette"); + if(Boolean.parseBoolean(transactionResponse.get("success").toString())){ + logger.info("transaction ID: "+transactionResponse.get("message")); + } else { + logger.warn("Error (else) : "+transactionResponse.get("message")); + } + } + + for(int i=0;i<4;i++){ + HashMap transactionResponse = transactionImplementation.sendTransaction("$2a$10$GzyMhD3n05Z2lwCnoGi2dusjKrNAmHhtn5fw1xLpes5.cEV5T7lve","gonClaire789$*", + "$2a$10$UKiTo/eqpnvlny3U5xpJ../C2WOgoxebAl3xiexAhinC8X7Jt2wY.","$2a$10$8PJyraUjMoL/h.cQjJyMZedBUlcTjPjNm4j1NuqzQBTnSe2XNuGM2",1.0,"gonette"); + if(Boolean.parseBoolean(transactionResponse.get("success").toString())){ + logger.info("transaction ID: "+transactionResponse.get("message")); + } else { + logger.warn("Error (else) : "+transactionResponse.get("message")); + } + } + + for(int i=0;i<3;i++){ + HashMap transactionResponse = transactionImplementation.sendTransaction("$2a$10$GzyMhD3n05Z2lwCnoGi2dusjKrNAmHhtn5fw1xLpes5.cEV5T7lve","gonClaire789$*", + "$2a$10$hdvk6LuOxVOI1EXtmswh0eJco0nOJVTEaJdEKuy/6tGcdxetDbY4i","$2a$10$6Z4uNeOgAKhpWYGVYwPWhe6G91lIKHOCA2yYcpzS1pbJyosNNw3Gu",1.0,"gonette"); + if(Boolean.parseBoolean(transactionResponse.get("success").toString())){ + logger.info("transaction ID: "+transactionResponse.get("message")); + } else { + logger.warn("Error (else) : "+transactionResponse.get("message")); + } + } + + }catch (Exception e){ + logger.warn("Error: "+e.getMessage()); + } + } + */ + /* @Test public void doTransaction(){ TransactionImplementation transactionImplementation = new TransactionImplementation(); try { - HashMap transactionResponse = transactionImplementation.sendTransaction("$2a$10$WN6ARfShm9bgRZ8s9bzZqejvL.VzZrjXRmZLj6N3U6No9G/YLVqVi","$2a$10$7gIjefImB/xYvsOukIbk5.miCn88CE9pBfhz9xE5NE4HwQKZWcorS",1.0,"gonette"); + HashMap transactionResponse = transactionImplementation.sendTransaction("$2a$10$J7B8sXULfiPfnlKRlTjqQuSrbumTyv.acB8NpxDrUQ3WmnfKdjx0.","thomasPwd158$*", + "$2a$10$6Z4uNeOgAKhpWYGVYwPWhe6G91lIKHOCA2yYcpzS1pbJyosNNw3Gu","$2a$10$8PJyraUjMoL/h.cQjJyMZedBUlcTjPjNm4j1NuqzQBTnSe2XNuGM2",1.0,"gonette"); if(Boolean.parseBoolean(transactionResponse.get("success").toString())){ logger.info("transaction ID: "+transactionResponse.get("message")); } else { @@ -26,4 +74,138 @@ public class TransactionImplementationTest { } } */ + + /* + @Test + public void doTransaction(){ + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try { + HashMap transactionResponse = transactionImplementation.sendTransaction("$2a$10$J7B8sXULfiPfnlKRlTjqQuSrbumTyv.acB8NpxDrUQ3WmnfKdjx0.","thomasPwd158$*", + "$2a$10$8PJyraUjMoL/h.cQjJyMZedBUlcTjPjNm4j1NuqzQBTnSe2XNuGM2","$2a$10$6Z4uNeOgAKhpWYGVYwPWhe6G91lIKHOCA2yYcpzS1pbJyosNNw3Gu",1.0,"gonette"); + if(Boolean.parseBoolean(transactionResponse.get("success").toString())){ + logger.info("transaction ID: "+transactionResponse.get("message")); + } else { + logger.warn("Error (else) : "+transactionResponse.get("message")); + } + }catch (Exception e){ + logger.warn("Error: "+e.getMessage()); + } + } + */ + + + /* + @Test + public void getAllSentTransaction(){ + BasicConfigurator.configure(); + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try { + List> result = transactionImplementation.getAllSentTransaction("$2a$10$J7B8sXULfiPfnlKRlTjqQuSrbumTyv.acB8NpxDrUQ3WmnfKdjx0."); + //logger.info(result); + for(List re : result){ + logger.info(re); + for(Transaction t: re){ + logger.info(t); + } + logger.info(" other wallet"); + } + }catch (Exception e){ + logger.warn("Error: "+e.getMessage()); + } + } + */ + + /* + @Test + public void getSent(){ + BasicConfigurator.configure(); + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try { + List result = transactionImplementation.getSentTransaction("$2a$10$6Z4uNeOgAKhpWYGVYwPWhe6G91lIKHOCA2yYcpzS1pbJyosNNw3Gu"); + //logger.info(result); + for(Transaction re : result){ + logger.info(re); + } + }catch (Exception e){ + logger.warn("Error: "+e.getMessage()); + } + } + */ + + + /* + @Test + public void getAllReceivedTransaction(){ + BasicConfigurator.configure(); + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try { + List> result = transactionImplementation.getAllReceivedTransaction("$2a$10$J7B8sXULfiPfnlKRlTjqQuSrbumTyv.acB8NpxDrUQ3WmnfKdjx0."); + //logger.info(result); + for(List re : result){ + logger.info(re); + for(Transaction t: re){ + logger.info(t); + } + logger.info(" other wallet"); + } + }catch (Exception e){ + logger.warn("Error: "+e.getMessage()); + } + } + */ + + + /* + @Test + public void getReceived(){ + BasicConfigurator.configure(); + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try { + List result = transactionImplementation.getReceivedTransaction("$2a$10$6Z4uNeOgAKhpWYGVYwPWhe6G91lIKHOCA2yYcpzS1pbJyosNNw3Gu"); + //logger.info(result); + for(Transaction re : result){ + logger.info(re); + } + }catch (Exception e){ + logger.warn("Error: "+e.getMessage()); + } + } + */ + + + /* + @Test + public void getLatestTransactions(){ + BasicConfigurator.configure(); + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try{ + List listT = transactionImplementation.getLatestTransactions("$2a$10$J7B8sXULfiPfnlKRlTjqQuSrbumTyv.acB8NpxDrUQ3WmnfKdjx0."); + logger.info("size : "+listT.size()); + for(Transaction t:listT){ + + logger.info(t.getTransaction_from()+" - "+t.getTransaction_to()+" - "+new Date(t.getTransaction_date())); + } + }catch (Exception e){ + logger.warn("Error: "+e.getMessage()); + } + } + */ + + /* + @Test + public void getAllTransaction(){ + BasicConfigurator.configure(); + TransactionImplementation transactionImplementation = new TransactionImplementation(); + try{ + List listT = transactionImplementation.getAllTransactions("$2a$10$J7B8sXULfiPfnlKRlTjqQuSrbumTyv.acB8NpxDrUQ3WmnfKdjx0."); + logger.info("size : "+listT.size()); + for(Transaction t:listT){ + logger.info(new Date(t.getTransaction_date())+"-"+t); + } + }catch (Exception e){ + logger.warn("Error: "+e.getMessage()); + } + } + */ + }