Re: [Asterisk-java-users] resolution: question about getting peersusing SipShowPeerAction (AMI)
Brought to you by:
srt
From: Robert P. <ro...@ro...> - 2007-08-15 17:33:26
|
Hey Martin, No worries about timing :) I've been thinking a bit about what might help ... while my first inclination is to say "of course a response should be specific (i.e., class/type) to the event it's a response to", that would mean a new hierarchy/set of subclasses, and could raise the learning curve that much more for beginners. It might just be unnecessarily clutter in the response package. One alternative is an (abstract?) default ManagerResponse subclass that provides a bunch of empty methods that can be ignored if you're not interested in that data/it's not that kind of response, but you can override those that do have the data you're interested in. The methods would ideally cover everything possible from any AMI response ... Also not so pretty. In terms of documentation, it says in the method comment for ManagerResponse.getAttributes(): "Returns a Map with all attributes of this response." I read that but didn't really get it. Maybe a paragraph or two explaining what the attributes Map is and that it's a catch-all for all the data from the AMI in the class comments/javadoc would help make that more explicit. I hope this helps - thanks! Cheers, Robert On 8/15/07, Martin Smith <ma...@be...> wrote: > Hi Robert, > > I'm sorry I didn't answer sooner -- with most responses, the response > subclasses (command response, getconfig response, etc) have setters that > are called when traversing the attributes map. This means anything that > isn't an actual data member of the class is always still sitting in the > Map. > > For good measure, here's the documentation as it stands regarding the > ManagerResponse and the getAttributes method: > http://asterisk-java.org/development/apidocs/org/asteriskjava/manager/re > sponse/ManagerResponse.html > > Would you suggest we make it more explicit in the class summary that the > attributes are what most users would want? We'd welcome that suggestion > and other ones for improving the javadocs :) > > Martin Smith, Systems Developer > ma...@be... > Bureau of Economic and Business Research > University of Florida > (352) 392-0171 Ext. 221 |