Class SubjectFilter
java.lang.Object
org.apache.activemq.broker.BrokerFilter
org.apache.activemq.broker.MutableBrokerFilter
org.apache.activemq.shiro.SecurityFilter
org.apache.activemq.shiro.env.EnvironmentFilter
org.apache.activemq.shiro.subject.SubjectFilter
The
SubjectFilter ensures a Shiro Subject representing the client's identity is associated with
every connection to the ActiveMQ Broker. The Subject is made available to downstream broker filters so
they may perform security checks as necessary.
This implementation does not perform any security checks/assertions itself. It is expected that other broker filters
will be configured after this one and those will perform any security behavior or checks as necessary.- Since:
- 5.10.0
-
Field Summary
Fields inherited from class org.apache.activemq.broker.MutableBrokerFilter
next -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info) Creates aSubjectinstance reflecting the specified Connection.protected SecurityContextprotected org.apache.shiro.subject.SubjectvoidremoveConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info, Throwable error) voidsetConnectionSubjectFactory(ConnectionSubjectFactory connectionSubjectFactory) voidsetSecurityContextFactory(SecurityContextFactory securityContextFactory) Methods inherited from class org.apache.activemq.shiro.env.EnvironmentFilter
getEnvironment, setEnvironmentMethods inherited from class org.apache.activemq.shiro.SecurityFilter
isEnabled, setEnabledMethods inherited from class org.apache.activemq.broker.MutableBrokerFilter
getAdaptor, getNext, setNextMethods inherited from class org.apache.activemq.broker.BrokerFilter
acknowledge, addBroker, addConsumer, addDestination, addDestinationInfo, addProducer, addSession, beginTransaction, brokerServiceStarted, commitTransaction, fastProducer, forgetTransaction, gc, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageDispatched, messageExpired, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, prepareTransaction, preProcessDispatch, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeBroker, removeConsumer, removeDestination, removeDestinationInfo, removeProducer, removeSession, removeSubscription, rollbackTransaction, send, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer, start, stop, virtualDestinationAdded, virtualDestinationRemoved
-
Constructor Details
-
SubjectFilter
public SubjectFilter()
-
-
Method Details
-
getConnectionSubjectFactory
-
setConnectionSubjectFactory
-
getSecurityContextFactory
-
setSecurityContextFactory
-
createSubject
-
createSecurityContext
-
addConnection
public void addConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info) throws Exception Creates aSubjectinstance reflecting the specified Connection. TheSubjectis then stored in aSecurityContextinstance which is set as the Connection'ssecurityContext.- Specified by:
addConnectionin interfaceBroker- Overrides:
addConnectionin classBrokerFilter- Parameters:
context- state associated with the client's connectioninfo- info about the client's connection- Throws:
Exception- if there is a problem creating a Subject orSecurityContextinstance.
-
removeConnection
public void removeConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info, Throwable error) throws Exception - Specified by:
removeConnectionin interfaceBroker- Overrides:
removeConnectionin classBrokerFilter- Throws:
Exception
-