Added proper package names so that AA will compile under eclipse.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 16 Sep 2002 17:35:29 +0000 (17:35 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 16 Sep 2002 17:35:29 +0000 (17:35 +0000)
Tweaked logging output.

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

src/edu/internet2/middleware/shibboleth/aa/AAResponder.java
src/edu/internet2/middleware/shibboleth/aa/AAServlet.java

index 5dc21ec..041a180 100755 (executable)
@@ -208,14 +208,14 @@ public class AAResponder{
        if(shar == null)
            throw new AAException("No default SHAR.");
 
-       log.info("\t using shar: "+shar+(usingDefault?"(default)":""));
-       log.info("\t using url: "+url);
+       log.debug("\t using shar: "+shar+(usingDefault?"(default)":""));
+       log.debug("\t using url: "+url);
 
        if(url == null || url.length() == 0)
            throw new AAException("Given url to AA is null or blank");
 
        ArpResource resource = shar.bestFit(url);
-       log.info("\t\t best fit is: "+resource);
+       log.debug("\t\t best fit is: "+resource);
        if(resource == null){
            if(usingDefault)
                return new HashSet(); // empty set
@@ -275,27 +275,30 @@ public class AAResponder{
        return null;
     }
     
-    private SAMLAttribute jndi2saml(Attribute jAttr)
-       throws NamingException, AAException{
+       private SAMLAttribute jndi2saml(Attribute jAttr) throws NamingException, AAException {
 
-       if(jAttr == null)
-           return null;
-           
-       String id = jAttr.getID();
-       Vector vals = new Vector();
+               if (jAttr == null) {
+                       return null;
+               }
 
-       NamingEnumeration ne = jAttr.getAll();
-       while(ne.hasMore())
-           vals.add(ne.next());
+               log.debug("Converting Attribute (" + jAttr.getID() + ") to SAML.");
+               Vector vals = new Vector();
 
-       try{
-           Class attrClass = Class.forName(id);
-           log.info("Got the class for "+attrClass);
-           ShibAttribute sa = (ShibAttribute)attrClass.newInstance();
-           return sa.toSamlAttribute(this.domain, vals.toArray());
-       }catch(Exception e){
-           throw new AAException("Failed to read the class for attribute "+id+" :"+e);
-       }
+               NamingEnumeration ne = jAttr.getAll();
 
-    }
+               while (ne.hasMore()) {
+                       vals.add(ne.next());
+               }
+
+               try {
+                       Class attrClass = Class.forName("edu.internet2.middleware.shibboleth.aaLocal.attributes." + jAttr.getID());
+                       log.debug("Loaded the class for " + attrClass);
+                       ShibAttribute sa = (ShibAttribute) attrClass.newInstance();
+                       return sa.toSamlAttribute(this.domain, vals.toArray());
+               } catch (Exception e) {
+                       log.error("Failed to load the class for attribute (" + jAttr.getID() + ") :" + e);
+                       throw new AAException("Failed to load the class for attribute (" + jAttr.getID() + ") :" + e);
+               }
+
+       }
 }
index e5a9aca..4855760 100755 (executable)
@@ -141,6 +141,8 @@ public class AAServlet extends HttpServlet {
 
     public void doPost(HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException {
+               
+       log.info("Recieved a request.");
 
        SAMLAttribute[] attrs = null;
        SAMLException ourSE = null;
@@ -150,7 +152,6 @@ public class AAServlet extends HttpServlet {
        try{
            saml = new AASaml(myName);
            saml.receive(req);
-           log.info("AA received a query");
            String resource = saml.getResource();
            String handle = saml.getHandle();
            String shar = saml.getShar();