1
2
3
4
5 package com.atlassian.bonnie;
6
7 import org.apache.lucene.analysis.Analyzer;
8 import org.apache.lucene.store.Directory;
9
10 import java.io.File;
11
12
13
14
15 public class LuceneConnectionFactory
16 {
17 private static final LuceneConnectionFactory FACTORY = new LuceneConnectionFactory();
18
19 public static LuceneConnectionFactory get()
20 {
21 return FACTORY;
22 }
23
24
25
26
27
28
29 public ILuceneConnection createLuceneConnection(String path, Analyzer analyzer, ILuceneConnection.Configuration configuration)
30 {
31 return new ConcurrentLuceneConnection(new File(path), analyzer, configuration);
32 }
33
34
35
36
37
38
39 public ILuceneConnection createLuceneConnection(Directory directory, Analyzer analyzer, ILuceneConnection.Configuration configuration)
40 {
41 return new ConcurrentLuceneConnection(directory, analyzer, configuration);
42 }
43
44
45
46
47
48
49 public ILuceneConnection createLuceneConnection(String path, Analyzer analyzer)
50 {
51 return createLuceneConnection(path, analyzer, ILuceneConnection.DEFAULT_CONFIGURATION);
52 }
53
54
55
56
57
58
59 public ILuceneConnection createLuceneConnection(Directory directory, Analyzer analyzer)
60 {
61 return createLuceneConnection(directory, analyzer, ILuceneConnection.DEFAULT_CONFIGURATION);
62 }
63 }