Hi Pradeep, Filters could leverage these key-value pairs to pass properties into the main subscription.
One existing use-case is passing LB subscription related properties to the main subscription. On Fri, Aug 22, 2014 at 6:21 AM, Pradeep Fernando <pradee...@gmail.com> wrote: > Hi, > > +1. > Can you please give me a usage for returned 'properties' in the > interface/implementation ? > > thanks. > > > On Thu, Aug 21, 2014 at 6:09 AM, Isuru Haththotuwa <isu...@apache.org> > wrote: > >> +1 for this change. This will enable us to cater to such customizations >> in future as well, without using long and ugly if-else statements. >> >> >> On Thu, Aug 21, 2014 at 9:28 AM, Nirmal Fernando <nirmal070...@gmail.com> >> wrote: >> >>> Hi All, >>> >>> Currently, there's no clean way to intercept a subscription request and >>> do some pre-processing. As of now, we do some pre-processing of a >>> subscription request in order to identify the need of a load balancer and >>> act accordingly. I currently have another use-case to intercept a >>> subscription request and act upon a parameter. >>> >>> Hence, to make the code clean over there, I propose we introduce a >>> Subscription Filter chain where you could intercept a subscription request >>> and do some pre-processing before creating the actual subscription. >>> >>> Following is the interface design, I've come up with. >>> >>> /** >>> >>> * Intercepts the flow of Cartridge Subscription. >>> >>> * Implementations of this class would get executed before making the >>> real subscription. >>> >>> */ >>> >>> public interface SubscriptionFilter { >>> >>> >>> /** >>> >>> * Do some pre-processing on a subscription request. >>> >>> * @param cartridgeInfo {@link CartridgeInfo} >>> >>> * @param subscriptionData {@link SubscriptionData} >>> >>> * @return {@link Properties}, if there are any. >>> >>> * @throws ADCException on a failure while processing. >>> >>> */ >>> >>> public Properties execute(CartridgeInfo cartridgeInfo, SubscriptionData >>> subscriptionData) throws ADCException ; >>> >>> } >>> >>> Let me know your thoughts. >>> >>> -- >>> Best Regards, >>> Nirmal >>> >>> Nirmal Fernando. >>> PPMC Member & Committer of Apache Stratos, >>> Senior Software Engineer, WSO2 Inc. >>> >>> Blog: http://nirmalfdo.blogspot.com/ >>> >>> -- >>> <http://nirmalfdo.blogspot.com/> >>> Thanks and Regards, >>> >>> Isuru H. >>> <http://nirmalfdo.blogspot.com/> >>> +94 716 358 048 <http://nirmalfdo.blogspot.com/>* <http://wso2.com/>* >>> >>> >>> * <http://wso2.com/>* >>> >>> >>> > > > -- > Pradeep Fernando. > http://pradeepfernando.blogspot.com/ > -- Best Regards, Nirmal Nirmal Fernando. PPMC Member & Committer of Apache Stratos, Senior Software Engineer, WSO2 Inc. Blog: http://nirmalfdo.blogspot.com/