2011-05-25 11:52:42 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2011 Brian Rosenberger (Brutex Network)
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2011-01-29 19:42:06 +00:00
|
|
|
package net.brutex.xservices.ws;
|
|
|
|
|
|
|
|
import javax.jws.WebMethod;
|
|
|
|
import javax.jws.WebParam;
|
|
|
|
import javax.jws.WebService;
|
2011-09-19 06:54:10 +00:00
|
|
|
import javax.xml.bind.annotation.XmlElement;
|
2011-01-29 19:42:06 +00:00
|
|
|
|
|
|
|
import net.brutex.xservices.types.HostConnection;
|
|
|
|
import net.brutex.xservices.types.ReturnCode;
|
|
|
|
import net.brutex.xservices.util.BrutexNamespaces;
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
2011-05-26 15:02:05 +00:00
|
|
|
* Task execution web service
|
2011-09-19 06:54:10 +00:00
|
|
|
*
|
2011-05-26 15:02:05 +00:00
|
|
|
* @author Brian Rosenberger
|
|
|
|
* @since 0.1.0
|
2011-05-20 17:38:12 +00:00
|
|
|
*
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
|
|
|
public interface ExecuteService {
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
|
|
|
* @param cmd
|
|
|
|
* @param args
|
|
|
|
* @param timeout
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebMethod(operationName = "runCommand")
|
|
|
|
public abstract ReturnCode runCommand(
|
|
|
|
@WebParam(name = "executable") String cmd,
|
|
|
|
@WebParam(name = "argline") String args,
|
|
|
|
@WebParam(name = "timeout") long timeout);
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
|
|
|
* @param cmd
|
|
|
|
* @param args
|
|
|
|
* @param timeout
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebMethod(operationName = "runCommandWithArgs")
|
|
|
|
public abstract ReturnCode runCommandWithArgs(
|
|
|
|
@WebParam(name = "executable") String cmd,
|
|
|
|
@WebParam(name = "arg") String[] args,
|
|
|
|
@WebParam(name = "timeout") long timeout);
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
|
|
|
* @param cmd
|
|
|
|
* @param args
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebMethod(operationName = "runCommandAsync")
|
|
|
|
public abstract ReturnCode runCommandAsync(
|
|
|
|
@WebParam(name = "executable") String cmd,
|
|
|
|
@WebParam(name = "argline") String args);
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
|
|
|
* @param cmd
|
|
|
|
* @param args
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebMethod(operationName = "runCommandAsyncWithArgs")
|
|
|
|
public abstract ReturnCode runCommandAsyncWithArgs(
|
|
|
|
@WebParam(name = "executable") String cmd,
|
|
|
|
@WebParam(name = "arg") String[] args);
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
|
|
|
* @param host
|
|
|
|
* @param cmd
|
|
|
|
* @param timeout
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebMethod(operationName = "runCommandWithSSH")
|
|
|
|
public abstract ReturnCode runCommandWithSSH(
|
2011-04-22 19:44:08 +00:00
|
|
|
@WebParam(name = "host") HostConnection host,
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebParam(name = "command") String cmd,
|
|
|
|
@WebParam(name = "timeout") long timeout);
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
|
|
|
* @param host
|
|
|
|
* @param keyfile
|
|
|
|
* @param cmd
|
|
|
|
* @param timeout
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebMethod(operationName = "runCommandWithSSHKeyAuth")
|
|
|
|
public abstract ReturnCode runCommandWithSSHKeyAuth(
|
2011-04-22 19:44:08 +00:00
|
|
|
@WebParam(name = "host") HostConnection host,
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebParam(name = "keyfile") String keyfile,
|
|
|
|
@WebParam(name = "command") String cmd,
|
|
|
|
@WebParam(name = "timeout") long timeout);
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
|
|
|
* @param host
|
|
|
|
* @param cmd
|
|
|
|
* @param timeout
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebMethod(operationName = "rExec")
|
|
|
|
public abstract ReturnCode rExec(
|
|
|
|
@WebParam(name = "host") HostConnection host,
|
|
|
|
@WebParam(name = "command") String cmd,
|
|
|
|
@WebParam(name = "timeout") long timeout);
|
|
|
|
|
2011-05-20 17:38:12 +00:00
|
|
|
/**
|
|
|
|
* @param host
|
|
|
|
* @param prompt
|
|
|
|
* @param cmd
|
|
|
|
* @param expect
|
|
|
|
* @param timeout
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-29 19:42:06 +00:00
|
|
|
@WebMethod(operationName = "telnet")
|
|
|
|
public abstract ReturnCode runTelnet(
|
|
|
|
@WebParam(name = "host") HostConnection host,
|
|
|
|
@WebParam(name = "prompt") String prompt,
|
|
|
|
@WebParam(name = "command") String cmd,
|
|
|
|
@WebParam(name = "expect") String expect,
|
|
|
|
@WebParam(name = "timeout") long timeout);
|
2011-09-19 06:54:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param script
|
|
|
|
* @throws XServicesFault
|
|
|
|
*/
|
|
|
|
@WebMethod(operationName = "runJavaScript")
|
|
|
|
public abstract void runJScript(
|
|
|
|
@WebParam(name = "script") @XmlElement(required=true) String script) throws XServicesFault;
|
|
|
|
|
2011-01-29 19:42:06 +00:00
|
|
|
|
|
|
|
}
|