Merge "Sonar Fix: NotifyApprovals.java"
[aaf/authz.git] / auth / auth-batch / src / main / java / org / onap / aaf / auth / batch / Batch.java
index d49f4fa..1c65c05 100644 (file)
@@ -90,6 +90,7 @@ public abstract class Batch {
     public static final String GUI_URL="GUI_URL";
     
     protected final Organization org;
+       protected String version;
     
     protected Batch(AuthzEnv env) throws APIException, IOException, OrganizationException {
         if (batchEnv != null) {
@@ -122,6 +123,9 @@ public abstract class Batch {
         }
 
         org = OrganizationFactory.init(env);
+        if(org==null) {
+               throw new OrganizationException("Organization MUST be defined for Batch");
+        }
         org.setTestMode(dryRun);
 
         // Special names to allow behaviors beyond normal rules
@@ -140,6 +144,8 @@ public abstract class Batch {
                 }
             }
         }
+        
+        version = env.getProperty(VERSION,Config.AAF_DEFAULT_API_VERSION);
     }
 
     protected abstract void run(AuthzTrans trans);