Hi Ayesha,
You can use the following service,
* @scr.reference name="user.realmservice.default"
* interface="org.wso2.carbon.user.core.service.RealmService"
* cardinality="1..1" policy="dynamic" bind="setRealmService"
* unbind="unsetRealmService"
then as Azeez has mentioed above,
int id =realmService.getTenantManager().getTenantId("sample.com");
Regards,
Aruna
On Wed, Nov 12, 2014 at 2:43 PM, Ayesha Dissanayaka <[email protected]> wrote:
> Hi Godwin, Azeez,
>
> Thanks a lot for the quick responses.
>
> Thanks!
> - Ayesha
>
> On Wed, Nov 12, 2014 at 12:05 PM, Afkham Azeez <[email protected]> wrote:
>
>> UserRealmService.getTenantManager().getTenantId(tenantDomain)
>>
>> On Wed, Nov 12, 2014 at 10:52 AM, Ayesha Dissanayaka <[email protected]>
>> wrote:
>>
>>> Hi all,
>>>
>>> While implementing anonymous view for tenant store in ES, I need to
>>> obtain tenantID by tenant domain name.
>>>
>>> ex: to serve URL
>>> *http://localhost:9763/store/t/abc.com/pages/top-assets
>>> <http://localhost:9763/store/t/abc.com/pages/top-assets> *
>>> At this point we will only have the tenant domain name "abc.com", in
>>> oder to retrieve assets for an anonymous user of that domain we need to
>>> know the tenantID. How can I achieve this?
>>>
>>> API-M has this anonymous view implemented to serve URLs like
>>> *"https://localhost:9443/store/?tenant=a.com
>>> <https://localhost:9443/store/?tenant=a.com>". *Can someone point me to
>>> this implementation as well.
>>>
>>> Thanks!
>>> -Ayesha
>>>
>>> --
>>> *Ayesha Dissanayaka*
>>> Software Engineer,
>>> WSO2, Inc : http://wso2.com
>>> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
>>> 20, Palmgrove Avenue, Colombo 3
>>> E-Mail: [email protected] <[email protected]>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * <http://www.apache.org/>*
>> *email: **[email protected]* <[email protected]>
>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
>> *http://blog.afkham.org* <http://blog.afkham.org>
>> *twitter: **http://twitter.com/afkham_azeez*
>> <http://twitter.com/afkham_azeez>
>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>> <http://lk.linkedin.com/in/afkhamazeez>*
>>
>> *Lean . Enterprise . Middleware*
>>
>
>
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: [email protected] <[email protected]>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
*Aruna Sujith Karunarathna* | Software Engineer
WSO2, Inc | lean. enterprise. middleware.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 71 9040362 | Work: +94 112145345
Email: [email protected] | Web: www.wso2.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev