Package org.apache.activemq.security
Class AuthorizationBroker
- java.lang.Object
-
- org.apache.activemq.broker.BrokerFilter
-
- org.apache.activemq.security.AuthorizationBroker
-
- All Implemented Interfaces:
Broker,Region,SecurityAdminMBean,Service
public class AuthorizationBroker extends BrokerFilter implements SecurityAdminMBean
Verifies if a authenticated user can do an operation against the broker using an authorization map.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.broker.BrokerFilter
next
-
Fields inherited from interface org.apache.activemq.security.SecurityAdminMBean
OPERATION_ADMIN, OPERATION_READ, OPERATION_WRITE
-
-
Constructor Summary
Constructors Constructor Description AuthorizationBroker(Broker next, AuthorizationMap authorizationMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubscriptionaddConsumer(ConnectionContext context, ConsumerInfo info)Adds a consumer.DestinationaddDestination(ConnectionContext context, ActiveMQDestination destination, boolean create)Used to create a destination.voidaddDestinationInfo(ConnectionContext context, DestinationInfo info)Add and process a DestinationInfo objectvoidaddDestinationRole(Destination destination, String operation, String role)voidaddProducer(ConnectionContext context, ProducerInfo info)Adds a producer.voidaddQueueRole(String queue, String operation, String role)voidaddRole(String role)voidaddTopicRole(String topic, String operation, String role)voidaddUserRole(String user, String role)protected booleancheckDestinationAdmin(SecurityContext securityContext, ActiveMQDestination destination)protected SecurityContextcheckSecurityContext(ConnectionContext context)AuthorizationMapgetAuthorizationMap()voidremoveDestination(ConnectionContext context, ActiveMQDestination destination, long timeout)Used to destroy a destination.voidremoveDestinationInfo(ConnectionContext context, DestinationInfo info)Remove and process a DestinationInfo objectvoidremoveDestinationRole(Destination destination, String operation, String role)voidremoveQueueRole(String queue, String operation, String role)voidremoveRole(String role)voidremoveTopicRole(String topic, String operation, String role)voidremoveUserRole(String user, String role)voidsend(ProducerBrokerExchange producerExchange, Message messageSend)Send a message to the broker to using the specified destination.voidsetAuthorizationMap(AuthorizationMap map)-
Methods inherited from class org.apache.activemq.broker.BrokerFilter
acknowledge, addBroker, addConnection, addSession, beginTransaction, brokerServiceStarted, commitTransaction, fastProducer, forgetTransaction, gc, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getNext, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageExpired, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, prepareTransaction, preProcessDispatch, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeBroker, removeConnection, removeConsumer, removeProducer, removeSession, removeSubscription, rollbackTransaction, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer, start, stop, virtualDestinationAdded, virtualDestinationRemoved
-
-
-
-
Constructor Detail
-
AuthorizationBroker
public AuthorizationBroker(Broker next, AuthorizationMap authorizationMap)
-
-
Method Detail
-
getAuthorizationMap
public AuthorizationMap getAuthorizationMap()
-
setAuthorizationMap
public void setAuthorizationMap(AuthorizationMap map)
-
checkSecurityContext
protected SecurityContext checkSecurityContext(ConnectionContext context) throws SecurityException
- Throws:
SecurityException
-
checkDestinationAdmin
protected boolean checkDestinationAdmin(SecurityContext securityContext, ActiveMQDestination destination)
-
addDestinationInfo
public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
Description copied from interface:BrokerAdd and process a DestinationInfo object- Specified by:
addDestinationInfoin interfaceBroker- Overrides:
addDestinationInfoin classBrokerFilter- Throws:
Exception
-
addDestination
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean create) throws Exception
Description copied from interface:RegionUsed to create a destination. Usually, this method is invoked as a side-effect of sending a message to a destination that does not exist yet.- Specified by:
addDestinationin interfaceRegion- Overrides:
addDestinationin classBrokerFilterdestination- the destination to create.- Returns:
- TODO
- Throws:
Exception- TODO
-
removeDestination
public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception
Description copied from interface:RegionUsed to destroy a destination. This should try to quiesce use of the destination up to the timeout allotted time before removing the destination. This will remove all persistent messages associated with the destination.- Specified by:
removeDestinationin interfaceRegion- Overrides:
removeDestinationin classBrokerFilter- Parameters:
context- the environment the operation is being executed under.destination- what is being removed from the broker.timeout- the max amount of time to wait for the destination to quiesce- Throws:
Exception- TODO
-
removeDestinationInfo
public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
Description copied from interface:BrokerRemove and process a DestinationInfo object- Specified by:
removeDestinationInfoin interfaceBroker- Overrides:
removeDestinationInfoin classBrokerFilter- Throws:
Exception
-
addConsumer
public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Description copied from interface:RegionAdds a consumer.- Specified by:
addConsumerin interfaceRegion- Overrides:
addConsumerin classBrokerFilter- Parameters:
context- the environment the operation is being executed under.- Returns:
- TODO
- Throws:
Exception- TODO
-
addProducer
public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception
Description copied from interface:BrokerAdds a producer.- Specified by:
addProducerin interfaceBroker- Specified by:
addProducerin interfaceRegion- Overrides:
addProducerin classBrokerFilter- Parameters:
context- the environment the operation is being executed under.- Throws:
Exception- TODO
-
send
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception
Description copied from interface:RegionSend a message to the broker to using the specified destination. The destination specified in the message does not need to match the destination the message is sent to. This is handy in case the message is being sent to a dead letter destination.- Specified by:
sendin interfaceRegion- Overrides:
sendin classBrokerFilter- Parameters:
producerExchange- the environment the operation is being executed under.- Throws:
Exception- TODO
-
addQueueRole
public void addQueueRole(String queue, String operation, String role)
- Specified by:
addQueueRolein interfaceSecurityAdminMBean
-
addTopicRole
public void addTopicRole(String topic, String operation, String role)
- Specified by:
addTopicRolein interfaceSecurityAdminMBean
-
removeQueueRole
public void removeQueueRole(String queue, String operation, String role)
- Specified by:
removeQueueRolein interfaceSecurityAdminMBean
-
removeTopicRole
public void removeTopicRole(String topic, String operation, String role)
- Specified by:
removeTopicRolein interfaceSecurityAdminMBean
-
addDestinationRole
public void addDestinationRole(Destination destination, String operation, String role)
-
removeDestinationRole
public void removeDestinationRole(Destination destination, String operation, String role)
-
addRole
public void addRole(String role)
- Specified by:
addRolein interfaceSecurityAdminMBean
-
addUserRole
public void addUserRole(String user, String role)
- Specified by:
addUserRolein interfaceSecurityAdminMBean
-
removeRole
public void removeRole(String role)
- Specified by:
removeRolein interfaceSecurityAdminMBean
-
removeUserRole
public void removeUserRole(String user, String role)
- Specified by:
removeUserRolein interfaceSecurityAdminMBean
-
-