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  package org.apache.mailet;
22  
23  /**
24   * A matcher configuration object used by the mailet container to pass
25   * information to a matcher during initialization.
26   * <p>
27   * The configuration information consists of the matcher's condition string,
28   * and a MailetContext object which allows the matcher to interact with the
29   * mailet container.
30   */
31  public interface MatcherConfig {
32  
33      /**
34       * The condition defined for this matcher.
35       * <p>
36       * For example, the SenderIs matcher might be configured as
37       * "SenderIs=admin@localhost", in which case the condition would be
38       * "admin@localhost".
39       *
40       * @return a String containing the value of the initialization parameter
41       */
42      String getCondition();
43  
44      /**
45       * Returns a reference to the MailetContext in which the matcher is executing
46       *
47       * @return a MailetContext object which can be used by the matcher
48       *      to interact with the mailet container
49       */
50      MailetContext getMailetContext();
51  
52      /**
53       * Returns the name of this matcher instance. The name may be provided via server
54       * administration, assigned in the application deployment descriptor, or, for
55       * an unregistered (and thus unnamed) matcher instance, it will be the matcher's
56       * class name.
57       *
58       * @return the name of the matcher instance
59       */
60      String getMatcherName();
61  }