I have developed a custom BrokerPlugin using BrokerFilter for Security purposes. The plugin performs its own custom authentication in the addConnection() method. During the authentication we return an authorization parameter(String) that allows us to identify which topic(s) a client is allowed to subscribe. In the addConsumer() method we determine whether or not a client is allowed to subscribe to a topic based on our own search rules using the parameter from the the custom authentication. Therefore, I need to be able to stash the authorization parameter from the custom authentication in the addConnection() method so it will be there for addConsumer() method. I had thought I could stash it in the ConnectionContext class, but setUserName() method is protected (not public). I ended up using a HashMap that uses the ConnectionId as the key and store the parameter in the map. Is there a better way to solve the problem than using a HashMap? And is there a way that I can use the ConnectionContext class or any other Class?
-- View this message in context: http://activemq.2283324.n4.nabble.com/How-to-pass-data-between-methods-in-BrokerFilter-tp4697799.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.
