View Javadoc

1   /*
2    * Zemucan: A Syntax Assistant for DB2
3    * Copyright (C) 2009, 2010 Andres Gomez Casanova
4    *
5    * This file is part of Zemucan.
6    *
7    * Zemucan is free software: you can redistribute it and/or modify
8    * it under the terms of the GNU Lesser General Public License as published by
9    * the Free Software Foundation; either version 3 of the License, or
10   * (at your option) any later version.
11   *
12   * Zemucan is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public License
18   * along with this library; if not, see <http://www.gnu.org/licenses/>.
19   *
20   * Contact:
21   * a n g o c a  at  y a h o o  dot  c o m
22   * Cra. 45 No 61 - 31, Bogota, Colombia.
23   *
24   * Author:   $LastChangedBy: angoca $:
25   * Date:     $LastChangedDate: 2011-03-06 10:15:32 -0500 (dom, 06 mar 2011) $:
26   * Revision: $LastChangedRevision: 1913 $:
27   * URL:      $HeadURL: https://zemucan.svn.sourceforge.net/svnroot/zemucan/branches/zemucan_v1/source-code/executerApi/src/main/java/name/angoca/zemucan/executer/api/AbstractExecuter.java $:
28   */
29  package name.angoca.zemucan.executer.api;
30  
31  import name.angoca.zemucan.AbstractZemucanException;
32  import name.angoca.zemucan.ui.api.OutputWriter;
33  
34  /**
35   * Abstract definition of an Executer.
36   * <p>
37   * <b>Control Version</b>
38   * <p>
39   * <ul>
40   * <li>1.0.0 Class creation.</li>
41   * <li>1.1.0 Abstract Exception.</li>
42   * <li>1.2.0 throws.</li>
43   * <li>1.6.0 Synchronized version with implementation.</li>
44   * </ul>
45   *
46   * @author Andres Gomez Casanova <a
47   *         href="mailto:a n g o c a at y a h o o dot c o m">(AngocA)</a>
48   * @version 1.2.0 2009-09-27
49   * @since 1.0
50   */
51  public abstract class AbstractExecuter {
52  
53      /**
54       * Executes a given command and returns the code that means the execution
55       * state.
56       *
57       * @param command
58       *            Command to execute.
59       * @param writer
60       *            The output's writer.
61       * @return A signal that indicates the state of the command.
62       * @throws AbstractZemucanException
63       *             If there is a problem when writing. If there is a problem
64       *             when executing the command. If there is a null parameter.
65       */
66      public abstract ExecutionState/* ! */execute(final String/* ! */command,
67              final OutputWriter/* ! */writer) throws AbstractZemucanException;
68  
69  }