public class HttpRestR66Client extends HttpRestClientHelper
Constructor and Description |
---|
HttpRestR66Client(String baseUri,
io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel> initializer,
int client,
long timeout)
Prepare the future connection
|
Modifier and Type | Method and Description |
---|---|
AbstractDbData |
getDbDataFromFuture(DbSession dbSession,
RestFuture future) |
JsonPacket |
getJsonPacketFromFuture(RestFuture future) |
String |
getPrimaryProperty(RestArgument bodyResponse) |
String |
getPrimaryPropertyName(String model) |
HttpRestR66Handler.RESTHANDLERS |
getRestHandler(RestArgument bodyResponse) |
RestFuture |
sendQuery(RestConfiguration config,
io.netty.channel.Channel channel,
io.netty.handler.codec.http.HttpMethod method,
String host,
String addedUri,
String user,
String pwd,
Map<String,String> uriArgs,
String json)
Send an HTTP query using the channel for target
|
closeAll, getChannel, main, sendQuery, sendQuery
public HttpRestR66Client(String baseUri, io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel> initializer, int client, long timeout)
baseUri
- in general = '/'initializer
- the associated Initializer including the REST
handler for client sideclient
- limit number of concurrent connected clientstimeout
- time out for network connectionpublic RestFuture sendQuery(RestConfiguration config, io.netty.channel.Channel channel, io.netty.handler.codec.http.HttpMethod method, String host, String addedUri, String user, String pwd, Map<String,String> uriArgs, String json)
config
- configuration for REST servicechannel
- target of the querymethod
- HttpMethod to usehost
- target of the query (shall be the same as for the
channel)addedUri
- additional uri, added to baseUri (shall include
also
extra arguments) (might be null)user
- user to use in authenticated Rest procedure (might be
null)pwd
- password to use in authenticated Rest procedure (might
be
null)uriArgs
- arguments for Uri if any (might be null)json
- json to send as body in the request (might be null);
Useful
in PUT, POST but should not in
GET, DELETE, OPTIONSpublic HttpRestR66Handler.RESTHANDLERS getRestHandler(RestArgument bodyResponse)
bodyResponse
- public String getPrimaryProperty(RestArgument bodyResponse)
bodyResponse
- public String getPrimaryPropertyName(String model)
model
- public AbstractDbData getDbDataFromFuture(DbSession dbSession, RestFuture future) throws HttpIncorrectRequestException
dbSession
- future
- HttpIncorrectRequestException
public JsonPacket getJsonPacketFromFuture(RestFuture future) throws HttpIncorrectRequestException
future
- HttpIncorrectRequestException
Copyright © 2009–2020 Waarp. All rights reserved.