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

java.lang.Object
  extended by microsoft.exchange.webservices.data.core.request.HttpWebRequest
Direct Known Subclasses:
HttpClientWebRequest

public abstract class HttpWebRequest
extends Object

The Class HttpWebRequest.


Constructor Summary
HttpWebRequest()
           
 
Method Summary
abstract  void close()
          Close.
abstract  int executeRequest()
          Executes Request by sending request xml data to server.
 String getAccept()
          Gets the accept.
abstract  String getContentEncoding()
          Gets the content encoding.
 String getContentType()
          Gets the content type.
 String getDomain()
          Gets the domain.
abstract  InputStream getErrorStream()
          Gets the error stream.
 Map<String,String> getHeaders()
          Gets the Headers.
abstract  InputStream getInputStream()
          Gets the input stream.
abstract  OutputStream getOutputStream()
          Gets the output stream.
 String getPassword()
          Gets the password.
 WebProxy getProxy()
          Gets the Web Proxy.
 String getRequestMethod()
          Gets the request method type.
abstract  Map<String,String> getRequestProperty()
          Gets the request property.
abstract  int getResponseCode()
          Gets the response code.
abstract  String getResponseContentType()
          Gets the response content type.
abstract  String getResponseHeaderField(String headerName)
          Gets the response header field.
abstract  Map<String,String> getResponseHeaders()
          Gets the response headers.
abstract  String getResponseText()
          Gets the response message.
 int getTimeout()
          Gets the timeout.
 URL getUrl()
          Gets the url.
 String getUserAgent()
          Gets the user agent.
 String getUsername()
          Gets the user name.
 boolean isAcceptGzipEncoding()
          Checks if is accept gzip encoding.
 boolean isAllowAuthentication()
          Whether web service authentication is allowed.
 boolean isAllowAutoRedirect()
          Checks if is allow auto redirect.
 boolean isHttpScheme()
          Checks if is http scheme.
 boolean isHttpsScheme()
          Checks if is https scheme.
 boolean isKeepAlive()
          Checks if is keep alive.
 boolean isPreAuthenticate()
          Whether to use preemptive authentication.
 boolean isUseDefaultCredentials()
          Checks if is use default credential.
abstract  void prepareConnection()
          Prepare connection.
 void setAccept(String accept)
          Sets the accept.
 void setAcceptGzipEncoding(boolean acceptGzipEncoding)
          Sets the accept gzip encoding.
 void setAllowAuthentication(boolean allowAuthentication)
          Whether web service authentication is allowed.
 void setAllowAutoRedirect(boolean allowAutoRedirect)
          Sets the allow auto redirect.
 void setContentType(String contentType)
          Sets the content type.
 void setCredentials(String domain, String user, String pwd)
          Sets the credential.
 void setDomain(String domain)
          Sets the domain.
 void setHeaders(Map<String,String> headers)
          Sets the Headers.
 void setKeepAlive(boolean keepAlive)
          Sets the keep alive.
 void setPassword(String password)
          Sets the password.
 void setPreAuthenticate(boolean preAuthenticate)
          Whether to use preemptive authentication.
 void setProxy(WebProxy proxy)
          Sets the Web Proxy.
 void setRequestMethod(String requestMethod)
          Sets the request method type.
 void setTimeout(int timeout)
          Sets the timeout.
 void setUrl(URL url)
          Sets the url.
 void setUseDefaultCredentials(boolean useDefaultCredentials)
          Sets the use default credential.
 void setUserAgent(String userAgent)
          Sets the user agent.
 void setUsername(String username)
          Sets the user name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpWebRequest

public HttpWebRequest()
Method Detail

getProxy

public WebProxy getProxy()
Gets the Web Proxy.

Returns:
the proxy

setProxy

public void setProxy(WebProxy proxy)
Sets the Web Proxy.

Parameters:
proxy - The Web Proxy

isHttpScheme

public boolean isHttpScheme()
Checks if is http scheme.

Returns:
true, if is http scheme

isHttpsScheme

public boolean isHttpsScheme()
Checks if is https scheme.

Returns:
true, if is https scheme

getUsername

public String getUsername()
Gets the user name.

Returns:
the user name

setUsername

public void setUsername(String username)
Sets the user name.

Parameters:
username - the new user name

getPassword

public String getPassword()
Gets the password.

Returns:
the password

setPassword

public void setPassword(String password)
Sets the password.

Parameters:
password - the new password

getDomain

public String getDomain()
Gets the domain.

Returns:
the domain

setDomain

public void setDomain(String domain)
Sets the domain.

Parameters:
domain - the new domain

getUrl

public URL getUrl()
Gets the url.

Returns:
the url

setUrl

public void setUrl(URL url)
Sets the url.

Parameters:
url - the new url

isPreAuthenticate

public boolean isPreAuthenticate()
Whether to use preemptive authentication. Currently not implemented, though.


setPreAuthenticate

