本文整理汇总了Java中nl.strohalm.cyclos.utils.TimePeriod.remove方法的典型用法代码示例。如果您正苦于以下问题:Java TimePeriod.remove方法的具体用法?Java TimePeriod.remove怎么用?Java TimePeriod.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nl.strohalm.cyclos.utils.TimePeriod
的用法示例。
在下文中一共展示了TimePeriod.remove方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: guaranteesToProcess
import nl.strohalm.cyclos.utils.TimePeriod; //导入方法依赖的package包/类
@Override
public List<Guarantee> guaranteesToProcess(Calendar time) {
time = DateHelper.truncate(time);
final GuaranteeQuery query = new GuaranteeQuery();
query.setResultType(ResultType.ITERATOR);
final Set<Relationship> fetch = new HashSet<Relationship>();
fetch.add(Guarantee.Relationships.GUARANTEE_TYPE);
fetch.add(Guarantee.Relationships.LOGS);
query.setFetch(fetch);
query.setStatusList(Arrays.asList(Guarantee.Status.PENDING_ADMIN, Guarantee.Status.PENDING_ISSUER));
final List<Guarantee> result = new ArrayList<Guarantee>();
final List<Guarantee> guarantees = guaranteeDao.search(query);
for (final Guarantee guarantee : guarantees) {
final TimePeriod period = guarantee.getGuaranteeType().getPendingGuaranteeExpiration();
final Calendar lowerBound = period.remove(time);
final Calendar registrationDate = DateHelper.truncate(guarantee.getRegistrationDate());
if (registrationDate.before(lowerBound)) {
result.add(guarantee);
}
}
return result;
}
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:25,代码来源:GuaranteeServiceImpl.java示例2: hasPasswordExpired
import nl.strohalm.cyclos.utils.TimePeriod; //导入方法依赖的package包/类
@Override
public boolean hasPasswordExpired() {
Group group = LoggedUser.group();
if (group instanceof OperatorGroup) {
group = fetchService.fetch(group, RelationshipHelper.nested(OperatorGroup.Relationships.MEMBER, Element.Relationships.GROUP));
}
final TimePeriod exp = group.getBasicSettings().getPasswordExpiresAfter();
final Calendar passwordDate = LoggedUser.user().getPasswordDate();
if (passwordDate == null) {
return true;
}
if (exp != null && exp.getNumber() > 0 && passwordDate != null) {
final Calendar expiresAt = exp.remove(Calendar.getInstance());
return expiresAt.after(passwordDate);
}
return false;
}
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:18,代码来源:AccessServiceImpl.java示例3: prepareForm
import nl.strohalm.cyclos.utils.TimePeriod; //导入方法依赖的package包/类
@Override
protected AbstractAdQuery prepareForm(final ActionContext context) {
final HttpServletRequest request = context.getRequest();
final AbstractAdQuery query = super.prepareForm(context);
query.fetch(RelationshipHelper.nested(Ad.Relationships.CATEGORY, RelationshipHelper.nested(AdCategory.MAX_LEVEL, AdCategory.Relationships.PARENT)), Ad.Relationships.CUSTOM_VALUES);
// Store the ad custom values
request.setAttribute("adFields", adCustomFieldService.list());
// Calculate since date
final TimePeriod since = query.getSince();
Calendar sinceDate = null;
if (since != null && since.isValid()) {
sinceDate = since.remove(Calendar.getInstance());
}
request.setAttribute("sinceDate", sinceDate);
return query;
}
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:20,代码来源:PrintAdsAction.java示例4: purgeExpiredMessagesOnTrash
import nl.strohalm.cyclos.utils.TimePeriod; //导入方法依赖的package包/类
@Override
public void purgeExpiredMessagesOnTrash(final Calendar time) {
final TimePeriod timePeriod = settingsService.getLocalSettings().getDeleteMessagesOnTrashAfter();
if (timePeriod == null || timePeriod.getNumber() <= 0) {
return;
}
final Calendar limit = timePeriod.remove(DateHelper.truncate(time));
messageDao.removeMessagesOnTrashBefore(limit);
}
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:10,代码来源:MessageServiceImpl.java示例5: processMembersExpirationForGroups
import nl.strohalm.cyclos.utils.TimePeriod; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public int processMembersExpirationForGroups(final Calendar time) {
// Find on member groups...
final GroupQuery query = new GroupQuery();
query.setNatures(Group.Nature.MEMBER, Group.Nature.BROKER);
int count = 0;
final List<Group> groups = (List<Group>) groupService.search(query);
final String message = messageResolver.message("changeGroup.member.expired");
for (final Group group : groups) {
final MemberGroup memberGroup = (MemberGroup) fetchService.fetch(group);
final MemberGroupSettings memberSettings = memberGroup.getMemberSettings();
final TimePeriod expireMembersAfter = memberSettings.getExpireMembersAfter();
// ... those who expire members after a given time period ...
if (expireMembersAfter == null || expireMembersAfter.getNumber() <= 0) {
continue;
}
final Calendar limit = expireMembersAfter.remove(DateHelper.truncate(time));
final List<Member> members = elementDao.listMembersRegisteredBeforeOnGroup(limit, memberGroup);
final MemberGroup groupAfterExpiration = memberSettings.getGroupAfterExpiration();
// ... then expire members on that group
for (final Member member : members) {
changeGroup(member, groupAfterExpiration, message);
count++;
}
}
return count;
}
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:29,代码来源:ElementServiceImpl.java示例6: purgeOldEmailValidations
import nl.strohalm.cyclos.utils.TimePeriod; //导入方法依赖的package包/类
@Override
public void purgeOldEmailValidations(final Calendar time) {
final LocalSettings localSettings = settingsService.getLocalSettings();
final TimePeriod timePeriod = localSettings.getDeletePendingRegistrationsAfter();
if (timePeriod == null || timePeriod.getNumber() <= 0) {
return;
}
Calendar limit = timePeriod.remove(time);
pendingMemberDao.deleteBefore(limit);
pendingEmailChangeDao.deleteBefore(limit);
}
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:12,代码来源:ElementServiceImpl.java示例7: removeExpiredBrokerings
import nl.strohalm.cyclos.utils.TimePeriod; //导入方法依赖的package包/类
@Override
public void removeExpiredBrokerings(final Calendar time) {
final LocalSettings localSettings = settingsService.getLocalSettings();
final TimePeriod brokeringExpirationPeriod = localSettings.getBrokeringExpirationPeriod();
if (brokeringExpirationPeriod == null || brokeringExpirationPeriod.getNumber() <= 0) {
return;
}
final Calendar startDate = brokeringExpirationPeriod.remove(DateHelper.truncate(time));
final BrokeringQuery query = new BrokeringQuery();
query.setResultType(ResultType.ITERATOR);
query.setStatus(BrokeringQuery.Status.ACTIVE);
query.setStartExpirationDate(startDate);
CacheCleaner cleaner = new CacheCleaner(fetchService);
final List<Brokering> expired = search(query);
try {
for (final Brokering brokering : expired) {
// Update the brokering, expiring it
brokering.setEndDate(time);
brokeringDao.update(brokering);
memberNotificationHandler.expiredBrokeringNotification(brokering);
cleaner.clearCache();
}
} finally {
DataIteratorHelper.close(expired);
}
}
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:28,代码来源:BrokeringServiceImpl.java示例8: alertExpiredSystemInvoices
import nl.strohalm.cyclos.utils.TimePeriod; //导入方法依赖的package包/类
@Override
public int alertExpiredSystemInvoices(final Calendar time) {
final AlertSettings alertSettings = settingsService.getAlertSettings();
final TimePeriod tp = alertSettings.getIdleInvoiceExpiration();
// don't do anything if expiration period is set to 0
if (tp == null || tp.getNumber() <= 0) {
return 0;
}
// Get the limit date for open invoices
final Calendar limit = tp.remove(DateHelper.truncate(time));
int processed = 0;
// List the expired invoices
final InvoiceQuery query = new InvoiceQuery();
query.fetch(RelationshipHelper.nested(Invoice.Relationships.DESTINATION_ACCOUNT_TYPE, AccountType.Relationships.CURRENCY), Invoice.Relationships.TO_MEMBER);
query.setOwner(SystemAccountOwner.instance());
query.setDirection(Direction.OUTGOING);
query.setPeriod(Period.endingAt(limit));
query.setStatus(Invoice.Status.OPEN);
query.setResultType(ResultType.ITERATOR);
final List<Invoice> invoices = search(query);
if (!invoices.isEmpty()) {
final LocalSettings localSettings = settingsService.getLocalSettings();
final NumberConverter<BigDecimal> numberConverter = localSettings.getNumberConverter();
final CalendarConverter dateTimeConverter = localSettings.getDateTimeConverter();
for (final Invoice invoice : invoices) {
// Create the alert
String amount;
if (invoice.getDestinationAccountType() != null) {
amount = localSettings.getUnitsConverter(invoice.getDestinationAccountType().getCurrency().getPattern()).toString(invoice.getAmount());
} else {
amount = numberConverter.toString(invoice.getAmount());
}
final String date = dateTimeConverter.toString(invoice.getDate());
alertService.create(invoice.getToMember(), MemberAlert.Alerts.INVOICE_IDLE_TIME_EXCEEDED, amount, date);
invoice.setStatus(Invoice.Status.EXPIRED);
invoiceDao.update(invoice);
processed++;
}
}
return processed;
}
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:44,代码来源:InvoiceServiceImpl.java本文标签属性:
示例:示例志愿表
代码:代码转换器
java:javascript18岁
TimePeriod:timeperiod什么意思
remove:removed