/** * Convenience method that simplifies retrieval of a thread-bound Subject. If there is no * Subject bound to the thread, this method returns <tt>null</tt>. It is merely a convenient wrapper * for the following: * <p/> * <code>return (Subject)get( SUBJECT_KEY );</code> * <p/> * This method only returns the bound value if it exists - it does not remove it * from the thread. To remove it, one must call {@link #unbindSubject() unbindSubject()} instead. * * @return the Subject object bound to the thread, or <tt>null</tt> if there isn't one bound. * @since 0.2 */ public static Subject getSubject() { return (Subject) get(SUBJECT_KEY); }
/** * Convenience method that simplifies retrieval of the application's SecurityManager instance from the current * thread. If there is no SecurityManager bound to the thread (probably because framework code did not bind it * to the thread), this method returns <tt>null</tt>. * <p/> * It is merely a convenient wrapper for the following: * <p/> * <code>return (SecurityManager)get( SECURITY_MANAGER_KEY );</code> * <p/> * This method only returns the bound value if it exists - it does not remove it * from the thread. To remove it, one must call {@link #unbindSecurityManager() unbindSecurityManager()} instead. * * @return the Subject object bound to the thread, or <tt>null</tt> if there isn't one bound. * @since 0.9 */ public static SecurityManager getSecurityManager() { return (SecurityManager) get(SECURITY_MANAGER_KEY); }
public static boolean isSessionCreationRequested() { return Boolean.TRUE.equals(ThreadContext.get(AUTO_CREATE_SESSION_KEY)); }
final MultivaluedMap<String, String> requestHeaders = (MultivaluedMap<String, String>) ThreadContext.get( ShiroSecurityContextFilter.REQUEST_HEADERS);
/** * Convenience method that simplifies retrieval of a thread-bound Subject. If there is no * Subject bound to the thread, this method returns <tt>null</tt>. It is merely a convenient wrapper * for the following: * <p/> * <code>return (Subject)get( SUBJECT_KEY );</code> * <p/> * This method only returns the bound value if it exists - it does not remove it * from the thread. To remove it, one must call {@link #unbindSubject() unbindSubject()} instead. * * @return the Subject object bound to the thread, or <tt>null</tt> if there isn't one bound. * @since 0.2 */ public static Subject getSubject() { return (Subject) get(SUBJECT_KEY); }
/** * Convenience method that simplifies retrieval of the application's SecurityManager instance from the current * thread. If there is no SecurityManager bound to the thread (probably because framework code did not bind it * to the thread), this method returns <tt>null</tt>. * <p/> * It is merely a convenient wrapper for the following: * <p/> * <code>return (SecurityManager)get( SECURITY_MANAGER_KEY );</code> * <p/> * This method only returns the bound value if it exists - it does not remove it * from the thread. To remove it, one must call {@link #unbindSecurityManager() unbindSecurityManager()} instead. * * @return the Subject object bound to the thread, or <tt>null</tt> if there isn't one bound. * @since 0.9 */ public static SecurityManager getSecurityManager() { return (SecurityManager) get(SECURITY_MANAGER_KEY); }
public static boolean isInAuthenticationEvent() { return ThreadContext.get(OctopusAuthenticationListener.IN_AUTHENTICATION_EVENT_FLAG) instanceof OctopusAuthenticationListener.InAuthenticationEvent; }
public static boolean isInAuthentication() { return ThreadContext.get(OctopusRealm.IN_AUTHENTICATION_FLAG) instanceof OctopusRealm.InAuthentication; }
/** * Convenience method that simplifies retrieval of a thread-bound Subject. If there is no * Subject bound to the thread, this method returns <tt>null</tt>. It is merely a convenient wrapper * for the following: * <p/> * <code>return (Subject)get( SUBJECT_KEY );</code> * <p/> * This method only returns the bound value if it exists - it does not remove it * from the thread. To remove it, one must call {@link #unbindSubject() unbindSubject()} instead. * * @return the Subject object bound to the thread, or <tt>null</tt> if there isn't one bound. * @since 0.2 */ public static Subject getSubject() { return (Subject) get(SUBJECT_KEY); }
/** * Convenience method that simplifies retrieval of the application's SecurityManager instance from the current * thread. If there is no SecurityManager bound to the thread (probably because framework code did not bind it * to the thread), this method returns <tt>null</tt>. * <p/> * It is merely a convenient wrapper for the following: * <p/> * <code>return (SecurityManager)get( SECURITY_MANAGER_KEY );</code> * <p/> * This method only returns the bound value if it exists - it does not remove it * from the thread. To remove it, one must call {@link #unbindSecurityManager() unbindSecurityManager()} instead. * * @return the Subject object bound to the thread, or <tt>null</tt> if there isn't one bound. * @since 0.9 */ public static SecurityManager getSecurityManager() { return (SecurityManager) get(SECURITY_MANAGER_KEY); }
public static boolean isSessionCreationRequested() { return Boolean.TRUE.equals(ThreadContext.get(AUTO_CREATE_SESSION_KEY)); }
final MultivaluedMap<String, String> requestHeaders = (MultivaluedMap<String, String>) ThreadContext.get( ShiroSecurityContextFilter.REQUEST_HEADERS);