Merge "Sonar cleanup for PolicyEngineUtils"
[policy/engine.git] / PolicyEngineUtils / src / main / java / org / onap / policy / utils / AAFPolicyClientImpl.java
index 0f48760..9d5222a 100644 (file)
@@ -65,9 +65,6 @@ public class AAFPolicyClientImpl implements AAFPolicyClient{
        private static Access access = null;
 
        private AAFPolicyClientImpl(Properties properties) throws AAFPolicyException{
-               if(instance == null){
-                       instance = this;
-               }
                setup(properties);
        }
 
@@ -93,7 +90,6 @@ public class AAFPolicyClientImpl implements AAFPolicyClient{
                        props.setProperty("AFT_LATITUDE", properties.getProperty("AFT_LATITUDE", DEFAULT_AFT_LATITUDE));
                        props.setProperty("AFT_LONGITUDE", properties.getProperty("AFT_LONGITUDE", DEFAULT_AFT_LONGITUDE));
                        String aftEnv = TEST_AFT_ENVIRONMENT;
-                       //props.setProperty(Config.CADI_KEYFILE,"keyfile");
                        props.setProperty("aaf_id",properties.getProperty("aaf_id", "aafID"));
                        props.setProperty("aaf_password", properties.getProperty("aaf_password", "aafPass"));
                        if(properties.containsKey(Config.AAF_URL)){
@@ -127,6 +123,7 @@ public class AAFPolicyClientImpl implements AAFPolicyClient{
         * @param properties  Properties with CLIENT_ID, CLIENT_KEY and ENVIRONMENT
         * @throws AAFPolicyException exceptions if any.
         */
+       @Override
        public void updateProperties(Properties properties) throws AAFPolicyException{
                setup(properties);
        }
@@ -141,6 +138,7 @@ public class AAFPolicyClientImpl implements AAFPolicyClient{
         * @param action Permissions Action. 
         * @return
         */
+       @Override
        public boolean checkAuthPerm(String mechID, String pass, String type, String instance, String action){
                return checkAuth(mechID, pass) && checkPerm(mechID, pass, type, instance, action);
        }
@@ -152,6 +150,7 @@ public class AAFPolicyClientImpl implements AAFPolicyClient{
         * @param pass Password.
         * @return True or False. 
         */
+       @Override
        public boolean checkAuth(String userName, String pass){
                if(aafAuthn!=null){
                        try {
@@ -180,6 +179,7 @@ public class AAFPolicyClientImpl implements AAFPolicyClient{
         * @param action Permissions Action. 
         * @return True or False. 
         */
+       @Override
        public boolean checkPerm(String userName, String pass, String type, String instance, String action){
                int i =0;
                Boolean result= false;
@@ -203,8 +203,8 @@ public class AAFPolicyClientImpl implements AAFPolicyClient{
        private static boolean setUpAAF(){
                try {
                        aafCon = new AAFConDME2(access);
-                       aafLurPerm = aafCon.newLur();//new AAFLurPerm(aafCon);
-                       aafAuthn = aafCon.newAuthn(aafLurPerm);//new AAFAuthn(aafCon, aafLurPerm);
+                       aafLurPerm = aafCon.newLur();
+                       aafAuthn = aafCon.newAuthn(aafLurPerm);
                        return true;
                } catch (Exception e) {
                        logger.error("Error while setting up AAF Connection " + e.getMessage() + e);