Hi Prasanna,

Use *MultitenantConstants.INVALID_TENANT_ID *constant other than using -1.
AFAIK other thing looks OK.


Thanks
Godwin



On Fri, Dec 19, 2014 at 9:55 AM, Prasanna Dangalla <[email protected]>
wrote:
>
> Hi
>
> I need to check whether a specific tenant domain is a valid one or not.
> If its an invalid domain when getting the tenant id by giving the domain it
> retains a -1. So is it the correct way to check whether the tenant domain
> is valid of not as below by checking with -1 in the code.
>
> int tenantId = 
> ServiceHolder.getRealmService().getTenantManager().getTenantId(tenantDomain);
>
> if(tenantId != -1) {
>
>      //Do the operation
>
> } else {
>
>      //Invalid tenant
>
> }
>
>
> Thanks
> --
> Prasanna Dangalla
> Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
> cell: +94 777 55 80 30 | +94 718 11 27 51
> twitter: @prasa77
>
> _______________________________________________
> Dev mailing list
> [email protected]
> 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
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to