use of org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantListItem in project identity-api-server by wso2.
the class ServerTenantManagementService method getTenantListItems.
private List<TenantListItem> getTenantListItems(List<Tenant> tenants) {
List<TenantListItem> tenantListItems = new ArrayList<>();
for (Tenant tenant : tenants) {
TenantListItem listItem = new TenantListItem();
listItem.setLifecycleStatus(getLifeCycleStatus(tenant.isActive()));
listItem.setCreatedDate(getISOFormatDate(tenant.getCreatedDate()));
listItem.setDomain(tenant.getDomain());
listItem.setId(tenant.getTenantUniqueID());
listItem.setOwners(getOwnerResponses(tenant));
tenantListItems.add(listItem);
}
return tenantListItems;
}
use of org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantListItem in project identity-api-server by wso2.
the class ServerTenantManagementService method createTenantListResponse.
private TenantsListResponse createTenantListResponse(TenantSearchResult tenantSearchResult) {
List<Tenant> tenants = tenantSearchResult.getTenantList();
TenantsListResponse listResponse = new TenantsListResponse();
if (CollectionUtils.isNotEmpty(tenants)) {
List<TenantListItem> tenantListItems = getTenantListItems(tenants);
listResponse.setTenants(tenantListItems);
listResponse.setCount(tenantListItems.size());
} else {
listResponse.setCount(0);
}
listResponse.setTotalResults(tenantSearchResult.getTotalTenantCount());
listResponse.setStartIndex(tenantSearchResult.getOffSet() + 1);
listResponse.setLinks(createLinks(V1_API_PATH_COMPONENT + TENANT_MANAGEMENT_PATH_COMPONENT, tenantSearchResult.getLimit(), tenantSearchResult.getOffSet(), tenantSearchResult.getTotalTenantCount(), tenantSearchResult.getFilter()));
return listResponse;
}
Aggregations