Search in sources :

Example 1 with TenantQueryDto

use of org.camunda.bpm.engine.rest.dto.identity.TenantQueryDto in project camunda-bpm-platform by camunda.

the class TenantRestServiceImpl method queryTenants.

public List<TenantDto> queryTenants(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
    TenantQueryDto queryDto = new TenantQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
    TenantQuery query = queryDto.toQuery(getProcessEngine());
    List<Tenant> tenants;
    if (firstResult != null || maxResults != null) {
        tenants = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        tenants = query.list();
    }
    return TenantDto.fromTenantList(tenants);
}
Also used : Tenant(org.camunda.bpm.engine.identity.Tenant) TenantQueryDto(org.camunda.bpm.engine.rest.dto.identity.TenantQueryDto) TenantQuery(org.camunda.bpm.engine.identity.TenantQuery)

Example 2 with TenantQueryDto

use of org.camunda.bpm.engine.rest.dto.identity.TenantQueryDto in project camunda-bpm-platform by camunda.

the class TenantRestServiceImpl method getTenantCount.

public CountResultDto getTenantCount(UriInfo uriInfo) {
    TenantQueryDto queryDto = new TenantQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
    TenantQuery query = queryDto.toQuery(getProcessEngine());
    long count = query.count();
    return new CountResultDto(count);
}
Also used : TenantQueryDto(org.camunda.bpm.engine.rest.dto.identity.TenantQueryDto) CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) TenantQuery(org.camunda.bpm.engine.identity.TenantQuery)

Aggregations

TenantQuery (org.camunda.bpm.engine.identity.TenantQuery)2 TenantQueryDto (org.camunda.bpm.engine.rest.dto.identity.TenantQueryDto)2 Tenant (org.camunda.bpm.engine.identity.Tenant)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1