When doing this fix to carbon 4.3.0 branch you can follow the above
approach (once the git based patching model is finalized).

For now you can do the fix on carbon 4.4.0-SNAPSHOT branch. In that you can
probably add a CASCADE DELETE to UM_DIALECT table so that UM_CLAIM table
rows also get deleted in database level instead of you getting all the rows
and deleting them one by one in a for loop as in above approach. This will
be much more easier and safer.

Thanks.

On Sun, Feb 22, 2015 at 9:09 PM, Johann Nallathamby <[email protected]> wrote:

> Hi Tharindu,
>
> On Wed, Feb 18, 2015 at 3:25 PM, Tharindu Edirisinghe <[email protected]>
> wrote:
>
>> Hi,
>>
>> I'm working on [1] and when deleting a claim dialect, although all the
>> claims inside it get deleted, claim dialect is not deleted from UM_DIALECT
>> table in the DB.
>>
>> In the *org.wso2.carbon.user.core.claim.dao.ClaimDAO* class following
>> method is there which deletes the claim dialect.
>>
>>
>>
>> * public void deleteDialect(String dialectUri)*
>> But above method is  not called from anywhere !
>>
>> In the *org.wso2.carbon.claim.mgt.ClaimManagerHandler* class, following
>> method is called.
>>
>> *public void removeClaimDialect(String dialectUri)*
>>
>> what it does is deleting all the claims that belong to the particular
>> dialect, but it is not deleting the dialect.
>>
>> The proper fix is to add a new method to
>> *org.wso2.carbon.user.api.ClaimManager* interface for deleting a claim
>> dialect and to implement the method in
>> *org.wso2.carbon.user.core.claim.DefaultClaimManager* class.
>>
>
> You don't need this because managing dialect is not an API needed to be
> exposed in kernel. That can be handled in the Claim management feature
> level only.
>
>>
>> Then from *org.wso2.carbon.claim.mgt.ClaimManagerHandler*, in 
>> *removeClaimDialect(String
>> dialectUri)* method we can call the new method using the ClaimManager
>> instance as following
>>
>
> From this method just calling the deleteDialect(String dialectURI) would
> be enough, instead of looping through all the claims and invoking
> deleteClaimMapping(ClaimMapping) on each.
>
> Johann.
>
>
>> *claimManager.deleteClaimDialect(dialectUri)* and it will fix the issue.
>>
>> Since this fix needs API change to the *org.wso2.carbon.user.api.ClaimManager
>> *interface, please instruct whether to proceed with this fix.
>>
>> [1] https://wso2.org/jira/browse/IDENTITY-3042
>>
>> Thank you
>> TharinduE
>>
>> --
>>
>> Tharindu Edirisinghe
>> Software Engineer | WSO2 Inc
>> Identity Server Team
>> mobile : +94 775 181586
>>
>
>
>
> --
> Thanks & Regards,
>
> *Johann Dilantha Nallathamby*
> Associate Technical Lead & Product Lead of WSO2 Identity Server
> Integration Technologies Team
> WSO2, Inc.
> lean.enterprise.middleware
>
> Mobile - *+94777776950*
> Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>*
>



-- 
Thanks & Regards,

*Johann Dilantha Nallathamby*
Associate Technical Lead & Product Lead of WSO2 Identity Server
Integration Technologies Team
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777776950*
Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to