Class PubServerSecuredInterceptor

  • All Implemented Interfaces:
    java.io.Serializable

    @Interceptor
    public class PubServerSecuredInterceptor
    extends java.lang.Object
    implements java.io.Serializable
    Interceptor annotation for getting authorization checks done, when filter settings in web.xml or ejb-jar.xml won't work.

    Use it to annotate a class like this:

     @Interceptors(PubServerSecuredInterceptor.class)
     public class MyWebService() {...}
     
    Alternatively the interceptor can be wrapped around classes via configuration in either ejb-jar.xml or web.xml. See the SDK documentation for an example.

    If an annotated method or any method in an annotated class gets invoked, this interceptor will check for each of the @RequiredGuest etc. The annotations can decorate either the method itself or the class. If an annotation was found, the interceptor will evaluate if the user (subject) is allowed to step into the method. If not, an AuthorizationException will be thrown and the method will not be executed.

    More than one of the annotations are allowed: In the example below for restricting to "admins, that can burn down houses" ;-).

     @RequiredRoles("admin")
     @RequiredPermissions("burningdownthehouse")
     public void doSomething() {...}
     
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object interceptShiroSecurity​(javax.interceptor.InvocationContext context)
      Intercept shiro security object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PubServerSecuredInterceptor

        public PubServerSecuredInterceptor()
    • Method Detail

      • interceptShiroSecurity

        public java.lang.Object interceptShiroSecurity​(javax.interceptor.InvocationContext context)
                                                throws java.lang.Exception
        Intercept shiro security object. It checks if user is authenticated and has permissions to perform a call.
        Parameters:
        context - InvocationContext
        Returns:
        returnValue of the method - if any
        Throws:
        java.lang.Exception - bubbles any exception