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/