Class ApacheShiroSecurityConfiguration

java.lang.Object
org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
org.springframework.data.gemfire.config.annotation.ApacheShiroSecurityConfiguration
All Implemented Interfaces:
Aware, BeanClassLoaderAware, BeanFactoryAware, EnvironmentAware

The ApacheShiroSecurityConfiguration class is a Spring @Configuration component responsible for configuring and initializing the Apache Shiro security framework in order to secure Apache Geode administrative and data access operations.
Since:
1.9.0
Author:
John Blum
See Also:
  • Constructor Details

    • ApacheShiroSecurityConfiguration

      public ApacheShiroSecurityConfiguration()
  • Method Details

    • getAnnotationType

      protected Class<? extends Annotation> getAnnotationType()
      Returns the EnableSecurity Annotation Class type.
      Specified by:
      getAnnotationType in class AbstractAnnotationConfigSupport
      Returns:
      the EnableSecurity Annotation Class type.
      See Also:
    • setBeanFactory

      public void setBeanFactory(BeanFactory beanFactory) throws BeansException
      Sets a reference to the Spring BeanFactory.
      Specified by:
      setBeanFactory in interface BeanFactoryAware
      Overrides:
      setBeanFactory in class AbstractAnnotationConfigSupport
      Parameters:
      beanFactory - reference to the Spring BeanFactory.
      Throws:
      IllegalArgumentException - if the Spring BeanFactory is not an instance of ListableBeanFactory.
      BeansException
      See Also:
    • getListableBeanFactory

      protected ListableBeanFactory getListableBeanFactory()
      Returns a reference to the Spring BeanFactory.
      Returns:
      a reference to the Spring BeanFactory.
      Throws:
      IllegalStateException - if the Spring BeanFactory was not set.
      See Also:
    • shiroGemFireBeanFactoryPostProcessor

      @Bean public BeanFactoryPostProcessor shiroGemFireBeanFactoryPostProcessor()
    • shiroLifecycleBeanPostProcessor

      @Bean public BeanPostProcessor shiroLifecycleBeanPostProcessor()
      Bean definition to define, configure and register an Apache Shiro Spring LifecycleBeanPostProcessor to automatically call lifecycle callback methods on Shiro security components during Spring container initialization and destruction phases.
      Returns:
      an instance of the Apache Shiro Spring LifecycleBeanPostProcessor to handle the lifecycle of Apache Shiro security framework components.
      See Also:
      • LifecycleBeanPostProcessor
    • shiroSecurityManager

      @Bean public org.apache.shiro.mgt.SecurityManager shiroSecurityManager()
      Bean definition to define, configure and register an Apache Shiro SecurityManager implementation to secure Apache Geode. The registration of this Bean definition is dependent upon whether the user is using Apache Shiro to secure Apache Geode, which is determined by the presence of Apache Shiro Realms declared in the Spring ApplicationContext. This Bean definition declares a dependency on the Apache Geode GemFireCache instance in order to ensure the Geode cache is created and initialized first. This ensures that any internal Geode security configuration logic is evaluated and processed before SDG attempts to configure Apache Shiro as Apache Geode's security provider. Additionally, this Bean definition will register the Apache Shiro SecurityManager with the Apache Shiro security framework Finally, this method proceeds to enable Apache Geode security.
      Returns:
      an Apache Shiro SecurityManager implementation used to secure Apache Geode.
      Throws:
      IllegalStateException - if an Apache Shiro SecurityManager was registered with the Apache Shiro security framework but Apache Geode security could not be enabled.
      See Also:
    • resolveRealms

      protected List<org.apache.shiro.realm.Realm> resolveRealms()
      Resolves all the Apache Shiro Realms declared and configured as Spring managed beans in the Spring ApplicationContext. This method will order the Realms according to priority order to ensure that the Apache Shiro Realms are applied in the correct sequence, as declared/configured.
      Returns:
      a List of all Apache Shiro Realms declared and configured as Spring managed beans in the Spring ApplicationContext.
      See Also:
    • registerSecurityManager

      protected org.apache.shiro.mgt.SecurityManager registerSecurityManager(org.apache.shiro.mgt.SecurityManager securityManager)
      Registers the given Apache Shiro SecurityManager with the Apache Shiro security framework.
      Parameters:
      securityManager - SecurityManager to register.
      Returns:
      the given SecurityManager reference.
      Throws:
      IllegalArgumentException - if SecurityManager is null.
      See Also:
      • SecurityUtils.setSecurityManager(org.apache.shiro.mgt.SecurityManager)
      • SecurityManager