Updated ArpUtil to work with new ArpRepository interface.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 10 Oct 2002 19:29:22 +0000 (19:29 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 10 Oct 2002 19:29:22 +0000 (19:29 +0000)
Additional logging.

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@315 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/FileArpRepository.java
src/edu/internet2/middleware/shibboleth/aa/arpUtil/ArpUtil.java

index 249ee3f..1fd2933 100755 (executable)
@@ -102,6 +102,7 @@ public class FileArpRepository implements ArpRepository {
                        
                        File arpFile = new File(fileName);
                        if (!arpFile.exists()) {
+                               log.info("No ARP matching (" + arpName + ") exists in the ARP Repository.");
                                return null;    
                        }
 
@@ -113,7 +114,7 @@ public class FileArpRepository implements ArpRepository {
                        }
                        arp.setNew(false);
                        arp.setLastRead(new Date());
-                       log.info("AA: Found and using ARP " + arpName);
+                       log.info("Found ARP (" + arpName + ").");
                        return arp;
                } catch (FileNotFoundException fnfe) {
                        log.error("Unable to read ARP storage: " + fnfe.getMessage());
index 0decc05..feaa9f5 100755 (executable)
@@ -58,6 +58,7 @@ package edu.internet2.middleware.shibboleth.aa.arpUtil;
  */
 
 import java.security.Principal;
+import java.util.Date;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Properties;
@@ -248,11 +249,13 @@ class ArpUtil{
            isAdmin = true;
            i++;
        }
+       
        sharName = args[i++];
        if(args[i].equalsIgnoreCase("-default")){
            isDefault = true;
            i++;
        }
+       
        if(i < args.length)
            resourceName = args[i++];
 
@@ -290,10 +293,25 @@ class ArpUtil{
            System.out.println("-admin must be specified for -default or -exclude");
            return;
        }
-          
+         
+       log.debug("Admin arp?: " + isAdmin);
+       log.debug("Default arp?: " + isDefault);
+       log.debug("Resource name: " + resourceName);
+       log.debug("SHAR name: " + sharName);
+       log.debug("Attribute name: " + attrName);
+       
 
        try{
            Arp arp = arpFactory.lookupArp(arpName, isAdmin);
+           if (arp == null) {
+               arp = new Arp(arpName, isAdmin);
+                       arp.setNew(true);
+                       arp.setLastRead(new Date());
+                       log.info("Creating new ARP.");
+           } else {
+               log.info("Editing existing ARP.");
+           }
+           
            ArpShar s = arp.getShar(sharName);
 
            if(s == null)