From 58c2a7132f861e269ed707eb585657b0c9ead9f5 Mon Sep 17 00:00:00 2001 From: "Gathman, Jonathan (jg1555)" Date: Wed, 17 Jul 2019 16:07:20 -0500 Subject: Change API Version to 2.1.15 Issue-ID: AAF-902 Change-Id: I25ea4791fcbe45612197d7206b4af1ae23b6c489 Signed-off-by: Gathman, Jonathan (jg1555) --- cadi/aaf/pom.xml | 2 +- .../org/onap/aaf/cadi/aaf/TestConnectivity.java | 2 +- .../java/org/onap/aaf/cadi/configure/Agent.java | 31 ++++++++++++++-------- cadi/client/pom.xml | 2 +- cadi/core/pom.xml | 2 +- .../main/java/org/onap/aaf/cadi/PropAccess.java | 7 +++++ .../main/java/org/onap/aaf/cadi/config/Config.java | 8 +++++- cadi/oauth-enduser/pom.xml | 2 +- cadi/pom.xml | 2 +- cadi/servlet-sample/pom.xml | 2 +- 10 files changed, 41 insertions(+), 19 deletions(-) (limited to 'cadi') diff --git a/cadi/aaf/pom.xml b/cadi/aaf/pom.xml index ea8bb1ee..b5767b26 100644 --- a/cadi/aaf/pom.xml +++ b/cadi/aaf/pom.xml @@ -24,7 +24,7 @@ org.onap.aaf.authz cadiparent - 2.1.14-SNAPSHOT + 2.1.15-SNAPSHOT .. diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java index f02c17f8..efcaa7ef 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java @@ -76,7 +76,7 @@ public class TestConnectivity { List> lss = loadSetters(access,si); ///////// String directAAFURL = aaf_urls.get(Config.AAF_URL); - if(directAAFURL!=null && !directAAFURL.contains("/locate/") || !directAAFURL.contains("AAF_LOCATE_URL")) { + if(directAAFURL!=null && !(directAAFURL.contains("/locate/") || directAAFURL.contains("AAF_LOCATE_URL"))) { print(true,"Test Connections by non-located aaf_url"); Locator locator = new SingleEndpointLocator(directAAFURL); connectTest(locator,new URI(directAAFURL)); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java index aa9bf138..fda591e3 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java @@ -52,6 +52,7 @@ import org.onap.aaf.cadi.CmdLine; import org.onap.aaf.cadi.LocatorException; import org.onap.aaf.cadi.PropAccess; import org.onap.aaf.cadi.Symm; +import org.onap.aaf.cadi.aaf.TestConnectivity; import org.onap.aaf.cadi.aaf.client.ErrMessage; import org.onap.aaf.cadi.aaf.v2_0.AAFCon; import org.onap.aaf.cadi.aaf.v2_0.AAFConHttp; @@ -137,6 +138,13 @@ public class Agent { System.out.println(HASHES); } CmdLine.main(newArgs); + } else if(args.length>0 && "connectivity".equals(args[0])) { + String[] newArgs = new String[args.length-1]; + System.arraycopy(args, 1, newArgs, 0, newArgs.length); + if(newArgs.length>0 && newArgs[0].indexOf('@')>=0) { + newArgs[0]=FQI.reverseDomain(newArgs[0])+".props"; + } + TestConnectivity.main(newArgs); } else { try { AAFSSO aafsso=null; @@ -235,17 +243,18 @@ public class Agent { } // NOTE: CHANGE IN CMDS should be reflected in AAFSSO constructor, to get FQI->aaf-id or not System.out.println("Usage: java -jar cmd []*"); - System.out.println(" create []"); - System.out.println(" read []"); - System.out.println(" update []"); - System.out.println(" delete []"); - System.out.println(" copy [,]*"); - System.out.println(" place []"); - System.out.println(" showpass []"); - System.out.println(" check []"); - System.out.println(" keypairgen "); - System.out.println(" config "); - System.out.println(" validate .props>"); + System.out.println(" create []"); + System.out.println(" read []"); + System.out.println(" update []"); + System.out.println(" delete []"); + System.out.println(" copy [,]*"); + System.out.println(" place []"); + System.out.println(" showpass []"); + System.out.println(" check []"); + System.out.println(" keypairgen "); + System.out.println(" config "); + System.out.println(" validate .props>"); + System.out.println(" connectivity .props>"); System.out.println(" --- Additional Tool Access ---"); System.out.println(" ** Type with no params for Tool Help"); System.out.println(" ** If using with Agent, preface with \"cadi\""); diff --git a/cadi/client/pom.xml b/cadi/client/pom.xml index b2ae7052..38bee291 100644 --- a/cadi/client/pom.xml +++ b/cadi/client/pom.xml @@ -22,7 +22,7 @@ org.onap.aaf.authz cadiparent - 2.1.14-SNAPSHOT + 2.1.15-SNAPSHOT .. diff --git a/cadi/core/pom.xml b/cadi/core/pom.xml index 9f1d8aeb..337262da 100644 --- a/cadi/core/pom.xml +++ b/cadi/core/pom.xml @@ -16,7 +16,7 @@ org.onap.aaf.authz cadiparent .. - 2.1.14-SNAPSHOT + 2.1.15-SNAPSHOT 4.0.0 diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java index 994e3250..26aa98cb 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java @@ -21,12 +21,14 @@ package org.onap.aaf.cadi; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.io.PrintWriter; +import java.io.StringBufferInputStream; import java.io.StringWriter; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -303,6 +305,11 @@ public class PropAccess implements Access { if (o!=null) { if(o.getClass().isArray()) { first = write(first,sb,(Object[])o); + } else if(o instanceof Throwable) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos); + ((Throwable)o).printStackTrace(ps); + sb.append(baos.toString()); } else { s=o.toString(); if (first) { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java index 48f5e2d1..b53b54da 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java @@ -976,6 +976,7 @@ public class Config { public static void add(Access access, final String tag, List> list) { String plugins = access.getProperty(tag, null); if(plugins!=null) { + access.log(Level.INIT, "Adding TAF Plugins: ", plugins); for(String tafs : Split.splitTrim(';', plugins)) { String[] pluginArray = Split.splitTrim(',', tafs); String clssn = null; @@ -1004,7 +1005,12 @@ public class Config { try { list.add(new Priori(cnst.newInstance(access),priority)); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - access.printf(Level.ERROR, "%s cannot be constructed with Access.\n",clssn); + String hostname = access.getProperty(Config.HOSTNAME,null); + if(hostname==null) { + access.printf(Level.ERROR, "%s cannot be constructed on this machine. Set valid 'hostname' in your properties\n",clssn); + } else { + access.printf(Level.ERROR, "%s cannot be constructed on %s with Access.\n",clssn, hostname); + } } } catch (NoSuchMethodException | SecurityException e) { access.printf(Level.ERROR, "%s needs a Constructor taking Access as sole param.\n",clssn); diff --git a/cadi/oauth-enduser/pom.xml b/cadi/oauth-enduser/pom.xml index f4253bd6..14d3f77e 100644 --- a/cadi/oauth-enduser/pom.xml +++ b/cadi/oauth-enduser/pom.xml @@ -25,7 +25,7 @@ org.onap.aaf.authz cadiparent - 2.1.14-SNAPSHOT + 2.1.15-SNAPSHOT .. diff --git a/cadi/pom.xml b/cadi/pom.xml index 87d1ca75..fa1dd0f1 100644 --- a/cadi/pom.xml +++ b/cadi/pom.xml @@ -24,7 +24,7 @@ org.onap.aaf.authz parent - 2.1.14-SNAPSHOT + 2.1.15-SNAPSHOT cadiparent AAF CADI Parent (Code, Access, Data, Identity) diff --git a/cadi/servlet-sample/pom.xml b/cadi/servlet-sample/pom.xml index f46d197f..1533ad91 100644 --- a/cadi/servlet-sample/pom.xml +++ b/cadi/servlet-sample/pom.xml @@ -4,7 +4,7 @@ org.onap.aaf.authz cadiparent .. - 2.1.14-SNAPSHOT + 2.1.15-SNAPSHOT 4.0.0 CADI Servlet Sample (Test Only) -- cgit 1.2.3-korg