Enable Organizations to have a subset of users the user roles of which do not expire
[aaf/authz.git] / auth / auth-core / src / main / java / org / onap / aaf / auth / org / Organization.java
index 7309309..795231e 100644 (file)
@@ -124,7 +124,7 @@ public interface Organization {
      * feed with a "Deleted ID" feed.
      *
      */
-    public boolean isRevoked(AuthzTrans trans, String id);
+    public Date isRevoked(AuthzTrans trans, String id);
 
 
     /**
@@ -214,7 +214,8 @@ public interface Organization {
         Future,
         UserInRole,
         UserDelegate,
-        ExtendPassword
+        ExtendPassword,
+        RevokedGracePeriodEnds
     }
 
     public enum Policy {
@@ -347,6 +348,16 @@ public interface Organization {
 
     public void setTestMode(boolean dryRun);
 
+    /**
+     * Evaluates a user to determine if they are exempt from role expiration.
+     * Returns true if true, false is false. Default implementation is always false.
+     *
+     * @param user
+     * @param expires
+     * @return
+     */
+    public boolean isUserExpireExempt(String user, Date expires);
+
     public static final Organization NULL = new Organization()
     {
         private final GregorianCalendar gc = new GregorianCalendar(1900, 1, 1);
@@ -574,9 +585,9 @@ public interface Organization {
         }
 
         @Override
-        public boolean isRevoked(AuthzTrans trans, String id) {
+        public Date isRevoked(AuthzTrans trans, String id) {
             // provide a corresponding feed that indicates that an ID has been intentionally removed from identities.dat table.
-            return false;
+            return null;
         }
 
         @Override
@@ -585,6 +596,11 @@ public interface Organization {
             return null;
         }
 
+        @Override
+        public boolean isUserExpireExempt(String user, Date expires) {
+            return false;
+        }
+
     };
 }