microsoft.exchange.webservices.data.core.request
Class MultiResponseServiceRequest<TResponse extends ServiceResponse>

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<TResponse>
Type Parameters:
TResponse - The type of the response.
Direct Known Subclasses:
ApplyConversationActionRequest, ConvertIdRequest, CopyFolderRequest, CreateAttachmentRequest, CreateFolderRequest, CreateItemRequest, CreateResponseObjectRequest, CreateUserConfigurationRequest, DeleteAttachmentRequest, DeleteFolderRequest, DeleteItemRequest, DeleteUserConfigurationRequest, EmptyFolderRequest, ExecuteDiagnosticMethodRequest, ExpandGroupRequest, FindFolderRequest, FindItemRequest, GetAttachmentRequest, GetEventsRequest, GetFolderRequest, GetFolderRequestForLoad, GetItemRequest, GetItemRequestForLoad, GetServerTimeZonesRequest, GetUserConfigurationRequest, MoveCopyItemRequest, MoveFolderRequest, ResolveNamesRequest, SendItemRequest, SubscribeToPullNotificationsRequest, SubscribeToPushNotificationsRequest, SubscribeToStreamingNotificationsRequest, SyncFolderHierarchyRequest, SyncFolderItemsRequest, UnsubscribeRequest, UpdateFolderRequest, UpdateItemRequest, UpdateUserConfigurationRequest

public abstract class MultiResponseServiceRequest<TResponse extends ServiceResponse>
extends SimpleServiceRequestBase<ServiceResponseCollection<TResponse>>

Represents a service request that can have multiple response.


Constructor Summary
protected MultiResponseServiceRequest(ExchangeService service, ServiceErrorHandling errorHandlingMode)
          Initializes a new instance.
 
Method Summary
protected abstract  TResponse createServiceResponse(ExchangeService service, int responseIndex)
          Creates the service response.
 ServiceResponseCollection<TResponse> endExecute(IAsyncResult asyncResult)
          Ends executing this async request.
 ServiceResponseCollection<TResponse> execute()
          Executes this request.
protected  ServiceErrorHandling getErrorHandlingMode()
          Gets a value indicating how errors should be handled.
protected abstract  int getExpectedResponseMessageCount()
          Gets the expected response message count.
protected abstract  String getResponseMessageXmlElementName()
          Gets the name of the response message XML element.
protected  ServiceResponseCollection<TResponse> parseResponse(EwsServiceXmlReader reader)
          Parses the response.
 
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, buildEwsHttpWebRequest, getEwsHttpWebResponse, getMinimumRequiredServerVersion, getResponseStream, getResponseXmlElementName, getService, getXmlElementName, processWebException, readPreamble, readResponse, readResponse, readSoapFault, throwIfNotSupportedByRequestedServerVersion, traceResponse, validate, validateAndEmitRequest, writeAttributesToXml, writeBodyToXml, writeElementsToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiResponseServiceRequest

protected MultiResponseServiceRequest(ExchangeService service,
                                      ServiceErrorHandling errorHandlingMode)
                               throws Exception
Initializes a new instance.

Parameters:
service - The service.
errorHandlingMode - Indicates how errors should be handled.
Throws:
Exception
Method Detail

parseResponse

protected ServiceResponseCollection<TResponse> parseResponse(EwsServiceXmlReader reader)
                                                                              throws Exception
Parses the response.

Specified by:
parseResponse in class ServiceRequestBase<ServiceResponseCollection<TResponse extends ServiceResponse>>
Parameters:
reader - The reader.
Returns:
the Response Object.
Throws:
Exception - the exception

createServiceResponse

protected abstract TResponse createServiceResponse(ExchangeService service,
                                                   int responseIndex)
                                                                    throws Exception
Creates the service response.

Parameters:
service - The service.
responseIndex - Index of the response.
Returns:
Service response.
Throws:
Exception - the exception

getResponseMessageXmlElementName

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

Returns:
XML element name

getExpectedResponseMessageCount

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

Returns:
Number of expected response messages.

execute

public ServiceResponseCollection<TResponse> execute()
                                                                     throws Exception
Executes this request.

Returns:
Service response collection.
Throws:
Exception - the exception

endExecute

public ServiceResponseCollection<TResponse> endExecute(IAsyncResult asyncResult)
                                                                        throws Exception
Ends executing this async request.

Parameters:
asyncResult - The async result
Returns:
Service response collection.
Throws:
Exception - on error

getErrorHandlingMode

protected ServiceErrorHandling getErrorHandlingMode()
Gets a value indicating how errors should be handled.

Returns:
A value indicating how errors should be handled.


Copyright © 2012–2015 Microsoft. All rights reserved.