use of org.apache.activemq.artemis.core.security.SecurityStore in project activemq-artemis by apache.
the class ActiveMQServerImpl method createSession.
@Override
public ServerSession createSession(final String name, final String username, final String password, final int minLargeMessageSize, final RemotingConnection connection, final boolean autoCommitSends, final boolean autoCommitAcks, final boolean preAcknowledge, final boolean xa, final String defaultAddress, final SessionCallback callback, final boolean autoCreateQueues, final OperationContext context, final Map<SimpleString, RoutingType> prefixes) throws Exception {
String validatedUser = "";
if (securityStore != null) {
validatedUser = securityStore.authenticate(username, password, connection);
}
checkSessionLimit(validatedUser);
callBrokerPlugins(hasBrokerPlugins() ? plugin -> plugin.beforeCreateSession(name, username, minLargeMessageSize, connection, autoCommitSends, autoCommitAcks, preAcknowledge, xa, defaultAddress, callback, autoCreateQueues, context, prefixes) : null);
final ServerSessionImpl session = internalCreateSession(name, username, password, validatedUser, minLargeMessageSize, connection, autoCommitSends, autoCommitAcks, preAcknowledge, xa, defaultAddress, callback, context, autoCreateQueues, prefixes);
sessions.put(name, session);
callBrokerPlugins(hasBrokerPlugins() ? plugin -> plugin.afterCreateSession(session) : null);
return session;
}
Aggregations