whoops, forgot a file
authorblk <blk@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 14 Jun 2002 19:37:47 +0000 (19:37 +0000)
committerblk <blk@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 14 Jun 2002 19:37:47 +0000 (19:37 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@123 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/hs/ClubShibInMemoryHandleRepository.java [new file with mode: 0755]

diff --git a/src/edu/internet2/middleware/shibboleth/hs/ClubShibInMemoryHandleRepository.java b/src/edu/internet2/middleware/shibboleth/hs/ClubShibInMemoryHandleRepository.java
new file mode 100755 (executable)
index 0000000..52c8e3e
--- /dev/null
@@ -0,0 +1,57 @@
+package edu.internet2.middleware.shibboleth.hs;
+
+import java.util.*;
+import javax.servlet.http.*;
+
+public class ClubShibInMemoryHandleRepository extends HandleRepositoryFactory{
+
+    final static String db = "HandleService";
+    Hashtable handleHash; 
+
+    public ClubShibInMemoryHandleRepository(HttpServlet HS) 
+       throws HandleException 
+    {
+       handleHash = new Hashtable();
+    }
+
+
+    public HandleEntry getHandleEntry( String handle )
+       throws HandleException
+    {
+       HandleEntry he = null;
+
+       if (handle == null){
+           throw new HandleException(HandleException.ERR, "ClubShibInMemoryHandleRepository().getHandleEntry requires handle");
+       }
+           
+       he = (HandleEntry)handleHash.get( handle );
+
+       if ( he == null ) 
+           throw new HandleException("getHandleEntry() cannot find matching record for handle: "+handle);
+       else
+           return he;
+    }
+    
+
+    public void insertHandleEntry( HandleEntry he )
+       throws HandleException
+    {
+       if ( he == null ) { 
+           throw new HandleException(HandleException.ERR, "InsertHandle() requires HandleEntry arg");
+       }
+
+       String handle = he.getHandle();
+
+       handleHash.put( handle, he );
+
+    }
+
+    public String toHTMLString() 
+       throws HandleException
+    {
+       String HTMLString = new String();
+       
+       return HTMLString;
+    }
+       
+}