public class HttpProxyBroker extends Object
Constructor and Description |
---|
HttpProxyBroker(HttpProxy proxy) |
Modifier and Type | Method and Description |
---|---|
<F,T> T |
action(String url,
F entity,
Class<F> from,
Class<T> to)
Performs action on a resource
|
<F,T> T |
action(String url,
F entity,
Class<F> from,
Class<T> to,
List<org.apache.http.Header> headers)
Performs action on a resource
|
<F,T> T |
add(String url,
F entity,
Class<F> from,
Class<T> to)
Adds new resource
|
<F,T> T |
add(String url,
F entity,
Class<F> from,
Class<T> to,
List<org.apache.http.Header> headers)
Adds new resource
|
<F,T> T |
delete(String url,
Class<T> to)
Deletes resource
|
<F,T> T |
delete(String url,
Class<T> to,
List<org.apache.http.Header> headers)
Deletes resource
|
<F,T> T |
delete(String url,
F entity,
Class<F> from,
Class<T> to)
Deletes resource
|
<F,T> T |
delete(String url,
F entity,
Class<F> from,
Class<T> to,
List<org.apache.http.Header> headers)
Deletes resource
|
String |
get(String url)
Fetches resource
|
<F> F |
get(String url,
Class<F> from)
Fetches resource
|
<F,T> T |
get(String url,
Class<F> from,
Class<T> to)
Fetches resource
|
<F,T> T |
get(String url,
Class<F> from,
Class<T> to,
List<org.apache.http.Header> headers)
Fetches resource
|
String |
get(String url,
List<org.apache.http.Header> headers)
Fetches resource
|
String |
getRoot() |
boolean |
isDebug() |
boolean |
isFilter() |
boolean |
isPersistentAuth() |
boolean |
isSetSessionid()
oVirt api sessionid to authenticate the user with
(used as SSO solution instead of username+password)
|
void |
setDebug(boolean debug)
Enable/Disable debug mode (default is False)
|
void |
setFilter(boolean filter)
Enable/Disable client permissions based filtering (default is False)
|
void |
setPersistentAuth(boolean persistentAuth)
Enable/Disable persistent authentication (default is True)
|
void |
setSessionid(String sessionid) |
void |
shutdown()
When HttpProxyBroker instance is no longer needed, shut down the connection
manager to ensure immediate deallocation of all system resources.
|
<F,T> T |
update(String url,
F entity,
Class<F> from,
Class<T> to)
updates resource
|
<F,T> T |
update(String url,
F entity,
Class<F> from,
Class<T> to,
List<org.apache.http.Header> headers)
updates resource
|
public HttpProxyBroker(HttpProxy proxy)
proxy
- HttpProxy to encapsulatepublic <F,T> T update(String url, F entity, Class<F> from, Class<T> to) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- resource urlentity
- resourcefrom
- from typeto
- to typeIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T update(String url, F entity, Class<F> from, Class<T> to, List<org.apache.http.Header> headers) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- resource urlentity
- resourcefrom
- from typeto
- to typeheaders
- HTTP headersIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T action(String url, F entity, Class<F> from, Class<T> to) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- resource urlentity
- resourcefrom
- from typeto
- to typeIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T action(String url, F entity, Class<F> from, Class<T> to, List<org.apache.http.Header> headers) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- resource urlentity
- resourcefrom
- from typeto
- to typeheaders
- HTTP headersIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T add(String url, F entity, Class<F> from, Class<T> to) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- collection urlentity
- entity to addfrom
- from typeto
- to typeIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T add(String url, F entity, Class<F> from, Class<T> to, List<org.apache.http.Header> headers) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- collection urlentity
- entity to addfrom
- from typeto
- to typeheaders
- HTTP headersIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T delete(String url, Class<T> to) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- resource urlto
- to typrIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T delete(String url, Class<T> to, List<org.apache.http.Header> headers) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- resource urlto
- to typrheaders
- HTTP headersIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T delete(String url, F entity, Class<F> from, Class<T> to) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- resource urlentity
- entity to passfrom
- from typeto
- to typeIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T delete(String url, F entity, Class<F> from, Class<T> to, List<org.apache.http.Header> headers) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- resource urlentity
- entity to passfrom
- from typeto
- to typeheaders
- HTTP headersIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T get(String url, Class<F> from, Class<T> to, List<org.apache.http.Header> headers) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- entity urlfrom
- from typeto
- to typeheaders
- HTTP headersIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F,T> T get(String url, Class<F> from, Class<T> to) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- entity urlfrom
- from typeto
- to typeIOException
org.apache.http.client.ClientProtocolException
ServerException
public <F> F get(String url, Class<F> from) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- entity urlfrom
- from typeIOException
org.apache.http.client.ClientProtocolException
ServerException
public String get(String url) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- entity urlIOException
org.apache.http.client.ClientProtocolException
ServerException
public String get(String url, List<org.apache.http.Header> headers) throws IOException, org.apache.http.client.ClientProtocolException, ServerException
url
- entity urlheaders
- HTTP headersIOException
org.apache.http.client.ClientProtocolException
ServerException
public void setFilter(boolean filter)
filter
- public void setDebug(boolean debug)
debug
- public void setPersistentAuth(boolean persistentAuth)
persistentAuth
- public void setSessionid(String sessionid)
sessionid
- oVirt api sessionid to authenticate the user with
(used as SSO solution instead of username+password)public boolean isSetSessionid()
public boolean isPersistentAuth()
public boolean isFilter()
public boolean isDebug()
public String getRoot()
public void shutdown()
Copyright ? 2010 Red Hat, Inc - released under the Apache License Version 2.0