+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/
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048* <http://wso2.com/>*
>
>
> * <http://wso2.com/>*
>
>
>

Reply via email to