org.zeroexchange.mcredit.write
Class DefaultCreditLineWriter

java.lang.Object
  extended by org.zeroexchange.mcredit.write.DefaultCreditLineWriter
All Implemented Interfaces:
CreditLineWriter

public class DefaultCreditLineWriter
extends Object
implements CreditLineWriter

Author:
black

Constructor Summary
DefaultCreditLineWriter()
           
 
Method Summary
 SlicingDataSet<CreditLine> getUserLines(User creditor)
          Returns credit lines for the specified creditor.
 void remove(CreditLine creditLine)
          Remove credit line by id.
protected  Collection<CreditLine> roteDebt(Collection<CreditLine> path, BigDecimal valueToMove)
          Routes the specified value over the route.
 CreditPaths roteDebt(CreditPaths originalTwoPartnerPaths, BigDecimal value)
          Performs movement of mutual credit.
 CreditLine setCreditLine(User creditor, User debtor, BigDecimal value)
          Adds user credit relation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCreditLineWriter

public DefaultCreditLineWriter()
Method Detail

getUserLines

public SlicingDataSet<CreditLine> getUserLines(User creditor)
Returns credit lines for the specified creditor.

Specified by:
getUserLines in interface CreditLineWriter

setCreditLine

@Transactional
public CreditLine setCreditLine(User creditor,
                                              User debtor,
                                              BigDecimal value)
Adds user credit relation.

Specified by:
setCreditLine in interface CreditLineWriter

roteDebt

@Transactional(rollbackFor=DebtRotingException.class)
public CreditPaths roteDebt(CreditPaths originalTwoPartnerPaths,
                                                                   BigDecimal value)
                     throws DebtRotingException
Performs movement of mutual credit.

Specified by:
roteDebt in interface CreditLineWriter
Returns:
TODO
Throws:
DebtRotingException

remove

@Transactional
public void remove(CreditLine creditLine)
Remove credit line by id.

Specified by:
remove in interface CreditLineWriter

roteDebt

protected Collection<CreditLine> roteDebt(Collection<CreditLine> path,
                                          BigDecimal valueToMove)
Routes the specified value over the route. Returns collection of the affected complementary lines.



Copyright © 2013. All Rights Reserved.