Example usage for com.liferay.portal.kernel.util Time MONTH

List of usage examples for com.liferay.portal.kernel.util Time MONTH

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util Time MONTH.

Prototype

long MONTH

To view the source code for com.liferay.portal.kernel.util Time MONTH.

Click Source Link

Usage

From source file:com.liferay.calendar.service.impl.CalendarBookingLocalServiceImpl.java

License:Open Source License

@Override
public void checkCalendarBookings() throws PortalException {
    Date now = new Date();

    List<CalendarBooking> calendarBookings = calendarBookingFinder.findByFutureReminders(now.getTime());

    long endTime = now.getTime() + Time.MONTH;

    calendarBookings = RecurrenceUtil.expandCalendarBookings(calendarBookings, now.getTime(), endTime, 1);

    for (CalendarBooking calendarBooking : calendarBookings) {
        try {//  w  w w .  j av a 2  s. c  om
            Company company = companyPersistence.findByPrimaryKey(calendarBooking.getCompanyId());

            if (company.isActive()) {
                NotificationUtil.notifyCalendarBookingReminders(calendarBooking, now.getTime());
            }
        } catch (PortalException pe) {
            throw pe;
        } catch (SystemException se) {
            throw se;
        } catch (Exception e) {
            throw new SystemException(e);
        }
    }
}