Package org.openstack4j.core.transport
Class HttpRequest.RequestBuilder<R>
- java.lang.Object
-
- org.openstack4j.core.transport.HttpRequest.RequestBuilder<R>
-
- Enclosing class:
- HttpRequest<R>
public static final class HttpRequest.RequestBuilder<R> extends Object
-
-
Constructor Summary
Constructors Constructor Description RequestBuilder(Class<R> returnType)RequestBuilder(HttpRequest<R> request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRequest<R>build()Builds the HttpRequestHttpRequest.RequestBuilder<R>config(Config config)Sets a client configuration to use with this sessionHttpRequest.RequestBuilder<R>contentType(String contentType)Overrides the default content type for the requestHttpRequest.RequestBuilder<R>endpoint(String endpoint)HttpRequest.RequestBuilder<R>endpointFunction(Function<String,String> endpointFunc)A Function which allows manipulation of the endpoint depending on the service API utilizing itHttpRequest.RequestBuilder<R>endpointTokenProvider(EndpointTokenProvider provider)A Provider which will return the current Authorization TokenHttpRequest.RequestBuilder<R>entity(Payload<?> entity)HttpRequest.RequestBuilder<R>entity(ModelEntity entity)HttpRequest.RequestBuilder<R>header(String name, Object value)Adds a new Header to the requestHttpRequest.RequestBuilder<R>headers(Map<String,?> headers)Pushes the Map of Headers into the existing headers for this requestHttpRequest.RequestBuilder<R>json(String json)AdHoc JSON object to Post/PutHttpRequest.RequestBuilder<R>method(HttpMethod method)HttpRequest.RequestBuilder<R>methodDelete()Flags the request method as DELETEHttpRequest.RequestBuilder<R>methodGet()Flags the request method as GETHttpRequest.RequestBuilder<R>methodPost()Flags the request method as POSTHttpRequest.RequestBuilder<R>methodPut()Flags the request method as PUTHttpRequest.RequestBuilder<R>path(String path)HttpRequest.RequestBuilder<R>queryParam(String key, Object value)Adds a Key/Value based Query ParamHttpRequest.RequestBuilder<R>serviceType(ServiceType service)The endpoint Service TypeHttpRequest.RequestBuilder<R>updateQueryParam(String key, Object value)Updates a Key/Value based Query Param
-
-
-
Constructor Detail
-
RequestBuilder
public RequestBuilder(HttpRequest<R> request)
-
-
Method Detail
-
endpoint
public HttpRequest.RequestBuilder<R> endpoint(String endpoint)
- See Also:
HttpRequest.getEndpoint()
-
path
public HttpRequest.RequestBuilder<R> path(String path)
- See Also:
HttpRequest.getPath()
-
method
public HttpRequest.RequestBuilder<R> method(HttpMethod method)
- See Also:
HttpRequest.getMethod()
-
endpointFunction
public HttpRequest.RequestBuilder<R> endpointFunction(Function<String,String> endpointFunc)
A Function which allows manipulation of the endpoint depending on the service API utilizing it- Parameters:
endpointFunc- the function to modify the current endpoint into a resulting endpoint- Returns:
- this
-
methodPut
public HttpRequest.RequestBuilder<R> methodPut()
Flags the request method as PUT- Returns:
- the request builder
-
methodGet
public HttpRequest.RequestBuilder<R> methodGet()
Flags the request method as GET- Returns:
- the request builder
-
methodDelete
public HttpRequest.RequestBuilder<R> methodDelete()
Flags the request method as DELETE- Returns:
- the request builder
-
methodPost
public HttpRequest.RequestBuilder<R> methodPost()
Flags the request method as POST- Returns:
- the request builder
-
entity
public HttpRequest.RequestBuilder<R> entity(ModelEntity entity)
- See Also:
HttpRequest.getEntity()
-
entity
public HttpRequest.RequestBuilder<R> entity(Payload<?> entity)
- See Also:
HttpRequest.getEntity()
-
config
public HttpRequest.RequestBuilder<R> config(Config config)
Sets a client configuration to use with this session
-
headers
public HttpRequest.RequestBuilder<R> headers(Map<String,?> headers)
Pushes the Map of Headers into the existing headers for this request- Parameters:
headers- the headers to append- Returns:
- the request builder
-
header
public HttpRequest.RequestBuilder<R> header(String name, Object value)
Adds a new Header to the request- Parameters:
name- the header namevalue- the header value- Returns:
- the request builder
-
serviceType
public HttpRequest.RequestBuilder<R> serviceType(ServiceType service)
The endpoint Service Type- Parameters:
service- the service type- Returns:
- the request builder
-
queryParam
public HttpRequest.RequestBuilder<R> queryParam(String key, Object value)
Adds a Key/Value based Query Param- Parameters:
key- the keyvalue- the value- Returns:
- the request builder
-
updateQueryParam
public HttpRequest.RequestBuilder<R> updateQueryParam(String key, Object value)
Updates a Key/Value based Query Param- Parameters:
key- the keyvalue- the value- Returns:
- the request builder
-
endpointTokenProvider
public HttpRequest.RequestBuilder<R> endpointTokenProvider(EndpointTokenProvider provider)
A Provider which will return the current Authorization Token- Parameters:
provider- the provider- Returns:
- the request builder
-
json
public HttpRequest.RequestBuilder<R> json(String json)
AdHoc JSON object to Post/Put- Parameters:
json- the JSON object in String form- Returns:
- the request builder
-
contentType
public HttpRequest.RequestBuilder<R> contentType(String contentType)
Overrides the default content type for the request- Parameters:
contentType- the content type to use in the request- Returns:
- the request builder
-
build
public HttpRequest<R> build()
Builds the HttpRequest- Returns:
- HttpRequest
-
-