Remove Code from cadi, it is now in authz
[aaf/cadi.git] / core / src / main / java / org / onap / aaf / cadi / config / Get.java
diff --git a/core/src/main/java/org/onap/aaf/cadi/config/Get.java b/core/src/main/java/org/onap/aaf/cadi/config/Get.java
deleted file mode 100644 (file)
index ea06c87..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************\r
- * ============LICENSE_START====================================================\r
- * * org.onap.aaf\r
- * * ===========================================================================\r
- * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
- * * ===========================================================================\r
- * * Licensed under the Apache License, Version 2.0 (the "License");\r
- * * you may not use this file except in compliance with the License.\r
- * * You may obtain a copy of the License at\r
- * * \r
- *  *      http://www.apache.org/licenses/LICENSE-2.0\r
- * * \r
- *  * Unless required by applicable law or agreed to in writing, software\r
- * * distributed under the License is distributed on an "AS IS" BASIS,\r
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * * See the License for the specific language governing permissions and\r
- * * limitations under the License.\r
- * * ============LICENSE_END====================================================\r
- * *\r
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
- * *\r
- ******************************************************************************/\r
-package org.onap.aaf.cadi.config;\r
-\r
-import java.lang.reflect.Method;\r
-\r
-import org.onap.aaf.cadi.Access;\r
-import org.onap.aaf.cadi.Access.Level;\r
-\r
-public interface Get {\r
-       public String get(String name, String def, boolean print);\r
-       \r
-       \r
-       /**\r
-        * A class for Getting info out of "JavaBean" format\r
-        *\r
-        */\r
-       public static class Bean implements Get {\r
-               private Object bean;\r
-               private Class<?> bc;\r
-               private Class<?>[] params;\r
-               private Object[] args;\r
-               \r
-               public Bean(Object bean) {\r
-                       this.bean = bean;\r
-                       bc = bean.getClass();\r
-                       params = new Class<?>[0]; // note, this will allow to go out of scope after config\r
-                       args = new Object[0];\r
-               }\r
-               \r
-               public String get(String name, String def, boolean print) {\r
-                       String str = null;\r
-                       String gname = "get"+Character.toUpperCase(name.charAt(0))+name.substring(1);\r
-                       try {\r
-                               Method meth = bc.getMethod(gname, params);\r
-                               Object obj = meth.invoke(bean, args);\r
-                               str = obj==null?null:obj.toString(); // easy string convert... \r
-                       } catch (Exception e) {\r
-                       }\r
-                       \r
-                       // Take def if nothing else\r
-                       if(str==null) {\r
-                               str = def;\r
-                               // don't log defaults\r
-                       } else {\r
-                               str = str.trim(); // this is vital in Property File based values, as spaces can hide easily\r
-                       }\r
-                       // Note: Can't log during configuration\r
-                       return str;\r
-               }\r
-       }\r
-\r
-       public static Get NULL = new Get() {\r
-               public String get(String name, String def, boolean print) {\r
-                       return def;\r
-               }\r
-       };\r
-\r
-       public static class AccessGet implements Get {\r
-               private Access access;\r
-               public AccessGet(Access access) {\r
-                       this.access = access;\r
-               }\r
-               public String get(String name, String def, boolean print) {\r
-                       String gotten = access.getProperty(name, def);\r
-                       if(print) {\r
-                               if(gotten == null) {\r
-                                       access.log(Level.INIT,name, "is not set");\r
-                               } else {\r
-                                       access.log(Level.INIT,name, "is set to", gotten);\r
-                               }\r
-                       }\r
-                       return gotten;\r
-               }\r
-       }\r
-\r
-}\r