com.moyosoft.exchange.calendar
Interface RecurrencePattern


public interface RecurrencePattern

Represents a recurrence pattern of a calendar item. Based on the type of recurrence, the following methods are used to configure the recurrence:

Example code:

Exchange exchange = new Exchange("hostname", "username", "password");
ExchangeCalendarItem appointment = exchange.createCalendarItem();
RecurrencePattern recurrencePattern = appointment.getRecurrencePattern();

// Recurs 4 times every 2 months:
recurrencePattern.setRecurrenceType(RecurrenceType.RecursMonthly);
recurrencePattern.setInterval(2);
recurrencePattern.setOccurrences(4);
appointment.save();


Method Summary
 int getDayOfMonth()
          Returns the month's day on which the appointment occurs.
 DayOfWeek getDayOfWeek()
          Returns the day of week when the appointment occurs.
 int getDayOfWeekIndex()
          Returns on which week in a month the appointment occurs.
 java.util.List<DayOfWeek> getDaysOfWeek()
          Returns the days of week when the appointment occurs.
 java.util.List<ExchangeOccurrence> getDeletedOccurrences()
          Returns a list of the deleted occurrences of the recurring appointment.
 ExchangeOccurrence getFirstOccurrence()
          Returns the first occurrence of the recurring appointment.
 int getInterval()
          Returns the interval between two occurrences in days, weeks or months depending on the type of recurrence.
 ExchangeOccurrence getLastOccurrence()
          Returns the last occurrence of the recurring appointment.
 java.util.List<ExchangeOccurrence> getModifiedOccurrences()
          Returns a list of the modified occurrences of the recurring appointment.
 int getMonthOfYear()
          Returns the month during which the appointment occurs.
 int getOccurrences()
          Returns the occurrences count of the recurring appointment indicating how many times the appointment recurs.
 ExchangeCalendarItem getParent()
          Returns the parent calendar item of this recurrence pattern.
 java.util.Date getPatternEndDate()
          Returns the end date until which the appointment recurs.
 java.util.Date getPatternStartDate()
          Returns the start date on which the appointment starts recurring.
 RecurrenceType getRecurrenceType()
          Returns the type of this recurrence pattern.
 boolean hasNoEndDate()
          Returns true if the appointment recurs indefinitely without an end date specified, false otherwise.
 boolean isEmpty()
          Returns true if no recurrence pattern is defined for the parent calendar item.
 void setDayOfMonth(int value)
          Sets the month's day on which the appointment occurs.
 void setDayOfWeek(DayOfWeek value)
          Sets the day of week when the appointment occurs.
 void setDayOfWeekIndex(int index)
          Sets the week in a month the appointment occurs on.
 void setDaysOfWeek(DayOfWeek... value)
          Sets the days of week when the appointment occurs.
 void setHasNoEndDate(boolean value)
          When set to true, the appointment will recur indefinitely.
 void setInterval(int value)
          Returns the interval between two occurrences of the recurring appointment.
 void setMonthOfYear(int value)
          Sets the month during which the appointment occurs.
 void setOccurrences(int value)
          Sets the occurrences count of the recurring appointment.
 void setPatternEndDate(java.util.Date value)
          Sets the end date until which the appointment recurs.
 void setPatternStartDate(java.util.Date value)
          Sets the start date when the appointment starts recurring.
 void setRecurrenceType(RecurrenceType value)
          Sets the type of this recurrence pattern.
 

Method Detail

isEmpty

boolean isEmpty()
                throws ExchangeServiceException
Returns true if no recurrence pattern is defined for the parent calendar item.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getDayOfMonth

int getDayOfMonth()
                  throws ExchangeServiceException
Returns the month's day on which the appointment occurs. Accepted values are in the range from 1 to 31.

Only applicable if the RecurrenceType is RecursMonthNth or RecursYearNth.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setDayOfMonth

void setDayOfMonth(int value)
                   throws ExchangeServiceException
Sets the month's day on which the appointment occurs. Accepted values are in the range from 1 to 31.

Only applicable if the RecurrenceType is RecursMonthNth or RecursYearNth. If other RecurrenceType is set, this method will throw an exception.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getDayOfWeek

DayOfWeek getDayOfWeek()
                       throws ExchangeServiceException
Returns the day of week when the appointment occurs.

Only applicable if the RecurrenceType is RecursWeekly, RecursMonthly or RecursYearly.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setDayOfWeek

void setDayOfWeek(DayOfWeek value)
                  throws ExchangeServiceException
Sets the day of week when the appointment occurs.

Only applicable if the RecurrenceType is RecursWeekly, RecursMonthly or RecursYearly. If other RecurrenceType is set, this method will throw an exception.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getDaysOfWeek

