On Fri, Nov 1, 2019 at 4:38 PM Gayashan Bombuwala <gayash...@wso2.com>
wrote:

> Hi Johann,
>
> Both the new handler and the old handler will be called at the end[1] of
> deleteServiceProvider() execution.
> By the time that postDeleteHandler gets executed, the relevant Service
> Provider object will been already removed. Hence, we can't read the Service
> Provider object based on the name inside the postDeltedHandler.
> We have also deprecated[2] the old postDeleteHandler.
>

Instead of calling both old and new methods of the listener. Can't we add a
default implementation at the interface level like below for the new method,

default boolean doPostDeleteApplication(ServiceProvider serviceProvider,
String tenantDomain, String userName)
            throws IdentityApplicationManagementException {
        return doPostDeleteApplication(serviceProvider.getName(),
tenantDomain, userName);
}

and call only the new method doPostDeleteApplication(ServiceProvider
serviceProvider, String tenantDomain, String userName) at the OSGi service
level.

This way we consume the new API only and any listener written implementing
the deprecated method will also work without an issue.


> [1]
> https://github.com/wso2/carbon-identity-framework/blob/07c9b785611114dbd4fd652ae323d3f3ef264cf5/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java#L746
> [2]
> https://github.com/wso2/carbon-identity-framework/blob/07c9b785611114dbd4fd652ae323d3f3ef264cf5/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/listener/ApplicationMgtListener.java#L121
>
> Regards,
> Gayashan.
>
> On Fri, Nov 1, 2019 at 3:37 PM Johann Nallathamby <joh...@wso2.com> wrote:
>
>> Hi Gayashan,
>>
>> Though you introduce the method in the API, who calls the method? Now
>> that there are two methods is the ApplicationMgtService going to call both
>> the methods? Can't we read the Service Provider object based on the name
>> rather than introducing a new method for it?
>>
>> Regards,
>> Johann.
>>
>> On Fri, Oct 25, 2019 at 4:45 PM Gayashan Bombuwala <gayash...@wso2.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> Currently implementation of the postDeleteHandler[1] of
>>> ApplicationMgtListener only accepts the name of the service provider as a
>>> parameter. However the postCreateHandler[2] and postUpdateHandler[3] of the
>>> ApplicationMgtListener accepts the relevant Service Provider object as a
>>> parameter rather than just the service provider name.We will be introducing
>>> a new overloaded postDeleteHandler to the ApplicationMgtListener interface
>>> where the relevant Service Provider object get passed to the handler
>>> similar to the postCreateHandler[2] and postUpdateHandler[3] as the
>>> relevant Service Provider information is required for logging purposes.
>>>
>>> [1]
>>> https://github.com/wso2/carbon-identity-framework/blob/b95514a65960e75015855d343ebd9452c4ce6a2b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/listener/ApplicationMgtListener.java#L117
>>>
>>> [2]
>>> https://github.com/wso2/carbon-identity-framework/blob/b95514a65960e75015855d343ebd9452c4ce6a2b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/listener/ApplicationMgtListener.java#L69
>>>
>>> [3]
>>> https://github.com/wso2/carbon-identity-framework/blob/b95514a65960e75015855d343ebd9452c4ce6a2b/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/listener/ApplicationMgtListener.java#L93
>>>
>>> Thanks,
>>> --
>>> *Gayashan Bombuwala*
>>> Software Engineer | WSO2
>>>
>>> Email: gayash...@wso2.com
>>> Phone: +94770548334
>>>
>>> [image: https://wso2.com/signature] <https://wso2.com/signature>
>>>
>>
>>
>> --
>> *Johann Dilantha Nallathamby* | Associate Director/Solutions Architect |
>> WSO2 Inc.
>> (m) +94 (77) 7776950 | (w) +94 (11) 2145345 | (e) joh...@wso2.com
>> [image: Signature.jpg]
>>
>
>
> --
> *Gayashan Bombuwala*
> Software Engineer | WSO2
>
> Email: gayash...@wso2.com
> Phone: +94770548334
>
> [image: https://wso2.com/signature] <https://wso2.com/signature>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
Farasath Ahamed
Associate Technical Lead, WSO2 Inc.: http://wso2.com
Mobile: +94777603866
Blog: https://farasath.blogspot.com / https://medium.com/@farasath
Twitter: @farazath619 <https://twitter.com/farazath619>
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to