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
-
public class SubjectFilter extends EnvironmentFilter
TheSubjectFilterensures a ShiroSubjectrepresenting the client's identity is associated with every connection to the ActiveMQ Broker. TheSubjectis 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 Constructor Description SubjectFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info)Creates aSubjectinstance reflecting the specified Connection.protected SecurityContextcreateSecurityContext(SubjectConnectionReference conn)protected org.apache.shiro.subject.SubjectcreateSubject(ConnectionReference conn)ConnectionSubjectFactorygetConnectionSubjectFactory()SecurityContextFactorygetSecurityContextFactory()voidremoveConnection(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, setEnvironment
-
Methods inherited from class org.apache.activemq.shiro.SecurityFilter
isEnabled, setEnabled
-
Methods inherited from class org.apache.activemq.broker.MutableBrokerFilter
getAdaptor, getNext, setNext
-
Methods 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
-
-
-
-
Method Detail
-
getConnectionSubjectFactory
public ConnectionSubjectFactory getConnectionSubjectFactory()
-
setConnectionSubjectFactory
public void setConnectionSubjectFactory(ConnectionSubjectFactory connectionSubjectFactory)
-
getSecurityContextFactory
public SecurityContextFactory getSecurityContextFactory()
-
setSecurityContextFactory
public void setSecurityContextFactory(SecurityContextFactory securityContextFactory)
-
createSubject
protected org.apache.shiro.subject.Subject createSubject(ConnectionReference conn)
-
createSecurityContext
protected SecurityContext createSecurityContext(SubjectConnectionReference conn)
-
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
-
-