microsoft.exchange.webservices.data.core.request
Class SubscribeToPushNotificationsRequest

java.lang.Object
  extended by microsoft.exchange.webservices.data.core.request.ServiceRequestBase<T>
      extended by microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase<ServiceResponseCollection<TResponse>>
          extended by microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest<SubscribeResponse<TSubscription>>
              extended by microsoft.exchange.webservices.data.core.request.SubscribeToPushNotificationsRequest

public class SubscribeToPushNotificationsRequest
extends MultiResponseServiceRequest<SubscribeResponse<TSubscription>>

The Class SubscribeToPushNotificationsRequest.


Constructor Summary
SubscribeToPushNotificationsRequest(ExchangeService service)
          Instantiates a new subscribe to push notification request.
 
Method Summary
protected  HttpWebRequest buildEwsHttpWebRequest()
          Builds the HttpWebRequest object for current service request with exception handling.
protected  SubscribeResponse<PushSubscription> createServiceResponse(ExchangeService service, int responseIndex)
          Creates the service response.
 List<EventType> getEventTypes()
          Gets the event types.
protected  int getExpectedResponseMessageCount()
          Gets the expected response message count.
 FolderIdWrapperList getFolderIds()
          Gets the folder ids.
 int getFrequency()
          Gets the frequency.
protected  ExchangeVersion getMinimumRequiredServerVersion()
          Gets the minimum server version required to process this request.
protected  String getResponseMessageXmlElementName()
          Gets the name of the response message XML element.
protected  String getResponseXmlElementName()
          Gets the name of the response XML element.
protected  String getSubscriptionXmlElementName()
          Gets the name of the subscription XML element.
 URI getUrl()
          Gets the url.
 String getWatermark()
          Gets the watermark.
 String getXmlElementName()
          Gets the name of the XML element.
protected  void internalWriteElementsToXml(EwsServiceXmlWriter writer)
          Internal method to write XML elements.
 void setFrequency(int frequency)
          Sets the frequency.
 void setUrl(URI url)
          Sets the url.
 void setWatermark(String watermark)
          Sets the watermark.
protected  void validate()
          Validate request.
protected  void writeElementsToXml(EwsServiceXmlWriter writer)
          Writes XML elements.
 
Methods inherited from class microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest
endExecute, execute, getErrorHandlingMode, parseResponse
 
Methods inherited from class microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase
beginExecute, endInternalExecute, internalExecute
 
Methods inherited from class microsoft.exchange.webservices.data.core.request.ServiceRequestBase
buildEwsHttpPoolingWebRequest, getEwsHttpWebResponse, getResponseStream, getService, processWebException, readPreamble, readResponse, readResponse, readSoapFault, throwIfNotSupportedByRequestedServerVersion, traceResponse, validateAndEmitRequest, writeAttributesToXml, writeBodyToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscribeToPushNotificationsRequest

public SubscribeToPushNotificationsRequest(ExchangeService service)
                                    throws Exception
Instantiates a new subscribe to push notification request.

Parameters:
service - the service
Throws:
Exception
Method Detail

validate

protected void validate()
                 throws Exception
Validate request.

Throws:
Exception - the exception

getSubscriptionXmlElementName

protected String getSubscriptionXmlElementName()
Gets the name of the subscription XML element.

Returns:
XML element name

internalWriteElementsToXml

protected void internalWriteElementsToXml(EwsServiceXmlWriter writer)
                                   throws XMLStreamException,
                                          ServiceXmlSerializationException
Internal method to write XML elements.

Parameters:
writer - the writer
Throws:
XMLStreamException - the XML stream exception
ServiceXmlSerializationException - the service xml serialization exception

createServiceResponse

protected SubscribeResponse<PushSubscription> createServiceResponse(ExchangeService service,
                                                                    int responseIndex)
                                                             throws Exception
Description copied from class: MultiResponseServiceRequest
Creates the service response.

Specified by:
createServiceResponse in class MultiResponseServiceRequest<SubscribeResponse<PushSubscription>>
Parameters:
service - The service.
responseIndex - Index of the response.
Returns:
Service response.
Throws:
Exception - the exception

getMinimumRequiredServerVersion

protected ExchangeVersion getMinimumRequiredServerVersion()
Description copied from class: ServiceRequestBase
Gets the minimum server version required to process this request.

Specified by:
getMinimumRequiredServerVersion in class ServiceRequestBase<ServiceResponseCollection<SubscribeResponse<PushSubscription>>>
Returns:
Exchange server version.

getFrequency

public int getFrequency()
Gets the frequency.

Returns:
the frequency

setFrequency

public void setFrequency(int frequency)
Sets the frequency.

Parameters:
frequency - the new frequency

getUrl

public URI getUrl()
Gets the url.

Returns:
the url

setUrl

public void setUrl(URI url)
Sets the url.

Parameters:
url - the new url

getExpectedResponseMessageCount

protected int getExpectedResponseMessageCount()
Gets the expected response message count.

Specified by:
getExpectedResponseMessageCount in class MultiResponseServiceRequest<SubscribeResponse<TSubscription extends SubscriptionBase>>
Returns:
Number of expected response messages.

getXmlElementName

public String getXmlElementName()
Gets the name of the XML element.

Specified by:
getXmlElementName in class ServiceRequestBase<ServiceResponseCollection<SubscribeResponse<TSubscription extends SubscriptionBase>>>
Returns:
XML element name

getResponseXmlElementName

protected String getResponseXmlElementName()
Gets the name of the response XML element.

Specified by:
getResponseXmlElementName in class ServiceRequestBase<ServiceResponseCollection<SubscribeResponse<TSubscription extends SubscriptionBase>>>
Returns:
XML element name

getResponseMessageXmlElementName

protected String getResponseMessageXmlElementName()
Gets the name of the response message XML element.

Specified by:
getResponseMessageXmlElementName in class MultiResponseServiceRequest<SubscribeResponse<TSubscription extends SubscriptionBase>>
Returns:
XML element name

writeElementsToXml

protected void writeElementsToXml(EwsServiceXmlWriter writer)
                           throws Exception
Writes XML elements.

Specified by:
writeElementsToXml in class ServiceRequestBase<ServiceResponseCollection<SubscribeResponse<TSubscription extends SubscriptionBase>>>
Parameters:
writer - the writer
Throws:
Exception - the exception

getFolderIds

public FolderIdWrapperList getFolderIds()
Gets the folder ids.

Returns:
the folder ids

getEventTypes

public List<EventType> getEventTypes()
Gets the event types.

Returns:
the event types

getWatermark

public String getWatermark()
Gets the watermark.

Returns:
the watermark

setWatermark

public void setWatermark(String watermark)
Sets the watermark.

Parameters:
watermark - the new watermark

buildEwsHttpWebRequest

protected HttpWebRequest buildEwsHttpWebRequest()
                                         throws Exception
Description copied from class: ServiceRequestBase
Builds the HttpWebRequest object for current service request with exception handling.

Overrides:
buildEwsHttpWebRequest in class ServiceRequestBase<ServiceResponseCollection<SubscribeResponse<TSubscription extends SubscriptionBase>>>
Returns:
An HttpWebRequest instance
Throws:
Exception - on error


Copyright © 2012–2015 Microsoft. All rights reserved.