View Javadoc
1   /*
2    * Copyright 2012-2017 CodeLibs Project and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.codelibs.fess.es.config.exentity;
17  
18  import java.util.Map;
19  
20  import org.codelibs.fess.crawler.client.CrawlerClientFactory;
21  
22  public interface CrawlingConfig {
23  
24      String getId();
25  
26      String getName();
27  
28      String[] getPermissions();
29  
30      String[] getVirtualHosts();
31  
32      String[] getLabelTypeValues();
33  
34      String getDocumentBoost();
35  
36      String getIndexingTarget(String input);
37  
38      String getConfigId();
39  
40      Integer getTimeToLive();
41  
42      Map<String, Object> initializeClientFactory(CrawlerClientFactory crawlerClientFactory);
43  
44      Map<String, String> getConfigParameterMap(ConfigName name);
45  
46      public enum ConfigType {
47          WEB("W"), FILE("F"), DATA("D");
48  
49          private final String typePrefix;
50  
51          ConfigType(final String typePrefix) {
52              this.typePrefix = typePrefix;
53          }
54  
55          public String getTypePrefix() {
56              return typePrefix;
57          }
58  
59          public String getConfigId(final String id) {
60              if (id == null) {
61                  return null;
62              }
63              return typePrefix + id.toString();
64          }
65      }
66  
67      public enum ConfigName {
68          CLIENT, XPATH, META, VALUE, SCRIPT, FIELD, CONFIG;
69      }
70  }