Hi Ayesha,

You can use TenantManager to get the tenantId by passing tenant domain.
Please see below code snippet.

 TenantManager tenantManager =
TenantMgtCoreServiceComponent.getTenantManager();

 int tenantId = tenantManager.getTenantId(tenantDomain);


Thanks

Godwin



On Wed, Nov 12, 2014 at 10:52 AM, Ayesha Dissanayaka <aye...@wso2.com>
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: aye...@wso2.com <ayshsa...@gmail.com>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
twitter: https://twitter.com/godwinamila
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to