View Javadoc
1   package org.kuali.ole.select.gokb.service.impl;
2   
3   import org.kuali.ole.module.purap.document.dataaccess.impl.ThresholdDaoOjb;
4   import org.kuali.ole.select.gokb.service.GokbLocalService;
5   import org.kuali.ole.select.gokb.service.GokbRdbmsService;
6   import org.kuali.ole.select.gokb.util.OleGokbXmlUtil;
7   
8   import java.sql.Timestamp;
9   
10  /**
11   * Created by premkumarv on 12/24/14.
12   */
13  public class GokbThread extends Thread {
14  
15  
16      private GokbRdbmsService gokbRdbmsService;
17      private GokbLocalService gokbLocalService;
18  
19      public GokbRdbmsService getGokbRdbmsService() {
20          if (null == gokbRdbmsService) {
21              return new GokbRdbmsServiceImpl();
22          }
23          return gokbRdbmsService;
24      }
25  
26      public GokbLocalService getGokbLocalService() {
27          if (null == gokbLocalService) {
28              return new GokbLocalServiceImpl();
29          }
30          return gokbLocalService;
31      }
32      @Override
33      public void run() {
34          Timestamp lastUpdatedTime = getGokbRdbmsService().getUpdatedDate();
35          if(lastUpdatedTime == null) {
36              getGokbLocalService().initLocalGokb();
37          } else {
38              String stringFromTimeStamp = OleGokbXmlUtil.getStringFromTimeStamp(lastUpdatedTime);
39              getGokbLocalService().updateLocalGokb(stringFromTimeStamp+"Z");
40          }
41      }
42  }