001/*
002 * The MIT License
003 * Copyright (c) 2012 Microsoft Corporation
004 *
005 * Permission is hereby granted, free of charge, to any person obtaining a copy
006 * of this software and associated documentation files (the "Software"), to deal
007 * in the Software without restriction, including without limitation the rights
008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
009 * copies of the Software, and to permit persons to whom the Software is
010 * furnished to do so, subject to the following conditions:
011 *
012 * The above copyright notice and this permission notice shall be included in
013 * all copies or substantial portions of the Software.
014 *
015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
021 * THE SOFTWARE.
022 */
023
024package microsoft.exchange.webservices.data.core.service.item;
025
026import microsoft.exchange.webservices.data.attribute.ServiceObjectDefinition;
027import microsoft.exchange.webservices.data.core.ExchangeService;
028import microsoft.exchange.webservices.data.core.PropertySet;
029import microsoft.exchange.webservices.data.core.XmlElementNames;
030import microsoft.exchange.webservices.data.core.service.response.AcceptMeetingInvitationMessage;
031import microsoft.exchange.webservices.data.core.service.response.DeclineMeetingInvitationMessage;
032import microsoft.exchange.webservices.data.core.service.schema.AppointmentSchema;
033import microsoft.exchange.webservices.data.core.service.schema.MeetingRequestSchema;
034import microsoft.exchange.webservices.data.core.service.schema.ServiceObjectSchema;
035import microsoft.exchange.webservices.data.core.enumeration.service.calendar.AppointmentType;
036import microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion;
037import microsoft.exchange.webservices.data.core.enumeration.property.LegacyFreeBusyStatus;
038import microsoft.exchange.webservices.data.core.enumeration.service.MeetingRequestType;
039import microsoft.exchange.webservices.data.core.enumeration.property.MeetingResponseType;
040import microsoft.exchange.webservices.data.core.exception.service.local.ServiceLocalException;
041import microsoft.exchange.webservices.data.misc.CalendarActionResults;
042import microsoft.exchange.webservices.data.misc.TimeSpan;
043import microsoft.exchange.webservices.data.property.complex.AttendeeCollection;
044import microsoft.exchange.webservices.data.property.complex.DeletedOccurrenceInfoCollection;
045import microsoft.exchange.webservices.data.property.complex.EmailAddress;
046import microsoft.exchange.webservices.data.property.complex.ItemAttachment;
047import microsoft.exchange.webservices.data.property.complex.ItemCollection;
048import microsoft.exchange.webservices.data.property.complex.ItemId;
049import microsoft.exchange.webservices.data.property.complex.OccurrenceInfo;
050import microsoft.exchange.webservices.data.property.complex.OccurrenceInfoCollection;
051import microsoft.exchange.webservices.data.property.complex.recurrence.pattern.Recurrence;
052import microsoft.exchange.webservices.data.property.complex.time.TimeZoneDefinition;
053import org.apache.commons.logging.Log;
054import org.apache.commons.logging.LogFactory;
055
056import java.util.Date;
057
058/**
059 * Represents a meeting request that an attendee can accept
060 * or decline. Properties available on meeting
061 * request are defined in the MeetingRequestSchema class.
062 */
063@ServiceObjectDefinition(xmlElementName = XmlElementNames.MeetingRequest)
064public class MeetingRequest extends MeetingMessage implements ICalendarActionProvider {
065
066  private static final Log LOG = LogFactory.getLog(MeetingRequest.class);
067
068  /**
069   * Initializes a new instance of the class.
070   *
071   * @param parentAttachment The parent attachment
072   * @throws Exception throws Exception
073   */
074  public MeetingRequest(ItemAttachment parentAttachment) throws Exception {
075    super(parentAttachment);
076  }
077
078  /**
079   * Initializes a new instance of the class.
080   *
081   * @param service EWS service to which this object belongs.
082   * @throws Exception throws Exception
083   */
084  public MeetingRequest(ExchangeService service) throws Exception {
085    super(service);
086  }
087
088  /**
089   * Binds to an existing meeting response and loads the specified set of
090   * property. Calling this method results in a call to EWS.
091   *
092   * @param service     The service to use to bind to the meeting request.
093   * @param id          The Id of the meeting request to bind to.
094   * @param propertySet The set of property to load.
095   * @return A MeetingResponse instance representing the meeting request
096   * corresponding to the specified Id.
097   */
098  public static MeetingRequest bind(ExchangeService service, ItemId id,
099      PropertySet propertySet) {
100    try {
101      return service.bindToItem(MeetingRequest.class, id, propertySet);
102    } catch (Exception e) {
103      LOG.error(e);
104      return null;
105    }
106  }
107
108  /**
109   * Binds to an existing meeting response and loads the specified set of
110   * property. Calling this method results in a call to EWS.
111   *
112   * @param service The service to use to bind to the meeting request.
113   * @param id      The Id of the meeting request to bind to.
114   * @return A MeetingResponse instance representing the meeting request
115   * corresponding to the specified Id.
116   */
117  public static MeetingRequest bind(ExchangeService service, ItemId id) {
118    return MeetingRequest.bind(service, id, PropertySet
119        .getFirstClassProperties());
120  }
121
122  /**
123   * Internal method to return the schema associated with this type of object.
124   *
125   * @return The schema associated with this type of object.
126   */
127  @Override public ServiceObjectSchema getSchema() {
128    return MeetingRequestSchema.Instance;
129  }
130
131  /**
132   * Gets the minimum required server version.
133   *
134   * @return Earliest Exchange version in which this service object type is
135   * supported.
136   */
137  @Override public ExchangeVersion getMinimumRequiredServerVersion() {
138    return ExchangeVersion.Exchange2007_SP1;
139  }
140
141  /**
142   * Creates a local meeting acceptance message that can be customized and
143   * sent.
144   *
145   * @param tentative Specifies whether the meeting will be tentatively accepted.
146   * @return An AcceptMeetingInvitationMessage representing the meeting
147   * acceptance message.
148   */
149  public AcceptMeetingInvitationMessage createAcceptMessage(boolean
150      tentative) {
151    try {
152      return new AcceptMeetingInvitationMessage(this, tentative);
153    } catch (Exception e) {
154      LOG.error(e);
155      return null;
156    }
157  }
158
159  /**
160   * Creates a local meeting declination message that can be customized and
161   * sent.
162   *
163   * @return A DeclineMeetingInvitation representing the meeting declination
164   * message.
165   */
166  public DeclineMeetingInvitationMessage createDeclineMessage() {
167    try {
168      return new DeclineMeetingInvitationMessage(this);
169    } catch (Exception e) {
170      LOG.error(e);
171      return null;
172    }
173  }
174
175  /**
176   * Accepts the meeting. Calling this method results in a call to EWS.
177   *
178   * @param sendResponse Indicates whether to send a response to the organizer.
179   * @return A CalendarActionResults object containing the various item that
180   * were created or modified as a results of this operation.
181   * @throws Exception throws Exception
182   */
183  public CalendarActionResults accept(boolean sendResponse) throws Exception {
184    return this.internalAccept(false, sendResponse);
185  }
186
187  /**
188   * Tentatively accepts the meeting. Calling this method results in a call to
189   * EWS.
190   *
191   * @param sendResponse Indicates whether to send a response to the organizer.
192   * @return A CalendarActionResults object containing the various item that
193   * were created or modified as a results of this operation.
194   * @throws Exception throws Exception
195   */
196  public CalendarActionResults acceptTentatively(boolean sendResponse)
197      throws Exception {
198    return this.internalAccept(true, sendResponse);
199  }
200
201  /**
202   * Accepts the meeting.
203   *
204   * @param tentative    True if tentative accept.
205   * @param sendResponse Indicates whether to send a response to the organizer.
206   * @return A CalendarActionResults object containing the various item that
207   * were created or modified as a results of this operation.
208   * @throws Exception throws Exception
209   */
210  protected CalendarActionResults internalAccept(boolean tentative,
211      boolean sendResponse) throws Exception {
212    AcceptMeetingInvitationMessage accept = this
213        .createAcceptMessage(tentative);
214
215    if (sendResponse) {
216      return accept.calendarSendAndSaveCopy();
217    } else {
218      return accept.calendarSave();
219
220    }
221  }
222
223  /**
224   * Declines the meeting invitation. Calling this method results in a call to
225   * EWS.
226   *
227   * @param sendResponse Indicates whether to send a response to the organizer.
228   * @return A CalendarActionResults object containing the various item that
229   * were created or modified as a results of this operation.
230   * @throws Exception throws Exception
231   */
232  public CalendarActionResults decline(boolean sendResponse)
233      throws Exception {
234    DeclineMeetingInvitationMessage decline = this.createDeclineMessage();
235
236    if (sendResponse) {
237      return decline.calendarSendAndSaveCopy();
238    } else {
239      return decline.calendarSave();
240    }
241  }
242
243  /**
244   * Gets the type of this meeting request.
245   *
246   * @return the meeting request type
247   * @throws ServiceLocalException the service local exception
248   */
249  public MeetingRequestType getMeetingRequestType()
250      throws ServiceLocalException {
251    return getPropertyBag().getObjectFromPropertyDefinition(
252        MeetingRequestSchema.MeetingRequestType);
253  }
254
255  /**
256   * Gets the a value representing the intended free/busy status of the
257   * meeting.
258   *
259   * @return the intended free busy status
260   * @throws ServiceLocalException the service local exception
261   */
262  public LegacyFreeBusyStatus getIntendedFreeBusyStatus()
263      throws ServiceLocalException {
264    return getPropertyBag().getObjectFromPropertyDefinition(
265        MeetingRequestSchema.IntendedFreeBusyStatus);
266  }
267
268  /**
269   * Gets the start time of the appointment.
270   *
271   * @return the start
272   * @throws ServiceLocalException the service local exception
273   */
274  public Date getStart() throws ServiceLocalException {
275    return getPropertyBag().getObjectFromPropertyDefinition(
276        MeetingRequestSchema.Start);
277  }
278
279  /**
280   * Gets the end time of the appointment.
281   *
282   * @return the end
283   * @throws ServiceLocalException the service local exception
284   */
285  public Date getEnd() throws ServiceLocalException {
286    return getPropertyBag().getObjectFromPropertyDefinition(
287        MeetingRequestSchema.End);
288  }
289
290  /**
291   * Sets the start.
292   *
293   * @param value the new start
294   * @throws Exception the exception
295   */
296  public void setStart(Date value) throws Exception {
297    this.getPropertyBag().setObjectFromPropertyDefinition(
298        MeetingRequestSchema.Start, value);
299  }
300
301  /**
302   * Sets the end.
303   *
304   * @param value the new end
305   * @throws Exception the exception
306   */
307  public void setEnd(Date value) throws Exception {
308    this.getPropertyBag().setObjectFromPropertyDefinition(
309        MeetingRequestSchema.End, value);
310  }
311
312  
313  /**
314   * Gets the original start time of the appointment.
315   *
316   * @return the original start
317   * @throws ServiceLocalException the service local exception
318   */
319  public Date getOriginalStart() throws ServiceLocalException {
320    return getPropertyBag().getObjectFromPropertyDefinition(
321        AppointmentSchema.OriginalStart);
322  }
323
324  /**
325   * Gets a value indicating whether this appointment is an all day event.
326   *
327   * @return the checks if is all day event
328   * @throws ServiceLocalException the service local exception
329   */
330  public boolean getIsAllDayEvent() throws ServiceLocalException {
331    return getPropertyBag().getObjectFromPropertyDefinition(
332        MeetingRequestSchema.IsAllDayEvent) != null;
333  }
334
335  /**
336   * Sets the checks if is all day event.
337   *
338   * @param value the new checks if is all day event
339   * @throws Exception the exception
340   */
341  public void setIsAllDayEvent(Boolean value) throws Exception {
342    this.getPropertyBag().setObjectFromPropertyDefinition(
343        MeetingRequestSchema.IsAllDayEvent, value);
344  }
345
346  /**
347   * Gets a value indicating the free/busy status of the owner of this
348   * appointment.
349   *
350   * @return the legacy free busy status
351   * @throws ServiceLocalException the service local exception
352   */
353  public LegacyFreeBusyStatus legacyFreeBusyStatus()
354      throws ServiceLocalException {
355    return getPropertyBag().getObjectFromPropertyDefinition(
356        AppointmentSchema.LegacyFreeBusyStatus);
357  }
358
359  /**
360   * Gets  the location of this appointment.
361   *
362   * @return the location
363   * @throws ServiceLocalException the service local exception
364   */
365  public String getLocation() throws ServiceLocalException {
366    return getPropertyBag().getObjectFromPropertyDefinition(
367        MeetingRequestSchema.Location);
368  }
369
370  /**
371   * Sets the location.
372   *
373   * @param value the new location
374   * @throws Exception the exception
375   */
376  public void setLocation(String value) throws Exception {
377    this.getPropertyBag().setObjectFromPropertyDefinition(
378        MeetingRequestSchema.Location, value);
379  }
380
381  /**
382   * Gets a text indicating when this appointment occurs. The text returned by
383   * When is localized using the Exchange Server culture or using the culture
384   * specified in the PreferredCulture property of the ExchangeService object
385   * this appointment is bound to.
386   *
387   * @return the when
388   * @throws ServiceLocalException the service local exception
389   */
390  public String getWhen() throws ServiceLocalException {
391    return getPropertyBag().getObjectFromPropertyDefinition(
392        AppointmentSchema.When);
393  }
394
395  /**
396   * Gets a value indicating whether the appointment is a meeting.
397   *
398   * @return the checks if is meeting
399   * @throws ServiceLocalException the service local exception
400   */
401  public boolean getIsMeeting() throws ServiceLocalException {
402    return getPropertyBag().getObjectFromPropertyDefinition(
403        AppointmentSchema.IsMeeting) != null;
404  }
405
406  /**
407   * Gets a value indicating whether the appointment has been cancelled.
408   *
409   * @return the checks if is cancelled
410   * @throws ServiceLocalException the service local exception
411   */
412  public boolean getIsCancelled() throws ServiceLocalException {
413    return getPropertyBag().getObjectFromPropertyDefinition(
414        AppointmentSchema.IsCancelled) != null;
415  }
416
417  /**
418   * Gets a value indicating whether the appointment is recurring.
419   *
420   * @return the checks if is recurring
421   * @throws ServiceLocalException the service local exception
422   */
423  public boolean getIsRecurring() throws ServiceLocalException {
424    return getPropertyBag().getObjectFromPropertyDefinition(
425        AppointmentSchema.IsRecurring) != null;
426  }
427
428  /**
429   * Gets a value indicating whether the meeting request has already been
430   * sent.
431   *
432   * @return the meeting request was sent
433   * @throws ServiceLocalException the service local exception
434   */
435  public boolean getMeetingRequestWasSent() throws ServiceLocalException {
436    return getPropertyBag().getObjectFromPropertyDefinition(
437        AppointmentSchema.MeetingRequestWasSent) != null;
438  }
439
440  /**
441   * Gets a value indicating the type of this appointment.
442   *
443   * @return the appointment type
444   * @throws ServiceLocalException the service local exception
445   */
446  public AppointmentType getAppointmentType() throws ServiceLocalException {
447    return getPropertyBag().getObjectFromPropertyDefinition(
448        AppointmentSchema.AppointmentType);
449  }
450
451  /**
452   * Gets a value indicating what was the last response of the user that
453   * loaded this meeting.
454   *
455   * @return the my response type
456   * @throws ServiceLocalException the service local exception
457   */
458  public MeetingResponseType getMyResponseType()
459      throws ServiceLocalException {
460    return getPropertyBag().getObjectFromPropertyDefinition(
461        AppointmentSchema.MyResponseType);
462  }
463
464  /**
465   * Gets the organizer of this meeting.
466   *
467   * @return the organizer
468   * @throws ServiceLocalException the service local exception
469   */
470  public EmailAddress getOrganizer() throws ServiceLocalException {
471    return getPropertyBag().getObjectFromPropertyDefinition(
472        AppointmentSchema.Organizer);
473  }
474
475  /**
476   * Gets a list of required attendees for this meeting.
477   *
478   * @return the required attendees
479   * @throws ServiceLocalException the service local exception
480   */
481  public AttendeeCollection getRequiredAttendees()
482      throws ServiceLocalException {
483    return getPropertyBag().getObjectFromPropertyDefinition(
484        AppointmentSchema.RequiredAttendees);
485  }
486
487  /**
488   * Gets a list of optional attendeed for this meeting.
489   *
490   * @return the optional attendees
491   * @throws ServiceLocalException the service local exception
492   */
493  public AttendeeCollection getOptionalAttendees()
494      throws ServiceLocalException {
495    return getPropertyBag().getObjectFromPropertyDefinition(
496        AppointmentSchema.OptionalAttendees);
497  }
498
499  /**
500   * Gets a list of resources for this meeting.
501   *
502   * @return the resources
503   * @throws ServiceLocalException the service local exception
504   */
505  public AttendeeCollection getResources() throws ServiceLocalException {
506    return getPropertyBag().getObjectFromPropertyDefinition(
507        AppointmentSchema.Resources);
508  }
509
510  /**
511   * Gets the number of calendar entries that conflict with
512   * this appointment in the authenticated user's calendar.
513   *
514   * @return the conflicting meeting count
515   * @throws NumberFormatException the number format exception
516   * @throws ServiceLocalException the service local exception
517   */
518  public int getConflictingMeetingCount() throws NumberFormatException,
519      ServiceLocalException {
520    return (Integer.parseInt(this.getPropertyBag()
521        .getObjectFromPropertyDefinition(
522            AppointmentSchema.ConflictingMeetingCount).toString()));
523  }
524
525  /**
526   * Gets the number of calendar entries that are adjacent to
527   * this appointment in the authenticated user's calendar.
528   *
529   * @return the adjacent meeting count
530   * @throws NumberFormatException the number format exception
531   * @throws ServiceLocalException the service local exception
532   */
533  public int getAdjacentMeetingCount() throws NumberFormatException,
534      ServiceLocalException {
535    return (Integer.parseInt(this.getPropertyBag()
536        .getObjectFromPropertyDefinition(
537            AppointmentSchema.AdjacentMeetingCount).toString()));
538  }
539
540  /**
541   * Gets a list of meetings that conflict with
542   * this appointment in the authenticated user's calendar.
543   *
544   * @return the conflicting meetings
545   * @throws ServiceLocalException the service local exception
546   */
547  public ItemCollection<Appointment> getConflictingMeetings()
548      throws ServiceLocalException {
549    return getPropertyBag().getObjectFromPropertyDefinition(
550        AppointmentSchema.ConflictingMeetings);
551  }
552
553  /**
554   * Gets a list of meetings that are adjacent with this
555   * appointment in the authenticated user's calendar.
556   *
557   * @return the adjacent meetings
558   * @throws ServiceLocalException the service local exception
559   */
560  public ItemCollection<Appointment> getAdjacentMeetings()
561      throws ServiceLocalException {
562    return getPropertyBag().getObjectFromPropertyDefinition(
563        AppointmentSchema.AdjacentMeetings);
564  }
565
566  /**
567   * Gets the duration of this appointment.
568   *
569   * @return the duration
570   * @throws ServiceLocalException the service local exception
571   */
572  public TimeSpan getDuration() throws ServiceLocalException {
573    return getPropertyBag().getObjectFromPropertyDefinition(
574        AppointmentSchema.Duration);
575  }
576
577  /**
578   * Gets the name of the time zone this appointment is defined in.
579   *
580   * @return the time zone
581   * @throws ServiceLocalException the service local exception
582   */
583  public String getTimeZone() throws ServiceLocalException {
584    return getPropertyBag().getObjectFromPropertyDefinition(
585        AppointmentSchema.TimeZone);
586  }
587
588  /**
589   * Gets the time when the attendee replied to the meeting request.
590   *
591   * @return the appointment reply time
592   * @throws ServiceLocalException the service local exception
593   */
594  public Date getAppointmentReplyTime() throws ServiceLocalException {
595    return getPropertyBag().getObjectFromPropertyDefinition(
596        AppointmentSchema.AppointmentReplyTime);
597  }
598
599  /**
600   * Gets the sequence number of this appointment.
601   *
602   * @return the appointment sequence number
603   * @throws NumberFormatException the number format exception
604   * @throws ServiceLocalException the service local exception
605   */
606  public int getAppointmentSequenceNumber() throws NumberFormatException,
607      ServiceLocalException {
608    return (Integer
609        .parseInt(this.getPropertyBag()
610            .getObjectFromPropertyDefinition(
611                AppointmentSchema.AppointmentSequenceNumber)
612            .toString()));
613  }
614
615  /**
616   * Gets the state of this appointment.
617   *
618   * @return the appointment state
619   * @throws NumberFormatException the number format exception
620   * @throws ServiceLocalException the service local exception
621   */
622  public int getAppointmentState() throws NumberFormatException,
623      ServiceLocalException {
624    return (Integer.parseInt(this.getPropertyBag()
625        .getObjectFromPropertyDefinition(
626            AppointmentSchema.AppointmentState).toString()));
627  }
628
629  /**
630   * Gets the recurrence pattern for this meeting request.
631   *
632   * @return the recurrence
633   * @throws ServiceLocalException the service local exception
634   */
635  public Recurrence getRecurrence() throws ServiceLocalException {
636    return getPropertyBag().getObjectFromPropertyDefinition(
637        AppointmentSchema.Recurrence);
638  }
639
640  /**
641   * Gets an OccurrenceInfo identifying the first occurrence of this meeting.
642   *
643   * @return the first occurrence
644   * @throws ServiceLocalException the service local exception
645   */
646  public OccurrenceInfo getFirstOccurrence() throws ServiceLocalException {
647    return getPropertyBag().getObjectFromPropertyDefinition(
648        AppointmentSchema.FirstOccurrence);
649  }
650
651  /**
652   * Gets an OccurrenceInfo identifying the last occurrence of this meeting.
653   *
654   * @return the last occurrence
655   * @throws ServiceLocalException the service local exception
656   */
657  public OccurrenceInfo getLastOccurrence() throws ServiceLocalException {
658    return getPropertyBag().getObjectFromPropertyDefinition(
659        AppointmentSchema.FirstOccurrence);
660  }
661
662  /**
663   * Gets a list of modified occurrences for this meeting.
664   *
665   * @return the modified occurrences
666   * @throws ServiceLocalException the service local exception
667   */
668  public OccurrenceInfoCollection getModifiedOccurrences()
669      throws ServiceLocalException {
670    return getPropertyBag().getObjectFromPropertyDefinition(
671        AppointmentSchema.ModifiedOccurrences);
672  }
673
674  /**
675   * Gets a list of deleted occurrences for this meeting.
676   *
677   * @return the deleted occurrences
678   * @throws ServiceLocalException the service local exception
679   */
680  public DeletedOccurrenceInfoCollection getDeletedOccurrences()
681      throws ServiceLocalException {
682    return getPropertyBag().getObjectFromPropertyDefinition(
683        AppointmentSchema.DeletedOccurrences);
684  }
685
686  /**
687   * Gets  time zone of the start property of this meeting request.
688   *
689   * @return the start time zone
690   * @throws ServiceLocalException the service local exception
691   */
692  public TimeZoneDefinition getStartTimeZone() throws ServiceLocalException {
693    return getPropertyBag().getObjectFromPropertyDefinition(
694        MeetingRequestSchema.StartTimeZone);
695  }
696
697  /**
698   * Gets  time zone of the end property of this meeting request.
699   *
700   * @return the end time zone
701   * @throws ServiceLocalException the service local exception
702   */
703  public TimeZoneDefinition getEndTimeZone() throws ServiceLocalException {
704    return getPropertyBag().getObjectFromPropertyDefinition(
705        MeetingRequestSchema.EndTimeZone);
706  }
707  /**
708   * Sets the start time zone.
709   *
710   * @param value the new start time zone
711   * @throws Exception the exception
712   */
713  public void setStartTimeZone(TimeZoneDefinition value) throws Exception {
714    this.getPropertyBag().setObjectFromPropertyDefinition(
715        MeetingRequestSchema.StartTimeZone, value);
716
717  }
718
719  /**
720   * Sets the start time zone.
721   *
722   * @param value the new end time zone
723   * @throws Exception the exception
724   */
725  public void setEndTimeZone(TimeZoneDefinition value) throws Exception {
726    this.getPropertyBag().setObjectFromPropertyDefinition(
727        MeetingRequestSchema.EndTimeZone, value);
728
729  }
730
731  /**
732   * Gets the type of conferencing that will be used during the meeting.
733   *
734   * @return the conference type
735   * @throws NumberFormatException the number format exception
736   * @throws ServiceLocalException the service local exception
737   */
738  public int getConferenceType() throws NumberFormatException,
739      ServiceLocalException {
740    return (Integer.parseInt(this.getPropertyBag()
741        .getObjectFromPropertyDefinition(
742            AppointmentSchema.ConferenceType).toString()));
743  }
744
745  /**
746   * Gets a value indicating whether new time
747   * proposals are allowed for attendees of this meeting.
748   *
749   * @return the allow new time proposal
750   * @throws ServiceLocalException the service local exception
751   */
752  public boolean getAllowNewTimeProposal() throws ServiceLocalException {
753    return getPropertyBag().<Boolean>getObjectFromPropertyDefinition(
754        AppointmentSchema.AllowNewTimeProposal);
755  }
756
757  /**
758   * Gets a value indicating whether this is an online meeting.
759   *
760   * @return the checks if is online meeting
761   * @throws ServiceLocalException the service local exception
762   */
763  public boolean getIsOnlineMeeting() throws ServiceLocalException {
764    return getPropertyBag().<Boolean>getObjectFromPropertyDefinition(
765        AppointmentSchema.IsOnlineMeeting);
766  }
767
768  /**
769   * Gets the URL of the meeting workspace. A meeting
770   * workspace is a shared Web site for
771   * planning meetings and tracking results.
772   *
773   * @return the meeting workspace url
774   * @throws ServiceLocalException the service local exception
775   */
776  public String getMeetingWorkspaceUrl() throws ServiceLocalException {
777    return getPropertyBag().getObjectFromPropertyDefinition(
778        AppointmentSchema.MeetingWorkspaceUrl);
779  }
780
781  /**
782   * Gets the URL of the Microsoft NetShow online meeting.
783   *
784   * @return the net show url
785   * @throws ServiceLocalException the service local exception
786   */
787  public String getNetShowUrl() throws ServiceLocalException {
788    return getPropertyBag().getObjectFromPropertyDefinition(
789        AppointmentSchema.NetShowUrl);
790  }
791}