changed to unmaintained
[aaf/authz.git] / auth / auth-deforg / src / main / java / org / onap / aaf / org / DefaultOrg.java
index 70b3324..c7f3b1c 100644 (file)
@@ -41,6 +41,7 @@ import org.onap.aaf.auth.org.OrganizationException;
 import org.onap.aaf.cadi.config.Config;
 import org.onap.aaf.cadi.util.FQI;
 import org.onap.aaf.misc.env.Env;
+import org.onap.aaf.org.Identities.Data;
 
 public class DefaultOrg implements Organization {
     private static final String AAF_DATA_DIR = "aaf_data_dir";
@@ -67,13 +68,12 @@ public class DefaultOrg implements Organization {
         root_ns = env.getProperty(Config.AAF_ROOT_NS,Config.AAF_ROOT_NS_DEF);
 
         try {
-            String defFile;
-            String temp=env.getProperty(defFile = (getClass().getName()+".file"));
+            String temp=env.getProperty(realm +".file");
             File fIdentities=null;
             if (temp==null) {
                 temp = env.getProperty(AAF_DATA_DIR);
                 if (temp!=null) {
-                    env.warn().log(defFile, " is not defined. Using default: ",temp+"/identities.dat");
+                    env.warn().log("Datafile for " + realm + " is not defined. Using default: ",temp+"/identities.dat");
                     File dir = new File(temp);
                     fIdentities=new File(dir,"identities.dat");
 
@@ -172,7 +172,7 @@ public class DefaultOrg implements Organization {
      * If the ID isn't in the revoked file, if it exists, it is revoked.
      */
     @Override
-    public boolean isRevoked(AuthzTrans trans, String key) {
+    public Date isRevoked(AuthzTrans trans, String key) {
         if(revoked!=null) {
             try {
                 revoked.open(trans, DefaultOrgIdentity.TIMEOUT);
@@ -185,7 +185,8 @@ public class DefaultOrg implements Organization {
                     } else {
                         search = key;
                     }
-                    return revoked.find(search, r)!=null;
+                    Data revokedData = revoked.find(search, r);
+                    return revokedData==null?null:new Date();
                 } finally {
                     revoked.close(trans);
                 }
@@ -193,7 +194,7 @@ public class DefaultOrg implements Organization {
                 trans.error().log(e);
             }
         }
-        return false;
+        return null;
     }
 
     /* (non-Javadoc)
@@ -515,6 +516,10 @@ public class DefaultOrg implements Organization {
                 now.add(GregorianCalendar.MONTH, 6);
                 rv = now;
                 break;
+            case RevokedGracePeriodEnds:
+               now.add(GregorianCalendar.DATE, 3);
+               rv = now;
+               break;
             default:
                 // Unless other wise set, 6 months is default
                 now.add(GregorianCalendar.MONTH, 6);
@@ -700,4 +705,9 @@ public class DefaultOrg implements Organization {
             return 0;
         }
     }
+
+    @Override
+    public boolean isUserExpireExempt(String user, Date expires) {
+        return false;
+    }
 }