- private static void permTest(Locator<URI> dl, SecuritySetter<HttpURLConnection> ss) {
- try {
- URI uri = dl.get(dl.best());
- if(uri==null) {
- System.out.print("No URI available using " + ss.getClass().getSimpleName());
- System.out.println();
- return;
- } else {
- System.out.print("Resolved to: " + uri + " using " + ss.getClass().getSimpleName());
- }
- if(ss instanceof HRenewingTokenSS) {
- System.out.println(" " + ((HRenewingTokenSS)ss).tokenURL());
- } else {
- System.out.println();
- }
- HClient client = new HClient(ss, uri, 3000);
- client.setMethod("GET");
- String user = ss.getID();
- if(user.indexOf('@')<0) {
- user+="@isam.att.com";
- }
- client.setPathInfo("/authz/perms/user/"+user);
- client.send();
- Future<String> future = client.futureReadString();
- if(future.get(7000)) {
- System.out.println(future.body());
- } else {
- if(future.code()==401 && ss instanceof HX509SS) {
- System.out.println(" Authentication denied with 401 for Certificate.\n\t"
- + "This means Certificate isn't valid for this environment, and has attempted another method of Authentication");
- } else {
- System.out.println(future.code() + ":" + future.body());
- }
- }
- } catch (CadiException | LocatorException | APIException e) {
- e.printStackTrace();
- }
- }
+ private static void permTest(Locator<URI> dl, SecuritySetter<HttpURLConnection> ss) {
+ try {
+ URI uri = dl.get(dl.best());
+ if (uri==null) {
+ System.out.print("No URI available using " + ss.getClass().getSimpleName());
+ System.out.println();
+ return;
+ } else {
+ System.out.print("Resolved to: " + uri + " using " + ss.getClass().getSimpleName());
+ }
+ if (ss instanceof HRenewingTokenSS) {
+ System.out.println(" " + ((HRenewingTokenSS)ss).tokenURL());
+ } else {
+ System.out.println();
+ }
+ HClient client = new HClient(ss, uri, 3000);
+ client.setMethod("GET");
+ String user = ss.getID();
+ if (user.indexOf('@')<0) {
+ user+="@isam.att.com";
+ }
+ client.setPathInfo("/authz/perms/user/"+user);
+ client.send();
+ Future<String> future = client.futureReadString();
+ if (future.get(7000)) {
+ System.out.println(future.body());
+ } else {
+ if (future.code()==401 && ss instanceof HX509SS) {
+ System.out.println(" Authentication denied with 401 for Certificate.\n\t"
+ + "This means Certificate isn't valid for this environment, and has attempted another method of Authentication");
+ } else {
+ System.out.println(future.code() + ":" + future.body());
+ }
+ }
+ } catch (CadiException | LocatorException | APIException e) {
+ e.printStackTrace();
+ }
+ }