public void setQuerySourcesFromPsicquicRegistry() {
   PsicquicRegistryClient registryClient = new DefaultPsicquicRegistryClient();
   try {
     List<ServiceType> allServices = registryClient.listServices();
     for (final ServiceType service : allServices) {
       if (service.isActive()) {
         this.addQuerySource(service.getName());
       }
     }
   } catch (PsicquicRegistryClientException e) {
     logger.error(e);
     e.printStackTrace();
   }
 }
 public void setImexSources() {
   PsicquicRegistryClient registryClient = new DefaultPsicquicRegistryClient();
   try {
     List<ServiceType> allServices = registryClient.listServices();
     for (final ServiceType service : allServices) {
       List<String> tags = service.getTags();
       if (service.isActive() && tags != null) {
         if (tags.contains("MI:0959")) {
           this.addQuerySource(service.getName());
         }
       }
     }
   } catch (PsicquicRegistryClientException e) {
     logger.error(e);
     e.printStackTrace();
   }
 }
  public void initializeServices() throws PsicquicRegistryClientException {

    final String psicquicRegistryUrl = intactViewConfiguration.getPsicquicRegistryUrl();

    if (psicquicRegistryUrl == null || psicquicRegistryUrl.length() == 0) {
      return;
    }

    if (services == null || services.isEmpty()) {
      try {
        PsicquicRegistryClient registryClient =
            new DefaultPsicquicRegistryClient(psicquicRegistryUrl);
        services = registryClient.listActiveServices();
      } catch (Throwable e) {
        log.error("PSICQUIC registry not available", e);
        services = new ArrayList<ServiceType>();
      }
    }

    if (imexServices == null || imexServices.isEmpty()) {
      imexServices = new ArrayList<ServiceType>(services.size());

      for (final ServiceType service : services) {
        if (isImexService(service)) {
          imexServices.add(service);
        }

        // initialise psicquic services
        if (!intactViewConfiguration.getPsicquicClientMap().containsKey(service.getRestUrl())) {
          intactViewConfiguration.getPsicquicClient(service.getRestUrl());
        }
      }
    }

    if (runningTasks == null) {
      runningTasks = new ArrayList<Future>();
    }
  }