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.response;
025
026import microsoft.exchange.webservices.data.core.XmlElementNames;
027import microsoft.exchange.webservices.data.core.service.item.Item;
028import microsoft.exchange.webservices.data.core.service.item.MeetingResponse;
029import microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion;
030
031/**
032 * Represents a meeting acceptance message.
033 */
034public final class AcceptMeetingInvitationMessage extends
035    CalendarResponseMessage<MeetingResponse> {
036
037  /**
038   * The tentative.
039   */
040  private boolean tentative;
041
042  /**
043   * Initializes a new instance of the AcceptMeetingInvitationMessage class.
044   *
045   * @param referenceItem the reference item
046   * @param tentative     the tentative
047   * @throws Exception the exception
048   */
049  public AcceptMeetingInvitationMessage(Item referenceItem, boolean tentative) throws Exception {
050    super(referenceItem);
051    this.tentative = tentative;
052  }
053
054  /**
055   * This methods lets subclasses of ServiceObject override the default
056   * mechanism by which the XML element name associated with their type is
057   * retrieved.
058   *
059   * @return The XML element name associated with this type. If this method
060   * returns null or empty, the XML element name associated with this
061   * type is determined by the EwsObjectDefinition attribute that
062   * decorates the type, if present.
063   * <p>
064   * Item and folder classes that can be returned by EWS MUST rely on
065   * the EwsObjectDefinition attribute for XML element name determination.
066   * </p>
067   */
068  @Override public String getXmlElementName() {
069    // getXmlElementOverride is pvt and getXmlElementName returns
070    // getXmlElementOverride
071    if (this.tentative) {
072      return XmlElementNames.TentativelyAcceptItem;
073    } else {
074      return XmlElementNames.AcceptItem;
075    }
076  }
077
078  /**
079   * Gets the minimum required server version.
080   *
081   * @return Earliest Exchange version in which this service object type is
082   * supported.
083   */
084  @Override public ExchangeVersion getMinimumRequiredServerVersion() {
085    return ExchangeVersion.Exchange2007_SP1;
086  }
087
088  /**
089   * Gets the tentative.
090   *
091   * @return Gets a value indicating whether the associated meeting is
092   * tentatively accepted.
093   */
094  public boolean getTentative() {
095    return this.tentative;
096  }
097
098}