Class SecurityStoreImpl
- java.lang.Object
-
- org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl
-
- All Implemented Interfaces:
SecurityStore,HierarchicalRepositoryChangeListener
public class SecurityStoreImpl extends Object implements SecurityStore, HierarchicalRepositoryChangeListener
The ActiveMQ Artemis SecurityStore implementation
-
-
Constructor Summary
Constructors Constructor Description SecurityStoreImpl(HierarchicalRepository<Set<Role>> securityRepository, ActiveMQSecurityManager securityManager, long invalidationInterval, boolean securityEnabled, String managementClusterUser, String managementClusterPassword, NotificationService notificationService, long authenticationCacheSize, long authorizationCacheSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringauthenticate(String user, String password, RemotingConnection connection)Stringauthenticate(String user, String password, RemotingConnection connection, String securityDomain)voidcheck(SimpleString address, SimpleString queue, CheckType checkType, SecurityAuth session)voidcheck(SimpleString address, CheckType checkType, SecurityAuth session)longgetAuthenticationCacheSize()longgetAuthorizationCacheSize()SubjectgetSessionSubject(SecurityAuth session)Get the cached Subject.static StringgetUserFromSubject(Subject subject)voidinvalidateAuthenticationCache()voidinvalidateAuthorizationCache()booleanisSecurityEnabled()voidonChange()voidsetSecurityEnabled(boolean securityEnabled)voidstop()
-
-
-
Constructor Detail
-
SecurityStoreImpl
public SecurityStoreImpl(HierarchicalRepository<Set<Role>> securityRepository, ActiveMQSecurityManager securityManager, long invalidationInterval, boolean securityEnabled, String managementClusterUser, String managementClusterPassword, NotificationService notificationService, long authenticationCacheSize, long authorizationCacheSize)
- Parameters:
notificationService- can benull
-
-
Method Detail
-
isSecurityEnabled
public boolean isSecurityEnabled()
- Specified by:
isSecurityEnabledin interfaceSecurityStore
-
setSecurityEnabled
public void setSecurityEnabled(boolean securityEnabled)
- Specified by:
setSecurityEnabledin interfaceSecurityStore
-
stop
public void stop()
- Specified by:
stopin interfaceSecurityStore
-
authenticate
public String authenticate(String user, String password, RemotingConnection connection) throws Exception
- Specified by:
authenticatein interfaceSecurityStore- Throws:
Exception
-
authenticate
public String authenticate(String user, String password, RemotingConnection connection, String securityDomain) throws Exception
- Specified by:
authenticatein interfaceSecurityStore- Throws:
Exception
-
check
public void check(SimpleString address, CheckType checkType, SecurityAuth session) throws Exception
- Specified by:
checkin interfaceSecurityStore- Throws:
Exception
-
check
public void check(SimpleString address, SimpleString queue, CheckType checkType, SecurityAuth session) throws Exception
- Specified by:
checkin interfaceSecurityStore- Throws:
Exception
-
onChange
public void onChange()
- Specified by:
onChangein interfaceHierarchicalRepositoryChangeListener
-
getSessionSubject
public Subject getSessionSubject(SecurityAuth session)
Get the cached Subject. If the Subject is not in the cache then authenticate again to retrieve it.- Specified by:
getSessionSubjectin interfaceSecurityStore- Parameters:
session- contains the authentication data- Returns:
- the authenticated Subject with all associated role principals or null if not authenticated or JAAS is not supported by the SecurityManager.
-
invalidateAuthorizationCache
public void invalidateAuthorizationCache()
-
invalidateAuthenticationCache
public void invalidateAuthenticationCache()
-
getAuthenticationCacheSize
public long getAuthenticationCacheSize()
-
getAuthorizationCacheSize
public long getAuthorizationCacheSize()
-
-