Initial Version
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / aaLocal / attributes / eduPersonAffiliation.java
1 import edu.internet2.middleware.eduPerson.*;
2 import edu.internet2.middleware.shibboleth.Constants; 
3 import org.opensaml.*;
4
5 public class eduPersonAffiliation extends ScopedAttribute{
6     
7
8     public eduPersonAffiliation(String[] scopes, Object[] values)
9         throws SAMLException{
10
11         this.super("urn:mace:eduPerson:1.0:eduPersonAffiliation",
12                    Constants.SHIB_ATTRIBUTE_NAMESPACE_URI, 
13                    new QName("urn:mace:eduPerson:1.0",
14                              "eduPersonAffiliationType"),
15                    10*60,
16                    values,
17                    scopes[0],
18                    scopes);
19
20      for(int i=0; i<super.values.length; i++){
21         String val = (String)super.values[i];
22         if(val.equalsIgnoreCase("faculty") ||
23            val.equalsIgnoreCase("student") ||
24            val.equalsIgnoreCase("staff") ||
25            val.equalsIgnoreCase("alum") ||
26            val.equalsIgnoreCase("member") ||
27            val.equalsIgnoreCase("affiliate") ||
28            val.equalsIgnoreCase("employee") )
29             super.values[i] = val.toLowerCase();
30         else
31             super.values[i] = "member";
32      }
33
34     }
35 }
36