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