Пример #1
0
 public void setClientName(ClientCatalogItem item) throws SearchLibException, NamingException {
   if (item == null) return;
   Client client = ClientCatalog.getClient(item.getIndexName());
   if (client == null) return;
   setClient(client);
   selectedClientCatalogItem = item;
 }
 public Client getClient() {
   try {
     return ClientCatalog.getClient(indexName);
   } catch (SearchLibException e) {
     Logging.error(e);
     return null;
   }
 }
Пример #3
0
 public static final void openAll() {
   try {
     synchronized (ClientCatalog.class) {
       for (ClientCatalogItem catalogItem : getClientCatalog(null)) {
         Logging.info("OSS loads index " + catalogItem.getIndexName());
         getClient(catalogItem.getIndexName());
       }
     }
   } catch (SearchLibException e) {
     Logging.error(e);
   }
 }
Пример #4
0
  @Command
  public void onNewIndex()
      throws SearchLibException, InterruptedException, IOException, NamingException {
    String msg = null;
    if (indexName == null) msg = "Please enter a valid name for the new index";
    else if (indexName.length() == 0) msg = "Please enter a valid name for the new index";
    else if (ClientCatalog.exists(getLoggedUser(), indexName)) msg = "The name already exists";

    if (msg != null) {
      new AlertController(msg);
      return;
    }
    ClientCatalog.createIndex(getLoggedUser(), indexName, indexTemplate.getTemplate(), null);
    setClient(ClientCatalog.getClient(indexName));
  }