mirror of https://github.com/apache/cloudstack.git
quota: rename method to lastQuotaBalance
This commit is contained in:
parent
ca6dfc99ac
commit
b388512191
|
|
@ -84,7 +84,6 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
|
|||
return response;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QuotaBalanceResponse createQuotaBalanceResponse(List<QuotaBalanceVO> quotaBalance, Date startDate, Date endDate) {
|
||||
if (quotaBalance.size() == 0) {
|
||||
|
|
@ -128,7 +127,7 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
|
|||
|
||||
@Override
|
||||
public QuotaStatementResponse createQuotaStatementResponse(List<QuotaUsageVO> quotaUsage) {
|
||||
if (quotaUsage == null || quotaUsage.size()==0) {
|
||||
if (quotaUsage == null || quotaUsage.size() == 0) {
|
||||
new InvalidParameterValueException("There is no uage data for period mentioned.");
|
||||
}
|
||||
final short opendb = TransactionLegacy.currentTxn().getDatabaseId();
|
||||
|
|
@ -215,7 +214,7 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
|
|||
throw new InvalidParameterValueException("Incorrect effective date for tariff " + effectiveDate + " is less than now " + now);
|
||||
}
|
||||
QuotaTypes quotaConstant = QuotaTypes.listQuotaTypes().get(quotaType);
|
||||
if (quotaConstant==null) {
|
||||
if (quotaConstant == null) {
|
||||
throw new InvalidParameterValueException("Quota type does not exists " + quotaType);
|
||||
}
|
||||
final short opendb = TransactionLegacy.currentTxn().getDatabaseId();
|
||||
|
|
@ -317,7 +316,6 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QuotaBalanceResponse createQuotaLastBalanceResponse(List<QuotaBalanceVO> quotaBalance, Date startDate) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ public interface QuotaBalanceDao extends GenericDao<QuotaBalanceVO, Long> {
|
|||
|
||||
List<QuotaBalanceVO> findQuotaBalance(Long accountId, Long domainId, Date startDate);
|
||||
|
||||
BigDecimal createQuotaLastBalanceResponse(Long accountId, Long domainId, Date startDate);
|
||||
BigDecimal lastQuotaBalance(Long accountId, Long domainId, Date startDate);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ package org.apache.cloudstack.quota.dao;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
|
@ -27,7 +25,6 @@ import java.util.List;
|
|||
import javax.ejb.Local;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.apache.cloudstack.api.response.QuotaBalanceResponse;
|
||||
import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -182,10 +179,9 @@ public class QuotaBalanceDaoImpl extends GenericDaoBase<QuotaBalanceVO, Long> im
|
|||
TransactionLegacy.open(opendb).close();
|
||||
return trimmedRecords;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BigDecimal createQuotaLastBalanceResponse(final Long accountId, final Long domainId, Date startDate) {
|
||||
public BigDecimal lastQuotaBalance(final Long accountId, final Long domainId, Date startDate) {
|
||||
List<QuotaBalanceVO> quotaBalance = findQuotaBalance(accountId, domainId, startDate);
|
||||
if (quotaBalance.size() == 0) {
|
||||
new InvalidParameterValueException("There are no balance entries on or before the requested date.");
|
||||
|
|
|
|||
Loading…
Reference in New Issue