Hi

I'm trying to get the tenant AdminName using tenantManager. In my scenario
I need to iterate through all the tenants and get this. Hence I got all the
tenants using getAllTenants() method. When I iterate the result, tenant
objects AdminName is null. But I can get the tenant ID from it. Then when I
pass that tenant Id and created a new tenant object, it includes the tenant
AdminName.

Any reason for this ?

My code segment is listed below

TenantManager tenantManager =
ServiceHolder.getRealmService().getTenantManager();
Tenant[] tenantsArray = tenantManager.getAllTenants();

for (Tenant tenant : tenantsArray) {

    //This is done because tenant AdminName is not available in
tenants taken from getAllTenants()
    Tenant tenant1 = tenantManager.getTenant(tenant.getId());

    changeTenantEncryptedKeyStoreProperties(tenant1.getDomain(),
tenant1.getAdminName());

}

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

Reply via email to