java.util.List<DayOfWeek> getDaysOfWeek()
                                        throws ExchangeServiceException
Returns the days of week when the appointment occurs.

Only applicable if the RecurrenceType is RecursWeekly.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setDaysOfWeek

void setDaysOfWeek(DayOfWeek... value)
                   throws ExchangeServiceException
Sets the days of week when the appointment occurs.

Only applicable if the RecurrenceType is RecursWeekly. If other RecurrenceType is set, this method will throw an exception.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getDayOfWeekIndex

int getDayOfWeekIndex()
                      throws ExchangeServiceException
Returns on which week in a month the appointment occurs. Possible values are -1 (last week), 1 (first week), 2 (second week), 3 (third week) and 4 (fourth week).

Only applicable if the RecurrenceType is RecursMonthly or RecursYearly.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setDayOfWeekIndex

void setDayOfWeekIndex(int index)
                       throws ExchangeServiceException
Sets the week in a month the appointment occurs on. Possible values are -1 (last week), 1 (first week), 2 (second week), 3 (third week) and 4 (fourth week).

Only applicable if the RecurrenceType is RecursMonthly or RecursYearly.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getFirstOccurrence

ExchangeOccurrence getFirstOccurrence()
                                      throws ExchangeServiceException
Returns the first occurrence of the recurring appointment.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getLastOccurrence

ExchangeOccurrence getLastOccurrence()
                                     throws ExchangeServiceException
Returns the last occurrence of the recurring appointment.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getModifiedOccurrences

java.util.List<ExchangeOccurrence> getModifiedOccurrences()
                                                          throws ExchangeServiceException
Returns a list of the modified occurrences of the recurring appointment.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getDeletedOccurrences

java.util.List<ExchangeOccurrence> getDeletedOccurrences()
                                                         throws ExchangeServiceException
Returns a list of the deleted occurrences of the recurring appointment.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getInterval

int getInterval()
                throws ExchangeServiceException
Returns the interval between two occurrences in days, weeks or months depending on the type of recurrence.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setInterval

void setInterval(int value)
                 throws ExchangeServiceException
Returns the interval between two occurrences of the recurring appointment.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getMonthOfYear

int getMonthOfYear()
                   throws ExchangeServiceException
Returns the month during which the appointment occurs. Accepted values are in the range from 1 to 12.

Only applicable if the RecurrenceType is RecursYearly or RecursYearNth.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setMonthOfYear

void setMonthOfYear(int value)
                    throws ExchangeServiceException
Sets the month during which the appointment occurs. Accepted values are in the range from 1 to 12.

Only applicable if the RecurrenceType is RecursYearly or RecursYearNth. If other RecurrenceType is set, this method will throw an exception.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

hasNoEndDate

boolean hasNoEndDate()
                     throws ExchangeServiceException
Returns true if the appointment recurs indefinitely without an end date specified, false otherwise.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setHasNoEndDate

void setHasNoEndDate(boolean value)
                     throws ExchangeServiceException
When set to true, the appointment will recur indefinitely.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getOccurrences

int getOccurrences()
                   throws ExchangeServiceException
Returns the occurrences count of the recurring appointment indicating how many times the appointment recurs.

Returns:
occurrences count or -1 if the appointment recurs indefinitely (hasNoEndDate) or is limited by an end date (getPatternEndDate)
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setOccurrences

void setOccurrences(int value)
                    throws ExchangeServiceException
Sets the occurrences count of the recurring appointment.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getPatternEndDate

java.util.Date getPatternEndDate()
                                 throws ExchangeServiceException
Returns the end date until which the appointment recurs.

Returns:
the end date or null if the appointment recurs indefinitely (hasNoEndDate) or is limited by an occurrences count (getOccurrences)
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setPatternEndDate

void setPatternEndDate(java.util.Date value)
                       throws ExchangeServiceException
Sets the end date until which the appointment recurs.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getPatternStartDate

java.util.Date getPatternStartDate()
                                   throws ExchangeServiceException
Returns the start date on which the appointment starts recurring.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setPatternStartDate

void setPatternStartDate(java.util.Date value)
                         throws ExchangeServiceException
Sets the start date when the appointment starts recurring.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getRecurrenceType

RecurrenceType getRecurrenceType()
                                 throws ExchangeServiceException
Returns the type of this recurrence pattern.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setRecurrenceType

void setRecurrenceType(RecurrenceType value)
                       throws ExchangeServiceException
Sets the type of this recurrence pattern.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getParent

ExchangeCalendarItem getParent()
                               throws ExchangeServiceException
Returns the parent calendar item of this recurrence pattern.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.