Class SecurityManagerProxy
java.lang.Object
org.springframework.data.gemfire.support.DeclarableSupport
org.springframework.data.gemfire.support.WiringDeclarableSupport
org.springframework.data.gemfire.support.LazyWiringDeclarableSupport
org.springframework.geode.security.support.SecurityManagerProxy
- All Implemented Interfaces:
EventListener,org.apache.geode.cache.CacheCallback,org.apache.geode.cache.Declarable,org.apache.geode.security.SecurityManager,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
public class SecurityManagerProxy
extends org.springframework.data.gemfire.support.LazyWiringDeclarableSupport
implements org.apache.geode.security.SecurityManager, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.BeanFactoryAware
The
SecurityManagerProxy class is an Apache Geode SecurityManager
proxy implementation delegating to a backing SecurityManager implementation
which is registered as a managed bean in a Spring context.
The idea behind this SecurityManager is to enable users to be able to configure
and manage the SecurityManager as a Spring bean. However, Apache Geode require
the SecurityManager to be configured using a System property when launching
Apache Geode Servers with Gfsh, which makes it difficult to "manage" the SecurityManager instance.
Therefore, this implementation allows a developer to set the Apache Geode System property using this proxy...
gemfire.security-manager=org.springframework.geode.security.support.SecurityManagerProxy
And then declare and define a bean in the Spring context implementing the
SecurityManager interface...
Configuration
class MyApplicationConfiguration {
Bean
ExampleSecurityManager exampleSecurityManager(Environment environment) {
return new ExampleSecurityManager(environment);
}
...
}
- Since:
- 1.0.0
- See Also:
-
ResourcePermissionSecurityManagerBeanFactoryBeanFactoryAwareDisposableBeanAutowiredLazyWiringDeclarableSupport
-
Field Summary
Fields inherited from class org.springframework.data.gemfire.support.WiringDeclarableSupport
TEMPLATE_BEAN_NAME_PROPERTYFields inherited from interface org.apache.geode.security.SecurityManager
PASSWORD, TOKEN, USER_NAME -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance ofSecurityManagerProxy, which will delegate all Apache Geode security operations to a Spring managedSecurityManagerbean. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Properties properties) booleanvoidclose()voiddestroy()static SecurityManagerProxyReturns a reference to the singleSecurityManagerProxyinstance configured by Apache Geode in startup.protected org.apache.geode.security.SecurityManagerReturns a reference to the Apache GeodeSecurityManagerinstance delegated to by thisSecurityManagerProxy.voidinit(Properties props) protected org.springframework.beans.factory.BeanFactoryvoidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Configures a reference to the current SpringBeanFactory.voidsetSecurityManager(org.apache.geode.security.SecurityManager securityManager) Configures a reference to the Apache GeodeSecurityManagerinstance delegated to by thisSecurityManagerProxy.Methods inherited from class org.springframework.data.gemfire.support.LazyWiringDeclarableSupport
assertInitialized, assertUninitialized, doPostInit, initialize, isInitialized, isNotInitialized, nullSafeGetParameters, onApplicationEvent, setParametersMethods inherited from class org.springframework.data.gemfire.support.WiringDeclarableSupport
configureThis, configureThis, newBeanConfigurer, newBeanConfigurerMethods inherited from class org.springframework.data.gemfire.support.DeclarableSupport
getBeanFactory, getBeanFactoryKey, locateBeanFactory, setBeanFactoryKey
-
Constructor Details
-
SecurityManagerProxy
public SecurityManagerProxy()Constructs a new instance ofSecurityManagerProxy, which will delegate all Apache Geode security operations to a Spring managedSecurityManagerbean.
-
-
Method Details
-
getInstance
Returns a reference to the singleSecurityManagerProxyinstance configured by Apache Geode in startup.- Returns:
- a reference to the single
SecurityManagerProxyinstance.
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException Configures a reference to the current SpringBeanFactory.- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Parameters:
beanFactory- reference to the current SpringBeanFactory.- Throws:
org.springframework.beans.BeansException- if this operation fails to configure the reference to theBeanFactory.- See Also:
-
BeanFactory
-
setSecurityManager
@Autowired public void setSecurityManager(org.apache.geode.security.SecurityManager securityManager) Configures a reference to the Apache GeodeSecurityManagerinstance delegated to by thisSecurityManagerProxy.- Parameters:
securityManager- reference to the underlying Apache GeodeSecurityManagerinstance delegated to by thisSecurityManagerProxy.- Throws:
IllegalArgumentException- if theSecurityManagerreference is null.- See Also:
-
SecurityManager
-
getSecurityManager
protected org.apache.geode.security.SecurityManager getSecurityManager()Returns a reference to the Apache GeodeSecurityManagerinstance delegated to by thisSecurityManagerProxy.- Returns:
- a reference to the underlying
SecurityManagerinstance delegated to by thisSecurityManagerProxy. - Throws:
IllegalStateException- if the configuredSecurityManagerwas not properly configured.- See Also:
-
SecurityManager
-
authenticate
public Object authenticate(Properties properties) throws org.apache.geode.security.AuthenticationFailedException - Specified by:
authenticatein interfaceorg.apache.geode.security.SecurityManager- Throws:
org.apache.geode.security.AuthenticationFailedException
-
authorize
- Specified by:
authorizein interfaceorg.apache.geode.security.SecurityManager
-
close
public void close()- Specified by:
closein interfaceorg.apache.geode.cache.CacheCallback- Specified by:
closein interfaceorg.apache.geode.security.SecurityManager- Overrides:
closein classorg.springframework.data.gemfire.support.DeclarableSupport
-
destroy
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Overrides:
destroyin classorg.springframework.data.gemfire.support.LazyWiringDeclarableSupport- Throws:
Exception
-
init
- Specified by:
initin interfaceorg.apache.geode.cache.Declarable- Specified by:
initin interfaceorg.apache.geode.security.SecurityManager
-
locateBeanFactory
protected org.springframework.beans.factory.BeanFactory locateBeanFactory()- Overrides:
locateBeanFactoryin classorg.springframework.data.gemfire.support.DeclarableSupport
-