/**
  * Get events for a specific deployment from an environment
  *
  * @param applicationEnvironmentId The environment we want to get events from
  * @param from The initial position of the events to get (based on time desc sorting)
  * @param size The number of events to get.
  * @return A result that contains all events.
  */
 public GetMultipleDataResult<?> getDeploymentEvents(
     String applicationEnvironmentId, int from, int size) {
   Deployment deployment = deploymentService.getActiveDeploymentOrFail(applicationEnvironmentId);
   String index = alienMonitorDao.getIndexForType(AbstractMonitorEvent.class);
   QueryHelper.SearchQueryHelperBuilder searchQueryHelperBuilder =
       queryHelper
           .buildSearchQuery(index)
           .types(
               PaaSDeploymentStatusMonitorEvent.class,
               PaaSInstanceStateMonitorEvent.class,
               PaaSMessageMonitorEvent.class,
               PaaSInstancePersistentResourceMonitorEvent.class)
           .filters(
               MapUtil.newHashMap(
                   new String[] {"deploymentId"},
                   new String[][] {new String[] {deployment.getId()}}))
           .fieldSort("_timestamp", true);
   return alienMonitorDao.search(searchQueryHelperBuilder, from, size);
 }
 /**
  * Get the deployed (runtime) topology of an application on a cloud
  *
  * @param topologyId id of the topology for which to get deployed topology.
  * @param orchestratorId targeted cloud id
  * @return the DeploymentTopology requested if found
  */
 public DeploymentTopology getRuntimeTopologyFromEnvironment(
     String topologyId, String orchestratorId) {
   Deployment deployment = deploymentService.getActiveDeploymentOrFail(topologyId, orchestratorId);
   return alienMonitorDao.findById(DeploymentTopology.class, deployment.getId());
 }
 /**
  * Get the deployed (runtime) topology of an application from the environment id
  *
  * @param applicationEnvironmentId id of the environment
  * @return the DeploymentTopology requested if found
  */
 public DeploymentTopology getRuntimeTopologyFromEnvironment(String applicationEnvironmentId) {
   Deployment deployment = deploymentService.getActiveDeploymentOrFail(applicationEnvironmentId);
   return alienMonitorDao.findById(DeploymentTopology.class, deployment.getId());
 }