public void setPreAuthenticate(boolean preAuthenticate)
Whether to use preemptive authentication. Currently not implemented, though.


getTimeout

public int getTimeout()
Gets the timeout.

Returns:
the timeout

setTimeout

public void setTimeout(int timeout)
Sets the timeout.

Parameters:
timeout - the new timeout

getContentType

public String getContentType()
Gets the content type.

Returns:
the content type

setContentType

public void setContentType(String contentType)
Sets the content type.

Parameters:
contentType - the new content type

getAccept

public String getAccept()
Gets the accept.

Returns:
the accept

setAccept

public void setAccept(String accept)
Sets the accept.

Parameters:
accept - the new accept

getUserAgent

public String getUserAgent()
Gets the user agent.

Returns:
the user agent

setUserAgent

public void setUserAgent(String userAgent)
Sets the user agent.

Parameters:
userAgent - the new user agent

isAllowAutoRedirect

public boolean isAllowAutoRedirect()
Checks if is allow auto redirect.

Returns:
true, if is allow auto redirect

setAllowAutoRedirect

public void setAllowAutoRedirect(boolean allowAutoRedirect)
Sets the allow auto redirect.

Parameters:
allowAutoRedirect - the new allow auto redirect

isKeepAlive

public boolean isKeepAlive()
Checks if is keep alive.

Returns:
true, if is keep alive

setKeepAlive

public void setKeepAlive(boolean keepAlive)
Sets the keep alive.

Parameters:
keepAlive - the new keep alive

isAcceptGzipEncoding

public boolean isAcceptGzipEncoding()
Checks if is accept gzip encoding.

Returns:
true, if is accept gzip encoding

setAcceptGzipEncoding

public void setAcceptGzipEncoding(boolean acceptGzipEncoding)
Sets the accept gzip encoding.

Parameters:
acceptGzipEncoding - the new accept gzip encoding

isUseDefaultCredentials

public boolean isUseDefaultCredentials()
Checks if is use default credential.

Returns:
true, if is use default credential

setUseDefaultCredentials

public void setUseDefaultCredentials(boolean useDefaultCredentials)
Sets the use default credential.

Parameters:
useDefaultCredentials - the new use default credential

isAllowAuthentication

public boolean isAllowAuthentication()
Whether web service authentication is allowed. This can be set to false to disallow sending credential with this request. This is useful for the autodiscover request to the legacy HTTP url, because this single request doesn't require authentication and we don't want to send credential over HTTP.

Returns:
true if authentication is allowed.

setAllowAuthentication

public void setAllowAuthentication(boolean allowAuthentication)
Whether web service authentication is allowed. This can be set to false to disallow sending credential with this request. This is useful for the autodiscover request to the legacy HTTP url, because this single request doesn't require authentication and we don't want to send credential over HTTP. Default is true.

Parameters:
allowAuthentication - true if authentication is allowed.

getRequestMethod

public String getRequestMethod()
Gets the request method type.

Returns:
the request method type.

setRequestMethod

public void setRequestMethod(String requestMethod)
Sets the request method type.

Parameters:
requestMethod - the request method type.

getHeaders

public Map<String,String> getHeaders()
Gets the Headers.

Returns:
the content type

setHeaders

public void setHeaders(Map<String,String> headers)
Sets the Headers.

Parameters:
headers - The headers

setCredentials

public void setCredentials(String domain,
                           String user,
                           String pwd)
Sets the credential.

Parameters:
domain - user domain
user - user name
pwd - password

getInputStream

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

Returns:
the input stream
Throws:
EWSHttpException - the eWS http exception
IOException - the IO exception

getErrorStream

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

Returns:
the error stream
Throws:
EWSHttpException - the eWS http exception

getOutputStream

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

Returns:
the output stream
Throws:
EWSHttpException - the eWS http exception

close

public abstract void close()
                    throws IOException
Close.

Throws:
IOException

prepareConnection

public abstract void prepareConnection()
Prepare connection.


getResponseHeaders

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

Returns:
the response headers
Throws:
EWSHttpException - the eWS http exception

getContentEncoding

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

Returns:
the content encoding
Throws:
EWSHttpException - the EWS http exception

getResponseContentType

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

Returns:
the response content type
Throws:
EWSHttpException - the EWS http exception

getResponseCode

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

Returns:
the response code
Throws:
EWSHttpException - the EWS http exception

getResponseText

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

Returns:
the response message
Throws:
EWSHttpException - the EWS http exception

getResponseHeaderField

public abstract String getResponseHeaderField(String headerName)
                                       throws EWSHttpException
Gets the response header field.

Parameters:
headerName - the header name
Returns:
the response header field
Throws:
EWSHttpException - the EWS http exception

getRequestProperty

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

Returns:
the request property
Throws:
EWSHttpException - the EWS http exception

executeRequest

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

Throws:
EWSHttpException - the EWS http exception
IOException - the IO Exception


Copyright © 2012–2015 Microsoft. All rights reserved.