org.gcube.common.core.utils.proxies
Class AccessControlProxyContext

java.lang.Object
  extended by org.gcube.common.core.utils.proxies.GCUBEProxyContext<AccessControlProxyContext.Restricted>
      extended by org.gcube.common.core.utils.proxies.AccessControlProxyContext

public class AccessControlProxyContext
extends GCUBEProxyContext<AccessControlProxyContext.Restricted>

A specialisation of GCUBEProxyContext for proxies which prevent altogether untrusted access to selected methods of the proxied objects. Access control is dynamically established by comparing the namespace of the caller code (in the presence of inheritance, not necessarily the caller's) with one or more namespaces of trusted code. The latter are specified as the values of annotations of the primary annotation class Restricted.

Author:
Fabio Simeoni (University of Strathclyde)

Nested Class Summary
static interface AccessControlProxyContext.Restricted
          The primary annotation of the proxy associated with the context.
 
Constructor Summary
AccessControlProxyContext()
           
 
Method Summary
 Class<AccessControlProxyContext.Restricted> getAnnotationClass()
          Returns the class of the primary annotation.
 net.sf.cglib.proxy.MethodInterceptor getInterceptor(Object proxied)
          Returns the object which will intercept calls to the proxy.
static void validateCall()
          A facility for enforcing access control in the absence of a dedicated proxy.
 
Methods inherited from class org.gcube.common.core.utils.proxies.GCUBEProxyContext
getAnnotation, getProxyCaller, setAnnotation, setCaller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessControlProxyContext

public AccessControlProxyContext()
Method Detail

getInterceptor

public net.sf.cglib.proxy.MethodInterceptor getInterceptor(Object proxied)
Returns the object which will intercept calls to the proxy.

Specified by:
getInterceptor in class GCUBEProxyContext<AccessControlProxyContext.Restricted>
Parameters:
proxied - the proxied object.
Returns:
the intercepting object.

getAnnotationClass

public Class<AccessControlProxyContext.Restricted> getAnnotationClass()
Returns the class of the primary annotation.

Specified by:
getAnnotationClass in class GCUBEProxyContext<AccessControlProxyContext.Restricted>
Returns:
the annotation class.

validateCall

public static void validateCall()
A facility for enforcing access control in the absence of a dedicated proxy. Called explicitly from within a client method, it uses the Restricted annotation to verify that the caller of the client is trusted for that method. It does nothing if the method has no Restricted annotation.



Copyright © 2012. All Rights Reserved.