|
|
|
@ -26,14 +26,10 @@ public class TargetFactory implements TargetFactoryDSL.AtClause{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public GXWebTargetAdapterRequest at(String address) {
|
|
|
|
|
public GXWebTargetAdapterRequest getAsGxRest(String address) {
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
|
|
|
|
|
Client client = ClientBuilder.newClient()
|
|
|
|
|
.property(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE)
|
|
|
|
|
.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024*1024).property(ClientProperties.OUTBOUND_CONTENT_LENGTH_BUFFER, -1)
|
|
|
|
|
.property(ClientProperties.REQUEST_ENTITY_PROCESSING, "CHUNKED");
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
String resourceAddress = address.substring(0, address.indexOf("/service"));
|
|
|
|
@ -64,8 +60,31 @@ public class TargetFactory implements TargetFactoryDSL.AtClause{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public WebTarget at(String address) {
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
|
|
|
|
|
Client client = ClientBuilder.newClient()
|
|
|
|
|
.property(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE)
|
|
|
|
|
.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024*1024).property(ClientProperties.OUTBOUND_CONTENT_LENGTH_BUFFER, -1)
|
|
|
|
|
.property(ClientProperties.REQUEST_ENTITY_PROCESSING, "CHUNKED");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WebTarget webTarget = client.target(address).path(target.path());
|
|
|
|
|
|
|
|
|
|
webTarget.register(new JaxRSRequestFilter(target));
|
|
|
|
|
|
|
|
|
|
return webTarget;
|
|
|
|
|
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
log.error("error building service",e);
|
|
|
|
|
throw new RuntimeException("error building service",e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public GXWebTargetAdapterRequest at(EndpointReference endpoint){
|
|
|
|
|
public WebTarget at(EndpointReference endpoint){
|
|
|
|
|
return at(new JaxRSEndpointReference(endpoint).address);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|