public List<DeploymentDto> getDeployments(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
DeploymentQueryDto queryDto = new DeploymentQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
ProcessEngine engine = getProcessEngine();
DeploymentQuery query = queryDto.toQuery(engine);
List<Deployment> matchingDeployments;
if (firstResult != null || maxResults != null) {
matchingDeployments = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingDeployments = query.list();
}
List<DeploymentDto> deployments = new ArrayList<DeploymentDto>();
for (Deployment deployment : matchingDeployments) {
DeploymentDto def = DeploymentDto.fromDeployment(deployment);