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  package org.apache.jsieve;
21  
22  import org.apache.jsieve.exception.LookupException;
23  
24  /**
25   * <p>Maps Command names to configured Command implementation classes.</p>
26   * <h4>Thread Safety</h4>
27   * <p>
28   * Implementation dependent. {@link CommandManagerImpl} is a thread safe implementation.
29   * </p>
30   */
31  public interface CommandManager {
32  
33      /**
34       * <p>Gets an instance of a command by name.</p>
35       * 
36       * @param name -
37       *            The name of the Command
38       * @return command, not null
39       * @throws LookupException
40       */
41      public ExecutableCommand getCommand(String name) throws LookupException;
42  
43      /**
44       * Method isSupported answers a boolean indicating if a Command name is
45       * configured.
46       * 
47       * @param name -
48       *            The Command name
49       * @return boolean - True if the Command name is configured.
50       */
51      public boolean isCommandSupported(String name);
52  }