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
ConstructorsConstructorDescriptionSecurityStoreImpl(HierarchicalRepository<Set<Role>> securityRepository, ActiveMQSecurityManager securityManager, long invalidationInterval, boolean securityEnabled, String managementClusterUser, String managementClusterPassword, NotificationService notificationService, long authenticationCacheSize, long authorizationCacheSize) -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(String user, String password, RemotingConnection connection) authenticate(String user, String password, RemotingConnection connection, String securityDomain) voidcheck(SimpleString address, SimpleString queue, CheckType checkType, SecurityAuth session) voidcheck(SimpleString address, CheckType checkType, SecurityAuth session) longlonglongcom.github.benmanes.caffeine.cache.Cache<String,ConcurrentHashSet<SimpleString>> longlonglonggetSessionSubject(SecurityAuth session) Get the cached Subject.getUserFromSubject(Subject subject) voidvoidbooleanvoidonChange()voidsetSecurityEnabled(boolean securityEnabled) voidstop()
-
Constructor Details
-
SecurityStoreImpl
public SecurityStoreImpl(HierarchicalRepository<Set<Role>> securityRepository, ActiveMQSecurityManager securityManager, long invalidationInterval, boolean securityEnabled, String managementClusterUser, String managementClusterPassword, NotificationService notificationService, long authenticationCacheSize, long authorizationCacheSize) throws NoSuchAlgorithmException - Parameters:
notificationService- can benull- Throws:
NoSuchAlgorithmException
-
-
Method Details
-
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
- 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
-
getUserFromSubject
-
getCaller
-
getSessionSubject
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() -
getAuthenticationCache
-
getAuthorizationCache
public com.github.benmanes.caffeine.cache.Cache<String,ConcurrentHashSet<SimpleString>> getAuthorizationCache() -
getAuthenticationSuccessCount
public long getAuthenticationSuccessCount()- Specified by:
getAuthenticationSuccessCountin interfaceSecurityStore
-
getAuthenticationFailureCount
public long getAuthenticationFailureCount()- Specified by:
getAuthenticationFailureCountin interfaceSecurityStore
-
getAuthorizationSuccessCount
public long getAuthorizationSuccessCount()- Specified by:
getAuthorizationSuccessCountin interfaceSecurityStore
-
getAuthorizationFailureCount
public long getAuthorizationFailureCount()- Specified by:
getAuthorizationFailureCountin interfaceSecurityStore
-