本文整理了Java中org.apache.james.mailbox.model.Quota.isOverQuota
方法的一些代码示例,展示了Quota.isOverQuota
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quota.isOverQuota
方法的具体详情如下:
包路径:org.apache.james.mailbox.model.Quota
类名称:Quota
方法名:isOverQuota
[英]Tells us if the quota is reached
[中]告诉我们是否达到了配额
代码示例来源:origin: org.apache.james/apache-james-mailbox-store
private void trySizeAddition(long size) throws OverQuotaException {
Quota<QuotaSize> afterAdditionQuotaSize = sizeQuota.addValueToQuota(QuotaSize.size(size));
if (afterAdditionQuotaSize.isOverQuota()) {
throw new OverQuotaException(
"You use too much space in " + quotaRoot.getValue(),
afterAdditionQuotaSize.getLimit(),
afterAdditionQuotaSize.getUsed());
}
}
代码示例来源:origin: org.apache.james/apache-james-mailbox-store
private void tryCountAddition(long count) throws OverQuotaException {
Quota<QuotaCount> afterAdditionQuotaCount = messageQuota.addValueToQuota(QuotaCount.count(count));
if (afterAdditionQuotaCount.isOverQuota()) {
throw new OverQuotaException(
"You have too many messages in " + quotaRoot.getValue(),
messageQuota.getLimit(),
messageQuota.getUsed());
}
}
代码示例来源:origin: apache/james-project
@Test
public void isOverQuotaShouldReturnFalseWhenQuotaIsNotExceeded() {
Quota<QuotaCount> quota = Quota.<QuotaCount>builder().used(QuotaCount.count(36)).computedLimit(QuotaCount.count(360)).build();
assertThat(quota.isOverQuota()).isFalse();
}
代码示例来源:origin: apache/james-project
@Test
public void isOverQuotaShouldReturnFalseWhenMaxValueIsUnlimited() {
Quota<QuotaCount> quota = Quota.<QuotaCount>builder().used(QuotaCount.count(36)).computedLimit(QuotaCount.unlimited()).build();
assertThat(quota.isOverQuota()).isFalse();
}
代码示例来源:origin: apache/james-project
@Test
public void isOverQuotaShouldReturnTrueWhenQuotaIsExceeded() {
Quota<QuotaCount> quota = Quota.<QuotaCount>builder().used(QuotaCount.count(360)).computedLimit(QuotaCount.count(36)).build();
assertThat(quota.isOverQuota()).isTrue();
}
内容来源于网络,如有侵权,请联系作者删除!