View Javadoc

1   /****************************************************************
2    * Licensed to the Apache Software Foundation (ASF) under one   *
3    * or more contributor license agreements.  See the NOTICE file *
4    * distributed with this work for additional information        *
5    * regarding copyright ownership.  The ASF licenses this file   *
6    * to you under the Apache License, Version 2.0 (the            *
7    * "License"); you may not use this file except in compliance   *
8    * with the License.  You may obtain a copy of the License at   *
9    *                                                              *
10   *   http://www.apache.org/licenses/LICENSE-2.0                 *
11   *                                                              *
12   * Unless required by applicable law or agreed to in writing,   *
13   * software distributed under the License is distributed on an  *
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
15   * KIND, either express or implied.  See the License for the    *
16   * specific language governing permissions and limitations      *
17   * under the License.                                           *
18   ****************************************************************/
19  
20  
21  
22  package org.apache.james.management;
23  
24  /**
25   * Expose spool management functionality through JMX.
26   *
27   * @phoenix:mx-topic name="BayesianAnalyzerAdministration"
28   */
29  public interface BayesianAnalyzerManagementMBean {
30  
31      /**
32       * adds data to existing corpus by importing all the mails contained in the given dir as ham
33       *
34       * @phoenix:mx-operation
35       * @phoenix:mx-description adds data to existing corpus by importing all the mails contained in the given dir as ham
36       *
37       * @param dir full path to the directory containing mail files
38       * @return number of processes mails
39       *
40       * @throws BayesianAnalyzerManagementException
41       */
42      int addHamFromDir(String dir) throws BayesianAnalyzerManagementException;
43  
44      /**
45       * adds data to existing corpus by importing all the mails contained in the given dir as spam
46       *
47       * @phoenix:mx-operation
48       * @phoenix:mx-description adds data to existing corpus by importing all the mails contained in the given dir as spam
49       *
50       * @param dir full path to the directory containing mail files
51       * @return number of processes mails
52       *
53       * @throws BayesianAnalyzerManagementException
54       */
55      int addSpamFromDir(String dir) throws BayesianAnalyzerManagementException;
56  
57      /**
58       * adds data to existing corpus by importing all the mails contained in the given mbox as ham
59       *
60       * @phoenix:mx-operation
61       * @phoenix:mx-description adds data to existing corpus by importing all the mails contained in the given mbox as ham
62       *
63       * @param file path to the mbox file
64       * @return number of processes mails
65       *
66       * @throws BayesianAnalyzerManagementException
67       */
68      int addHamFromMbox(String file) throws BayesianAnalyzerManagementException;
69  
70      /**
71       * adds data to existing corpus by importing all the mails contained in the given mbox as spam
72       *
73       * @phoenix:mx-operation
74       * @phoenix:mx-description adds data to existing corpus by importing all the mails contained in the given mbox as spam
75       *
76       * @param file path to the mbox file
77       * @return number of processes mails
78       *
79       * @throws BayesianAnalyzerManagementException
80       */
81      int addSpamFromMbox(String file) throws BayesianAnalyzerManagementException;
82  
83      /**
84       * exports the corpus to a file
85       *
86       * @phoenix:mx-operation
87       * @phoenix:mx-description exports the corpus to a file
88       *
89       * @param file path to the mbox file
90       *
91       * @throws BayesianAnalyzerManagementException
92       */
93      void exportData(String file) throws BayesianAnalyzerManagementException;
94  
95      /**
96       * imports the corpus from a file
97       *
98       * @phoenix:mx-operation
99       * @phoenix:mx-description imports the corpus from a file
100      *
101      * @param file path to the mbox file
102      *
103      * @throws BayesianAnalyzerManagementException
104      */
105     void importData(String file) throws BayesianAnalyzerManagementException;
106     
107     /**
108      * reset trained data
109      *
110      * @phoenix:mx-operation
111      * @phoenix:mx-description reset trained data
112      *
113      * @throws BayesianAnalyzerManagementException
114      */
115     void resetData() throws BayesianAnalyzerManagementException;
116 }