01: /*
02: * Copyright (c) 2001 - 2005 ivata limited.
03: * All rights reserved.
04: * -----------------------------------------------------------------------------
05: * ivata groupware may be redistributed under the GNU General Public
06: * License as published by the Free Software Foundation;
07: * version 2 of the License.
08: *
09: * These programs are free software; you can redistribute them and/or
10: * modify them under the terms of the GNU General Public License
11: * as published by the Free Software Foundation; version 2 of the License.
12: *
13: * These programs are distributed in the hope that they will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16: *
17: * See the GNU General Public License in the file LICENSE.txt for more
18: * details.
19: *
20: * If you would like a copy of the GNU General Public License write to
21: *
22: * Free Software Foundation, Inc.
23: * 59 Temple Place - Suite 330
24: * Boston, MA 02111-1307, USA.
25: *
26: *
27: * To arrange commercial support and licensing, contact ivata at
28: * http://www.ivata.com/contact.jsp
29: * -----------------------------------------------------------------------------
30: * $Log: ScriptExecutor.java,v $
31: * Revision 1.2 2005/04/09 17:19:56 colinmacleod
32: * Changed copyright text to GPL v2 explicitly.
33: *
34: * Revision 1.1.1.1 2005/03/10 17:51:37 colinmacleod
35: * Restructured ivata op around Hibernate/PicoContainer.
36: * Renamed ivata groupware.
37: *
38: * Revision 1.4 2004/11/12 18:16:07 colinmacleod
39: * Ordered imports.
40: *
41: * Revision 1.3 2004/11/12 15:57:18 colinmacleod
42: * Removed dependencies on SSLEXT.
43: * Moved Persistence classes to ivata masks.
44: *
45: * Revision 1.2 2004/11/03 16:04:14 colinmacleod
46: * Cosmetic changes.
47: *
48: * Revision 1.1 2004/09/30 15:15:57 colinmacleod
49: * Split off addressbook elements into security subproject.
50: *
51: * Revision 1.1 2004/07/13 19:12:33 colinmacleod
52: * New classes as part of conversion to PicoContainer.
53: * -----------------------------------------------------------------------------
54: */
55: package com.ivata.groupware.admin.script;
56:
57: import com.ivata.groupware.admin.security.server.SecurityServerException;
58: import com.ivata.mask.util.SystemException;
59:
60: /**
61: * @author Colin MacLeod
62: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
63: * @since Apr 9, 2004
64: * @version $Revision: 1.2 $
65: */
66: public interface ScriptExecutor {
67: /**
68: * <p>Execute a command and handle any error that occurs.</p>
69: *
70: * @param scriptName name of the script to be executed.
71: * @param argv command name and all arguments of to be executed. The first
72: * argument should always be the script name
73: * @throws SecurityServerException if the command returns non-zero, or if
74: * there is
75: * an input/output exception.
76: * @return all lines of the program output as a <code>String</code>.
77: */
78: public String exec(final String scriptName, final String[] argv)
79: throws SystemException;
80: }
|