1 /********************************************************************
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Library General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 02111-1307, USA.
20 * @author: Copyright (C) Tim Carver
22 ********************************************************************/
25 package ext.jemboss.soap;
30 import ext.jemboss.JembossParams;
34 * Executes an application on a server
37 public class JembossRun
41 private String statusmsg;
42 /** status of the request */
43 private String status;
45 private Hashtable proganswer;
49 * @param appl defining command
50 * @param options defining options
51 * @param filesToMove Hashtable of filenames and contents
52 * @param mysettings jemboss properties
53 * @throws JembossSoapException if authentication fails
56 public JembossRun(String appl, String options, Hashtable filesToMove,
57 JembossParams mysettings) throws JembossSoapException
62 Vector params = new Vector();
63 params.addElement(appl);
65 //construct a full options string
66 fulloptions = "mode="+mysettings.getCurrentMode()+" "+options;
67 // if (mysettings.getUseX11())
68 // fulloptions = "display="+mysettings.getX11display()+" "+fulloptions;
69 params.addElement(fulloptions);
72 params.addElement(filesToMove);
77 eRun = new PrivateRequest(mysettings,
80 catch (JembossSoapException e)
82 throw new JembossSoapException("Authentication Failed");
85 proganswer = eRun.getHash();
86 status = proganswer.get("status").toString();
87 statusmsg = proganswer.get("msg").toString();
89 proganswer.remove("status"); // delete the status/msg
90 proganswer.remove("msg");
96 * The status of the request
97 * @return 0 for success
100 public String getStatus()
107 * A status message or description of a error
108 * @return status message
111 public String getStatusMsg()
118 * Get a Hashtable of filenames and their contents generated by
119 * running the application
123 public Hashtable hash()
131 * Get a result from the result Hashtable
132 * @param key key into the results Hashtable
133 * @return element in the results Hashtable
136 public Object get(Object key)
138 return proganswer.get(key);