492791861be10d10553b634f4e891d0269ae893c
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / hs / HandleRepositoryFactory.java
1 import javax.servlet.http.*;
2 import edu.internet2.middleware.shibboleth.*;
3 import edu.internet2.middleware.shibboleth.common.*;
4
5 /**
6  *  Used by Shibboleth Handle Service and Attribute Authority to build a repository object
7  */
8 public abstract class HandleRepositoryFactory
9 {
10     /**  Array of policy URI(s) (HS and SHIRE) */
11     protected String[] policies;
12
13     public HandleRepositoryFactory()
14     {
15     }
16
17     public static HandleRepositoryFactory getInstance(String policy, 
18                                                       HttpServlet HS)
19         throws HandleException {
20
21         if(policy.equalsIgnoreCase( Constants.POLICY_CLUBSHIB )){
22             return new ClubShibSQLHandleRepository(HS);
23         }else{
24             throw new HandleException("Unsupported policy found.");
25         }
26     }
27
28     public abstract HandleEntry getHandleEntry(String handle)
29         throws HandleException;
30
31     public abstract  void insertHandleEntry(HandleEntry he)
32         throws HandleException;
33     
34     public abstract String toHTMLString()
35         throws HandleException;
36
37 }
38