microsoft.exchange.webservices.data
Class CopyItemRequest

java.lang.Object
  extended by microsoft.exchange.webservices.data.MoveCopyItemRequest<MoveCopyItemResponse>
      extended by microsoft.exchange.webservices.data.CopyItemRequest

public class CopyItemRequest
extends MoveCopyItemRequest<MoveCopyItemResponse>

Represents a CopyItem request.


Constructor Summary
protected CopyItemRequest(ExchangeService service, microsoft.exchange.webservices.data.ServiceErrorHandling errorHandlingMode)
          * Initializes a new instance of the class.
 
Method Summary
protected  MoveCopyItemResponse createServiceResponse(ExchangeService service, int responseIndex)
          * Creates the service response.
protected  microsoft.exchange.webservices.data.HttpWebRequest emit(OutParam<microsoft.exchange.webservices.data.HttpWebRequest> request)
          * Send request and get response.
protected  ServiceResponseCollection<TResponse> execute()
          * Executes this request.
 FolderId getDestinationFolderId()
          Gets the destination folder id.
protected  microsoft.exchange.webservices.data.ServiceErrorHandling getErrorHandlingMode()
          Gets a value indicating how errors should be handled.
protected  ExchangeVersion getMinimumRequiredServerVersion()
          Gets the request version.
protected  String getResponseMessageXmlElementName()
          Gets the name of the response message XML element.
protected static InputStream getResponseStream(microsoft.exchange.webservices.data.HttpWebRequest request)
          * Gets the response stream (may be wrapped with GZip/Deflate stream to decompress content).
protected  String getResponseXmlElementName()
          Gets the name of the response XML element.
protected  ExchangeService getService()
          Gets the service.
protected  String getXmlElementName()
          Gets the name of the XML element.
protected  Object internalExecute()
          Execute this request.
