[jboss-cvs] JBossAS SVN: r63015 - in projects/security/security-spi/trunk/src/main/org/jboss/security: cache and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun May 13 12:33:55 EDT 2007


Author: anil.saldhana at jboss.com
Date: 2007-05-13 12:33:55 -0400 (Sun, 13 May 2007)
New Revision: 63015

Added:
   projects/security/security-spi/trunk/src/main/org/jboss/security/cache/
   projects/security/security-spi/trunk/src/main/org/jboss/security/cache/SecurityCache.java
   projects/security/security-spi/trunk/src/main/org/jboss/security/cache/SecurityCacheException.java
Log:
SECURITY-51: caching interface

Added: projects/security/security-spi/trunk/src/main/org/jboss/security/cache/SecurityCache.java
===================================================================
--- projects/security/security-spi/trunk/src/main/org/jboss/security/cache/SecurityCache.java	                        (rev 0)
+++ projects/security/security-spi/trunk/src/main/org/jboss/security/cache/SecurityCache.java	2007-05-13 16:33:55 UTC (rev 63015)
@@ -0,0 +1,70 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2007, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.security.cache;
+
+import java.util.Map;
+
+//$Id$
+
+/**
+ *  Generic Security Cache Interface for usage
+ *  by the security integration layers like authentication,
+ *  authorization etc.
+ *  
+ *  @author Anil.Saldhana at redhat.com
+ *  @since  May 13, 2007 
+ *  @version $Revision$
+ */
+public interface SecurityCache<T>
+{
+   /**
+    * Add a cache entry
+    * @param key
+    * @param contextMap a contextual map
+    * @throws SecurityCacheException
+    */
+   void addCacheEntry(T key, Map<String,Object> contextMap) throws SecurityCacheException;
+   
+   /**
+    * Cache Entry present?
+    * @param key Key for the cache entry
+    * @return true- cache entry exists, false-otherwise
+    */
+   boolean cacheHit(T key);
+   
+   /**
+    * Perform a cache operation
+    * @param key Key for the cache entry
+    * @param contextMap A contextual map
+    * @throws SecurityCacheException
+    */
+   void cacheOperation(T key, Map<String,Object> contextMap) throws SecurityCacheException; 
+   
+   /**
+    * Get Cache Entry
+    * @param <Y>
+    * @param T key
+    * @return Cache Entry
+    * @throws SecurityCacheException
+    */
+   <Y> Y get(T key) throws SecurityCacheException;
+}

Added: projects/security/security-spi/trunk/src/main/org/jboss/security/cache/SecurityCacheException.java
===================================================================
--- projects/security/security-spi/trunk/src/main/org/jboss/security/cache/SecurityCacheException.java	                        (rev 0)
+++ projects/security/security-spi/trunk/src/main/org/jboss/security/cache/SecurityCacheException.java	2007-05-13 16:33:55 UTC (rev 63015)
@@ -0,0 +1,56 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2007, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.security.cache;
+
+//$Id$
+
+/**
+ *  Security Cache Exception denoting
+ *  a cache operation failure
+ *  @author Anil.Saldhana at redhat.com
+ *  @since  May 13, 2007 
+ *  @version $Revision$
+ */
+public class SecurityCacheException extends Exception
+{ 
+   private static final long serialVersionUID = 1L;
+
+   public SecurityCacheException()
+   {
+      super(); 
+   }
+
+   public SecurityCacheException(String message, Throwable t)
+   {
+      super(message, t); 
+   }
+
+   public SecurityCacheException(String message)
+   {
+      super(message); 
+   }
+
+   public SecurityCacheException(Throwable t)
+   {
+      super(t); 
+   } 
+}




More information about the jboss-cvs-commits mailing list