Hi Prasanna, org.wso2.carbon.tenant.mgt.util.TenantMgtUtil class have validateDomain method to validate Tenant domain. can't you use that? AFAIR -1 tenant id associate with super tenant, for other tenants it becomes another value. So using tenant id to validate domain is not a good way as I think.
Thanks 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 > > -- Lakshman Udayakantha WSO2 Inc. www.wso2.com lean.enterprise.middleware Mobile: *0711241005*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
