Package fi.foyt.hibernate.gae.search.persistence.dao

Examples of fi.foyt.hibernate.gae.search.persistence.dao.WorkListDAO


    errorContextBuilder.allWorkToBeDone(workList);
   
    LuceneWorkSerializer serializer = indexManager.getSerializer();
   
    DirectoryDAO directoryDAO = new DirectoryDAO();
    WorkListDAO workListDAO = new WorkListDAO();
   
    Directory directory = directoryDAO.findByName(indexManager.getIndexName());

    boolean someFailureHappened = false;
    try {
     
      try {
        workListDAO.create(directory, serializer.toSerializedModel(workList));
        LOG.info("Scheduled " + workList.size() + " works in " + directory.getName() + " directory to be performed in future");
      } catch (Exception e) {
        someFailureHappened = true;
        errorContextBuilder.errorThatOccurred(e.getCause());
      }
View Full Code Here


import fi.foyt.hibernate.gae.search.persistence.domainmodel.WorkList;

public class ScheduledUtils {

  public static void performWorkList(FullTextEntityManager fullTextEntityManager, WorkList workListEntity) {
    WorkListDAO workListDAO = new WorkListDAO();
    DirectoryDAO directoryDAO = new DirectoryDAO();

    SearchFactory searchFactory = fullTextEntityManager.getSearchFactory();
   
    Directory directory = directoryDAO.findByKey(workListEntity.getKey().getParent());
   
    IndexManager indexManager = getIndexManager(searchFactory, directory.getName());
    LuceneWorkSerializer serializer = indexManager.getSerializer();
    BackendQueueProcessor queueProcessor = createInstanceBackendQueueProcessor(searchFactory, indexManager);
   
    List<LuceneWork> luceneWorks = serializer.toLuceneWorks(workListEntity.getData());
   
    queueProcessor.applyWork(luceneWorks, null);
   
    workListDAO.delete(workListEntity);   
  }
View Full Code Here

TOP

Related Classes of fi.foyt.hibernate.gae.search.persistence.dao.WorkListDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.