* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
System.out.println("You must add \"locatorURI=<uri>\" to the command line or VM_Args");
} else {
SecurityInfoC<HttpURLConnection> si = SecurityInfoC.instance(access, HttpURLConnection.class);
AAFLocator loc = new AAFLocator(si,new URI(uriPrefix+"/locate/"+Define.ROOT_NS()+".hello:1.0"));
AAFConHttp aafcon = new AAFConHttp(access,loc,si);
System.out.println("You must add \"locatorURI=<uri>\" to the command line or VM_Args");
} else {
SecurityInfoC<HttpURLConnection> si = SecurityInfoC.instance(access, HttpURLConnection.class);
AAFLocator loc = new AAFLocator(si,new URI(uriPrefix+"/locate/"+Define.ROOT_NS()+".hello:1.0"));
AAFConHttp aafcon = new AAFConHttp(access,loc,si);
//
String pathinfo = "/hello";
final int iterations = Integer.parseInt(access.getProperty("iterations","5"));
System.out.println("Calling " + loc + " with Path " + pathinfo + ' ' + iterations + " time" + (iterations==1?"":"s"));
//
String pathinfo = "/hello";
final int iterations = Integer.parseInt(access.getProperty("iterations","5"));
System.out.println("Calling " + loc + " with Path " + pathinfo + ' ' + iterations + " time" + (iterations==1?"":"s"));
aafcon.best(new Retryable<Void> () {
@Override
public Void code(Rcli<?> client) throws CadiException, ConnectException, APIException {
Future<String> fs = client.read("/hello","text/plain");
aafcon.best(new Retryable<Void> () {
@Override
public Void code(Rcli<?> client) throws CadiException, ConnectException, APIException {
Future<String> fs = client.read("/hello","text/plain");
System.out.print(fs.body());
} else {
System.err.println("Ooops, missed one: " + fs.code() + ": " + fs.body());
}
return null;
System.out.print(fs.body());
} else {
System.err.println("Ooops, missed one: " + fs.code() + ": " + fs.body());
}
return null;