public abstract class AbstractHttpSession extends AbstractAuthorizedSession
| Constructor and Description |
|---|
AbstractHttpSession() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCookie(HttpCookie cookie)
Adds a cookie to the session.
|
protected void |
applyCookies(HttpURLConnection con)
Applies the registered cookies with this connection.
|
void |
close()
Closes the previously established Bugzilla session.
|
void |
configure(org.apache.commons.configuration.Configuration config)
Configures the session.
|
void |
debugResponse(HttpURLConnection con)
Debugs the response from a connection.
|
void |
dump()
Debugs information into log.
|
URL |
getBaseUrl() |
String |
getBugzillaVersion()
Returns the bugzilla version this session object is connected to.
|
protected HttpURLConnection |
getConnection(String urlPath,
String params)
Makes a request to Bugzilla including eventual GET parameters.
|
protected HttpURLConnection |
getConnection(String urlPath,
String params,
Map<String,String> requestProperties)
Makes a request to Bugzilla including eventual GET parameters.
|
protected HttpURLConnection |
getConnection(String urlPath,
String params,
Map<String,String> requestProperties,
boolean isGet)
Makes a request to Bugzilla including eventual GET parameters.
|
Iterator<HttpCookie> |
getCookies()
Returns all cookies from the Bugzilla session
|
Proxy |
getProxy() |
AuthorizationCallback |
getProxyAuthorizationCallback() |
boolean |
isLoggedIn()
Returns true when session is connected to Bugzilla.
|
protected boolean |
retrieveCookies(URLConnection con)
Retrieves and saves the cookies from the URL connection.
|
void |
setBaseUrl(URL baseUrl) |
protected void |
setBugzillaVersion(String s)
Sets the Bugzilla version connected to.
|
protected void |
setLoggedIn(boolean loggedIn)
Sets the login status.
|
void |
setProxy(Proxy proxy) |
void |
setProxyAuthorizationCallback(AuthorizationCallback proxyAuthorizationCallback) |
checkBugzillaVersion, createIssue, getAuthorizationCallback, getBugzillaBugClass, getLog, getLogin, getPassword, setAuthorizationCallback, setBugzillaBugClassclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttachment, getIssue, getMaximumBugzillaVersion, getMinimumBugzillaVersion, open, searchBugspublic void configure(org.apache.commons.configuration.Configuration config)
throws org.apache.commons.configuration.ConfigurationException
A proxy can be configured by using "proxy-host" element. Use the colon to separate host and port information.
Proxy authorization is configured by element <ProxyAuthorizationCallback>. It defines the implementation class that will deliver login name and password.
configure in interface Configurableconfigure in class AbstractAuthorizedSessionconfig - - configuration objectorg.apache.commons.configuration.ConfigurationException - - when configuration failspublic void close()
public URL getBaseUrl()
public void setBaseUrl(URL baseUrl)
baseUrl - the baseUrl to setpublic Proxy getProxy()
public void setProxy(Proxy proxy)
proxy - the proxy to setpublic AuthorizationCallback getProxyAuthorizationCallback()
public void setProxyAuthorizationCallback(AuthorizationCallback proxyAuthorizationCallback)
proxyAuthorizationCallback - the proxyAuthorizationCallback to setpublic String getBugzillaVersion()
protected void setBugzillaVersion(String s)
s - new versionpublic boolean isLoggedIn()
protected void setLoggedIn(boolean loggedIn)
loggedIn - - the login status to setpublic Iterator<HttpCookie> getCookies()
protected void addCookie(HttpCookie cookie)
cookie - - the cookie to addprotected HttpURLConnection getConnection(String urlPath, String params)
urlPath - URL path to requestparams - param string to be appendedprotected HttpURLConnection getConnection(String urlPath, String params, Map<String,String> requestProperties)
urlPath - URL path to requestparams - param string to be appendedrequestProperties - properties of the requestprotected HttpURLConnection getConnection(String urlPath, String params, Map<String,String> requestProperties, boolean isGet)
urlPath - URL path to requestparams - param string to be appendedrequestProperties - properties of the requestisGet - true when a GET request shall be prepared, false if this will be a POST request.protected boolean retrieveCookies(URLConnection con) throws MalformedURLException
con - - the HTTP connectionMalformedURLException - - when the URL had a problemprotected void applyCookies(HttpURLConnection con)
con - - HTTP connection objectpublic void debugResponse(HttpURLConnection con)
con - - HTTP connection to dumppublic void dump()
dump in interface Sessiondump in class AbstractAuthorizedSessionCopyright © 2012. All Rights Reserved.