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

java.lang.Object
  extended by microsoft.exchange.webservices.data.core.request.HttpWebRequest
      extended by microsoft.exchange.webservices.data.core.request.HttpClientWebRequest

public class HttpClientWebRequest
extends HttpWebRequest

HttpClientWebRequest is used for making request to the server through NTLM Authentication by using Apache HttpClient 3.1 and JCIFS Library.


Constructor Summary
HttpClientWebRequest(org.apache.http.impl.client.CloseableHttpClient httpClient, org.apache.http.client.protocol.HttpClientContext httpContext)
          Instantiates a new http native web request.
 
Method Summary
 void close()
          Releases the connection by Closing.
 int executeRequest()
          Executes Request by sending request xml data to server.
 String getContentEncoding()
          Gets the content encoding.
 InputStream getErrorStream()
          Gets the error stream.
 InputStream getInputStream()
          Gets the input stream.
 OutputStream getOutputStream()
          Gets the output stream.
 Map<String,String> getRequestProperty()
          Gets the request property.
 int getResponseCode()
          Gets the response code.
 String getResponseContentType()
          Gets the response content type.
 String getResponseHeaderField(String headerName)
          Gets the response header field.
 Map<String,String> getResponseHeaders()
          Gets the response headers.
 String getResponseText()
          Gets the response message.
 void prepareConnection()
          Prepares the request by setting appropriate headers, authentication, timeouts, etc.
 
Methods inherited from class microsoft.exchange.webservices.data.core.request.HttpWebRequest
getAccept, getContentType, getDomain, getHeaders, getPassword, getProxy, getRequestMethod, getTimeout, getUrl, getUserAgent, getUsername, isAcceptGzipEncoding, isAllowAuthentication, isAllowAutoRedirect, isHttpScheme, isHttpsScheme, isKeepAlive, isPreAuthenticate, isUseDefaultCredentials, setAccept, setAcceptGzipEncoding, setAllowAuthentication, setAllowAutoRedirect, setContentType, setCredentials, setDomain, setHeaders, setKeepAlive, setPassword, setPreAuthenticate, setProxy, setRequestMethod, setTimeout, setUrl, setUseDefaultCredentials, setUserAgent, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientWebRequest

public HttpClientWebRequest(org.apache.http.impl.client.CloseableHttpClient httpClient,
                            org.apache.http.client.protocol.HttpClientContext httpContext)
Instantiates a new http native web request.

Method Detail

close

public void close()
           throws IOException
Releases the connection by Closing.

Specified by:
close in class HttpWebRequest
Throws:
IOException

prepareConnection

public void prepareConnection()
Prepares the request by setting appropriate headers, authentication, timeouts, etc.

Specified by:
prepareConnection in class HttpWebRequest

getInputStream

public InputStream getInputStream()
                           throws EWSHttpException,
                                  IOException
Gets the input stream.

Specified by:
getInputStream in class HttpWebRequest
Returns:
the input stream
Throws:
EWSHttpException - the EWS http exception
IOException - the IO exception

getErrorStream

public InputStream getErrorStream()
                           throws EWSHttpException
Gets the error stream.

Specified by:
getErrorStream in class HttpWebRequest
Returns:
the error stream
Throws:
EWSHttpException - the EWS http exception

getOutputStream

public OutputStream getOutputStream()
                             throws EWSHttpException
Gets the output stream.

Specified by:
getOutputStream in class HttpWebRequest
Returns:
the output stream
Throws:
EWSHttpException - the EWS http exception

getResponseHeaders

public Map<String,String> getResponseHeaders()
                                      throws EWSHttpException
Gets the response headers.

Specified by:
getResponseHeaders in class HttpWebRequest
Returns:
the response headers
Throws:
EWSHttpException - the EWS http exception

getResponseHeaderField

public String getResponseHeaderField(String headerName)
                              throws EWSHttpException
Description copied from class: HttpWebRequest
Gets the response header field.

Specified by:
getResponseHeaderField in class HttpWebRequest
Parameters:
headerName - the header name
Returns:
the response header field
Throws:
EWSHttpException - the EWS http exception

getContentEncoding

public String getContentEncoding()
                          throws EWSHttpException
Gets the content encoding.

Specified by:
getContentEncoding in class HttpWebRequest
Returns:
the content encoding
Throws:
EWSHttpException - the EWS http exception

getResponseContentType

public String getResponseContentType()
                              throws EWSHttpException
Gets the response content type.

Specified by:
getResponseContentType in class HttpWebRequest
Returns:
the response content type
Throws:
EWSHttpException - the EWS http exception

executeRequest

public int executeRequest()
                   throws EWSHttpException,
                          IOException
Executes Request by sending request xml data to server.

Specified by:
executeRequest in class HttpWebRequest
Throws:
EWSHttpException - the EWS http exception
IOException - the IO Exception

getResponseCode

public int getResponseCode()
                    throws EWSHttpException
Gets the response code.

Specified by:
getResponseCode in class HttpWebRequest
Returns:
the response code
Throws:
EWSHttpException - the EWS http exception

getResponseText

public String getResponseText()
                       throws EWSHttpException
Gets the response message.

Specified by:
getResponseText in class HttpWebRequest
Returns:
the response message
Throws:
EWSHttpException - the EWS http exception

getRequestProperty

public Map<String,String> getRequestProperty()
                                      throws EWSHttpException
Gets the request property.

Specified by:
getRequestProperty in class HttpWebRequest
Returns:
the request property
Throws:
EWSHttpException - the EWS http exception


Copyright © 2012–2015 Microsoft. All rights reserved.