Class AutodiscoverRequest
- java.lang.Object
-
- 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
Constructors Modifier Constructor Description protectedAutodiscoverRequest(AutodiscoverService service, URI url)Initializes a new instance of the AutodiscoverResponse class.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AutodiscoverResponsecreateServiceResponse()Creates the service response.protected abstract StringgetRequestXmlElementName()Gets the name of the request XML element.protected static InputStreamgetResponseStream(HttpWebRequest request)Gets the response stream (may be wrapped with GZip/Deflate stream to decompress content).protected abstract StringgetResponseXmlElementName()Gets the name of the response XML element.protected AutodiscoverServicegetService()Gets the Service.protected URIgetUrl()Gets the URL.protected abstract StringgetWsAddressingActionName()Gets the WS-Addressing action name.protected AutodiscoverResponseinternalExecute()Executes this instance.static booleanisRedirectionResponse(HttpWebRequest request)Determines whether response is a redirection.protected AutodiscoverResponseloadFromXml(EwsXmlReader reader)Loads response from XML.protected AutodiscoverResponsereadSoapBody(EwsXmlReader reader)Read SOAP body.protected voidreadSoapHeader(EwsXmlReader reader)Reads a single SOAP header.protected voidreadSoapHeaders(EwsXmlReader reader)Read SOAP header.protected voidvalidate()Validates the request.protected abstract voidwriteAttributesToXml(EwsServiceXmlWriter writer)Writes attribute to request XML.protected voidwriteBodyToXml(EwsServiceXmlWriter writer)Writes XML body.protected abstract voidwriteElementsToXml(EwsServiceXmlWriter writer)Writes elements to request XML.protected voidwriteExtraCustomSoapHeadersToXml(EwsServiceXmlWriter writer)Write extra headers.protected voidwriteSoapRequest(URI requestUrl, EwsServiceXmlWriter writer)Writes the autodiscover SOAP request.
-
-
-
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 URLwriter- writer object- Throws:
XMLStreamException- the XML stream exceptionServiceXmlSerializationException- 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 exceptionXMLStreamException- 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 exceptionXMLStreamException- 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 exceptionIOException- 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 exceptionServiceXmlSerializationException- the service xml serialization exception
-
getService
protected AutodiscoverService getService()
Gets the Service.- Returns:
- AutodiscoverService AutodiscoverService object.
-
-