Source code: com/telefonicasoluciones/search/server/HLJob.java
1 /*
2 * HLJob.java
3 *
4 * Created on 14 de mayo de 2002, 11:54
5 */
6
7 package com.telefonicasoluciones.search.server;
8
9 /**
10 *
11 * @author Ricardo Lorenzo
12 * @version 1.0
13 */
14 import java.util.*;
15 import com.telefonicasoluciones.search.server.util.*;
16
17 public class HLJob extends TimerTask {
18 private String url;
19 private HLConfig config;
20
21 /*
22 * Crea una nueva tarea
23 */
24 public HLJob(HLConfig newConfig, String newUrl) {
25 config = newConfig;
26 url = newUrl;
27 }
28 public void run() {
29 try {
30 HLHandler hls = new HLHandler(config);
31 hls = hls.getInstance(null);
32 HTTPClient session = new HTTPClient(HTTPClient.getServerString(url));
33 session.load(HTTPClient.getDocumentString(url));
34 hls.setSession(session);
35 HLIndexThread hilo = new HLIndexThread(hls);
36 hilo.deleteOldDocuments(true);
37 hilo.start();
38 //timer.cancel();
39 } catch(Exception e) {}
40 }
41 }