protected  Object parseResponse(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          * Parses the response.
protected  void readPreamble(microsoft.exchange.webservices.data.EwsServiceXmlReader ewsXmlReader)
          * Reads any preamble data not part of the core response.
protected  Object readResponse(microsoft.exchange.webservices.data.EwsServiceXmlReader ewsXmlReader)
          * Reads the response.
protected  microsoft.exchange.webservices.data.SoapFaultDetails readSoapFault(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          Reads the SOAP fault.
 void setDestinationFolderId(FolderId destinationFolderId)
          Sets the destination folder id.
protected  void throwIfNotSupportedByRequestedServerVersion()
          * Throw exception if request is not supported in requested server version.
protected  void traceResponse(microsoft.exchange.webservices.data.HttpWebRequest request, ByteArrayOutputStream memoryStream)
          * Traces the response.
protected  microsoft.exchange.webservices.data.HttpWebRequest validateAndEmitRequest(OutParam<microsoft.exchange.webservices.data.HttpWebRequest> request)
          * Validates request parameters, and emits the request to the server.
protected  void writeAttributesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          * Writes XML attributes.
protected  void writeBodyToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          * Writes XML body.
protected  void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          Writes XML elements.
protected  void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          * Writes XML.
 
Methods inherited from class microsoft.exchange.webservices.data.MoveCopyItemRequest
getExpectedResponseMessageCount, getItemIds, getReturnNewItemIds, setReturnNewItemIds, validate, writeIdsToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyItemRequest

protected CopyItemRequest(ExchangeService service,
                          microsoft.exchange.webservices.data.ServiceErrorHandling errorHandlingMode)
                   throws Exception
* Initializes a new instance of the class.

Parameters:
service - the service
errorHandlingMode - the error handling mode
Throws:
Exception
Method Detail

createServiceResponse

protected MoveCopyItemResponse createServiceResponse(ExchangeService service,
                                                     int responseIndex)
* Creates the service response.

Parameters:
service - the service
responseIndex - the response index
Returns:
Service response.

getXmlElementName

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

Returns:
XML element name.

getResponseXmlElementName

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

Returns:
XML element name.

getResponseMessageXmlElementName

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

Returns:
XML element name.

getMinimumRequiredServerVersion

protected ExchangeVersion getMinimumRequiredServerVersion()
Gets the request version.

Returns:
Earliest Exchange version in which this request is supported.

writeElementsToXml

protected void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                           throws Exception
Writes XML elements.

Parameters:
writer - the writer
Throws:
Exception - the exception

getDestinationFolderId

public FolderId getDestinationFolderId()
Gets the destination folder id.

Returns:
the destination folder id

setDestinationFolderId

public void setDestinationFolderId(FolderId destinationFolderId)
Sets the destination folder id.

Parameters:
destinationFolderId - the new destination folder id

parseResponse

protected Object parseResponse(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
                        throws Exception
* Parses the response.

Parameters:
reader - The reader.
Returns:
Response object.
Throws:
Exception - the exception

execute

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

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

getErrorHandlingMode

protected microsoft.exchange.webservices.data.ServiceErrorHandling getErrorHandlingMode()
Gets a value indicating how errors should be handled.

Returns:
A value indicating how errors should be handled.

internalExecute

protected Object internalExecute()
                          throws ServiceLocalException,
                                 Exception
Execute this request.

Throws:
Exception
ServiceLocalException

writeBodyToXml

protected void writeBodyToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                       throws Exception
* Writes XML body.

Parameters:
writer - The writer.
Throws:
Exception - the exception

writeAttributesToXml

protected void writeAttributesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                             throws ServiceXmlSerializationException
* Writes XML attributes. Subclass will override if it has XML attributes.

Parameters:
writer - The writer.
Throws:
ServiceXmlSerializationException - the service xml serialization exception

getService

protected ExchangeService getService()
Gets the service.

Returns:
The service.

throwIfNotSupportedByRequestedServerVersion

protected void throwIfNotSupportedByRequestedServerVersion()
                                                    throws ServiceVersionException
* Throw exception if request is not supported in requested server version.

Throws:
ServiceVersionException - the service version exception

writeToXml

protected void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                   throws Exception
* Writes XML.

Parameters:
writer - The writer.
Throws:
Exception - the exception

emit

protected microsoft.exchange.webservices.data.HttpWebRequest emit(OutParam<microsoft.exchange.webservices.data.HttpWebRequest> request)
                                                           throws Exception
* Send request and get response.

Returns:
HttpWebRequest object from which response stream can be read.
Throws:
Exception - the exception

getResponseStream

protected static InputStream getResponseStream(microsoft.exchange.webservices.data.HttpWebRequest request)
                                        throws IOException,
                                               EWSHttpException
* Gets the response stream (may be wrapped with GZip/Deflate stream to decompress content).

Parameters:
request - HttpWebRequest object from which response stream can be read.
Returns:
ResponseStream
Throws:
IOException - Signals that an I/O exception has occurred.
EWSHttpException - the eWS http exception

traceResponse

protected void traceResponse(microsoft.exchange.webservices.data.HttpWebRequest request,
                             ByteArrayOutputStream memoryStream)
                      throws XMLStreamException,
                             IOException,
                             EWSHttpException
* Traces the response.

Parameters:
request - The response.
memoryStream - The response content in a MemoryStream.
Throws:
XMLStreamException - the xML stream exception
IOException - Signals that an I/O exception has occurred.
EWSHttpException - the eWS http exception

readResponse

protected Object readResponse(microsoft.exchange.webservices.data.EwsServiceXmlReader ewsXmlReader)
                       throws Exception
* Reads the response.

Parameters:
ewsXmlReader - The XML reader.
Returns:
Service response.
Throws:
Exception - the exception

readPreamble

protected void readPreamble(microsoft.exchange.webservices.data.EwsServiceXmlReader ewsXmlReader)
                     throws Exception
* Reads any preamble data not part of the core response.

Parameters:
ewsXmlReader - The EwsServiceXmlReader.
Throws:
Exception

readSoapFault

protected microsoft.exchange.webservices.data.SoapFaultDetails readSoapFault(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
Reads the SOAP fault.

Parameters:
reader - The reader.
Returns:
SOAP fault details.

validateAndEmitRequest

protected microsoft.exchange.webservices.data.HttpWebRequest validateAndEmitRequest(OutParam<microsoft.exchange.webservices.data.HttpWebRequest> request)
                                                                             throws ServiceLocalException,
                                                                                    Exception
* Validates request parameters, and emits the request to the server.

Parameters:
request - The request.
Returns:
The response returned by the server.
Throws:
ServiceLocalException
Exception


Copyright © 2012. All Rights Reserved.