whoops, forgot a file
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / hs / ClubShibInMemoryHandleRepository.java
1 package edu.internet2.middleware.shibboleth.hs;
2
3 import java.util.*;
4 import javax.servlet.http.*;
5
6 public class ClubShibInMemoryHandleRepository extends HandleRepositoryFactory{
7
8     final static String db = "HandleService";
9     Hashtable handleHash; 
10
11     public ClubShibInMemoryHandleRepository(HttpServlet HS) 
12         throws HandleException 
13     {
14         handleHash = new Hashtable();
15     }
16
17
18     public HandleEntry getHandleEntry( String handle )
19         throws HandleException
20     {
21         HandleEntry he = null;
22
23         if (handle == null){
24             throw new HandleException(HandleException.ERR, "ClubShibInMemoryHandleRepository().getHandleEntry requires handle");
25         }
26             
27         he = (HandleEntry)handleHash.get( handle );
28
29         if ( he == null ) 
30             throw new HandleException("getHandleEntry() cannot find matching record for handle: "+handle);
31         else
32             return he;
33     }
34     
35
36     public void insertHandleEntry( HandleEntry he )
37         throws HandleException
38     {
39         if ( he == null ) { 
40             throw new HandleException(HandleException.ERR, "InsertHandle() requires HandleEntry arg");
41         }
42
43         String handle = he.getHandle();
44
45         handleHash.put( handle, he );
46
47     }
48
49     public String toHTMLString() 
50         throws HandleException
51     {
52         String HTMLString = new String();
53         
54         return HTMLString;
55     }
56         
57 }