microsoft.exchange.webservices.data.autodiscover.request
Class AutodiscoverRequest

java.lang.Object
  extended by microsoft.exchange.webservices.data.autodiscover.request.AutodiscoverRequest
Direct Known Subclasses:
GetDomainSettingsRequest, GetUserSettingsRequest

public abstract class AutodiscoverRequest
extends Object

Represents the base class for all requested made to the Autodiscover service.


Constructor Summary
protected AutodiscoverRequest(AutodiscoverService service, URI url)
          Initializes a new instance of the AutodiscoverResponse class.
 
Method Summary
protected abstract  AutodiscoverResponse createServiceResponse()
          Creates the service response.
protected abstract  String getRequestXmlElementName()
          Gets the name of the request XML element.
protected static InputStream getResponseStream(HttpWebRequest request)
          Gets the response stream (may be wrapped with GZip/Deflate stream to decompress content).
protected abstract  String getResponseXmlElementName()
          Gets the name of the response XML element.
protected  AutodiscoverService getService()
          Gets the Service.
protected  URI getUrl()
          Gets the URL.
protected abstract  String getWsAddressingActionName()
          Gets the WS-Addressing action name.
protected  AutodiscoverResponse internalExecute()
          Executes this instance.
static boolean isRedirectionResponse(HttpWebRequest request)
          Determines whether response is a redirection.
protected  AutodiscoverResponse loadFromXml(EwsXmlReader reader)
          Loads response from XML.
protected  AutodiscoverResponse readSoapBody(EwsXmlReader reader)
          Read SOAP body.
protected  void readSoapHeader(EwsXmlReader reader)
          Reads a single SOAP header.
protected  void readSoapHeaders(EwsXmlReader reader)
          Read SOAP header.
protected  void validate()
          Validates the request.
protected abstract  void writeAttributesToXml(EwsServiceXmlWriter writer)
          Writes attribute to request XML.
protected  void writeBodyToXml(EwsServiceXmlWriter writer)
          Writes XML body.
protected abstract  void writeElementsToXml(EwsServiceXmlWriter writer)
          Writes elements to request XML.
protected  void writeExtraCustomSoapHeadersToXml(EwsServiceXmlWriter writer)
          Write extra headers.
protected  void writeSoapRequest(URI requestUrl, EwsServiceXmlWriter writer)
          Writes the autodiscover SOAP request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutodiscoverRequest

protected AutodiscoverRequest(AutodiscoverService service,
                              URI url)
Initializes a new instance of the AutodiscoverResponse class.

Parameters:
service - Autodiscover service associated with this request.
url - URL of Autodiscover service.
Method Detail

isRedirectionResponse

public static boolean isRedirectionResponse(HttpWebRequest request)
                                     throws EWSHttpException
Determines whether response is a redirection.

Parameters:
request - the request
Returns:
True if redirection response.
Throws:
EWSHttpException - the EWS http exception

validate

protected void validate()
                 throws Exception
Validates the request.

Throws:
Exception - the exception

internalExecute

protected AutodiscoverResponse internalExecute()
                                        throws Exception
Executes this instance.

Returns:
the autodiscover response
Throws:
Exception - the exception

writeSoapRequest

protected void writeSoapRequest(URI requestUrl,
                                EwsServiceXmlWriter writer)
                         throws XMLStreamException,
                                ServiceXmlSerializationException
Writes the autodiscover SOAP request.

Parameters:
requestUrl - request URL
writer - writer object
Throws:
XMLStreamException - the XML stream exception
ServiceXmlSerializationException - the service xml serialization exception

writeExtraCustomSoapHeadersToXml

protected void writeExtraCustomSoapHeadersToXml(EwsServiceXmlWriter writer)
                                         throws XMLStreamException,
                                                ServiceXmlSerializationException
Write extra headers.

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

writeBodyToXml

protected void writeBodyToXml(EwsServiceXmlWriter writer)
                       throws ServiceXmlSerializationException,
                              XMLStreamException
Writes XML body.

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

getResponseStream

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

Parameters:
request - the request
Returns:
ResponseStream
Throws:
EWSHttpException - the EWS http exception
IOException - signals that an I/O exception has occurred.

readSoapHeaders

protected void readSoapHeaders(EwsXmlReader reader)
                        throws Exception
Read SOAP header.

Parameters:
reader - EwsXmlReader.
Throws:
Exception - the exception

readSoapHeader

protected void readSoapHeader(EwsXmlReader reader)
                       throws Exception
Reads a single SOAP header.

Parameters:
reader - EwsXmlReader
Throws:
Exception - on error

readSoapBody

protected AutodiscoverResponse readSoapBody(EwsXmlReader reader)
                                     throws Exception
Read SOAP body.

Parameters:
reader - EwsXmlReader.
Returns:
AutodiscoverResponse AutodiscoverResponse object
Throws:
Exception - the exception

loadFromXml

protected AutodiscoverResponse loadFromXml(EwsXmlReader reader)
                                    throws Exception
Loads response from XML.

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

getRequestXmlElementName

protected abstract String getRequestXmlElementName()
Gets the name of the request XML element.

Returns:
RequestXmlElementName gets XmlElementName.

getResponseXmlElementName

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

Returns:
ResponseXmlElementName gets XmlElementName.

getWsAddressingActionName

protected abstract String getWsAddressingActionName()
Gets the WS-Addressing action name.

Returns:
WsAddressingActionName gets WsAddressingActionName.

createServiceResponse

protected abstract AutodiscoverResponse createServiceResponse()
Creates the service response.

Returns:
AutodiscoverResponse AutodiscoverResponse object.

writeAttributesToXml

protected abstract void writeAttributesToXml(EwsServiceXmlWriter writer)
                                      throws ServiceXmlSerializationException
Writes attribute to request XML.

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

writeElementsToXml

protected abstract void writeElementsToXml(EwsServiceXmlWriter writer)
                                    throws XMLStreamException,
                                           ServiceXmlSerializationException
Writes elements to request XML.

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

getService

protected AutodiscoverService getService()
Gets the Service.

Returns:
AutodiscoverService AutodiscoverService object.

getUrl

protected URI getUrl()
Gets the URL.

Returns:
url URL Object.


Copyright © 2012–2015 Microsoft. All rights reserved.