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.james.api.domainlist;
22  
23  import java.util.List;
24  
25  /**
26   * This interface provide should be implementated by services which
27   * offer domains for which email will accepted
28   *
29   */
30  public interface DomainList {
31  
32      /**
33       * The component role used by components implementing this service
34       */
35      public final static String ROLE ="org.apache.james.api.domainlist.DomainList";
36      
37      /**
38       * Return List of domains which should be used as localdomains. Return null if no
39       * domains were found
40       * 
41       * @return domains
42       */
43      public List getDomains();
44      
45      /**
46       * Return true if the domain exists in the service 
47       * 
48       * @param domain the domain
49       * @return true if the given domain exists in the service
50       */
51      public boolean containsDomain(String domain);
52  
53      /**
54       * Set to true to autodetect the hostname of the host on which
55       * james is runnin, and add this to the domain service 
56       * Default is true
57       * 
58       * @param autodetect set to false for disable
59       */
60      public void setAutoDetect(boolean autodetect);
61      
62      
63      /**
64       * Set to true to lookup the ipaddresses for each given domain
65       * and add these to the domain service 
66       * Default is true
67       * 
68       * @param autodetectIP set to false for disable
69       */
70      public void setAutoDetectIP(boolean autodetectIP);
71      
72  }