edu.washington.cs.pl_if.rpc
Interface RpcFunctions

All Known Implementing Classes:
RpcClient, RpcServerFunctionsImpl

public interface RpcFunctions


Field Summary
static String CONNECT_FAILED_POLICY_ANY
           
static String CONNECT_FAILED_POLICY_CLOSEST
           
static String CONNECT_FAILED_POLICY_SITE
           
static String PLANET_LAB_ADD_HOSTS_TO_SLICE
           
static String PLANET_LAB_ADD_RANDOM_HOSTS_FROM_PLC
           
static String PLANET_LAB_ADD_RANDOM_SITES_FROM_PLC
           
static String PLANET_LAB_CONNECT_TO_HOST
          "PlanetLab.connectToHost"
static String PLANET_LAB_DOWNLOAD
           
static String PLANET_LAB_FETCH_COMON_DATA
           
static String PLANET_LAB_GET_ALL_HOSTS
           
static String PLANET_LAB_GET_AVAILABLE_HOSTS
           
static String PLANET_LAB_GET_COMMAND
           
static String PLANET_LAB_GET_COMMAND_OVERVIEW
           
static String PLANET_LAB_GET_COMMAND_STATS
           
static String PLANET_LAB_GET_COMMAND_STATUS_OVERVIEW
           
static String PLANET_LAB_GET_COMON_PROGRESS
           
static String PLANET_LAB_GET_HOST_STATS
           
static String PLANET_LAB_GET_HOST_STATUS_OVERVIEW
           
static String PLANET_LAB_GET_HOSTNAME
           
static String PLANET_LAB_GET_HOSTS_NOT_IN_SLICE
           
static String PLANET_LAB_KILL_COMMAND
           
static String PLANET_LAB_QUEUE_COMMAND
           
static String PLANET_LAB_READ_CONSOLE
           
static String PLANET_LAB_SHUTDOWN
           
static String PLANET_LAB_TOTAL_COMMAND_NUM
           
static String PLANET_LAB_TOTAL_HOST_NUM
           
static String PLANET_LAB_UPLOAD
           
static String SPECIAL_COMMAND_DOWNLOAD_DIR
           
static String SPECIAL_COMMAND_UPLOAD_DIR
           
 
Method Summary
 int addHostsToSlice(Map auth, Object[] hosts)
           
 int addRandomHostsFromPLC(Map auth, int numberOfHosts)
          Requests "numberOfHosts" random hosts from PLC and tries to connect to them.
 int addRandomSitesFromPLC(Map auth, int numberOfSites)
          Requests "numberOfSites" random sites from PLC and tries to connect to one random host in each site .
 double commandCompleted(Map auth, int commandId)
          Returns what percentage of hosts that has completed command "commandId"
 int connectToHost(Map auth, String hostname)
          Request the controller to connect to host hostname.
 int download(Map auth, String remotePath, String localPath, String fileFilter, String localNamingType)
           
 int fetchCoMonData(Map auth)
           
 Object[] getAllHosts(Map auth)
           
 Object[] getAvailableHosts(Map auth)
           
 String getCommand(Map auth, int commandId)
          return the command associated with a certain commmandId
 Object[] getCommandOverview(Map auth, int commandId)
           
 Object[] getCommandStats(Map auth, int connectionId)
           
 Object[] getCommandStatusOverview(Map auth)
          used by the gui to get a summary of the status of each command
 double getCoMonProgress(Map auth)
           
 Object[] getConnectedHosts(Map auth)
          Queries the controller for the list of nodes currently connected to Lazy wrapper for PlanetLab.getSuccessfulHosts(auth,0)
 Map getExitStats(Map auth, int commandId)
          returns a map of exitcode=>count
 String getHostname(Map auth, int connectionId)
          returns the hostname given a connectionId
 Object[] getHostsNotInSlice(Map auth)
           
 Object[] getHostStats(Map auth, Object[] hosts)
           
 Object[] getHostStatusOverview(Map auth)
          used by the gui to get a summary of the status of each host
 Object[] getSuccessfulHosts(Map auth, int commandId)
          Queries the controller for a list of all nodes that succesfully have completed all commands.
 int kill(Map auth, int commandId)
           
 int queueCommand(Map auth, String command)
          lazy wrapper for queueCommand(Map auth, String command, 0, false), Running "command" with no timeout and continuing with subsequent commands even if the command returns a non non-zero exit code
 int queueCommand(Map auth, String command, double timeout)
          lazy wrapper for queueCommand(Map auth, String command, double timeout, false), Running the command until it completes, or gets killed because the timeout expired.
 int queueCommand(Map auth, String command, double timeout, boolean stopOnError)
          Add the command "command" to the queue of command to execute Running the command until it completes, or gets killed because the timeout expired.
 int queueCommand(Map auth, String command, double timeout, int stopOnError)
           
 int queueCommand(Map auth, String command, int timeout)
          lazy wrapper for queueCommand(Map auth, String command, double timeout, false), Running the command until it completes, or gets killed because the timeout expired.
 Object[] readConsole(Map auth, int connectionId, int fromRow)
          Reads the consle from ssh connection,
 int shutdown(Map auth)
          stops the RPC Server and closes all current ssh connections, including any running scp transfers
 int totalCommandNum(Map auth)
          returns the total number of commands that have been queued on the controller
 int totalHostNum(Map auth)
          returns the total number of hosts assisated with the system
 int upload(Map auth, String path, double timeout, boolean stopOnError)
          Uploads a local file or directory to all hosts The upload is implemented as follows: First a md5 checksum is calculated of the file or on all files in the specified directory and subdirectories Secondly md5s are calculated on the destination to check if the file(s) already exists.
 int upload(Map auth, String path, double timeout, int stopOnError)
           
 

Field Detail

PLANET_LAB_CONNECT_TO_HOST

static final String PLANET_LAB_CONNECT_TO_HOST
"PlanetLab.connectToHost"

See Also:
Constant Field Values

PLANET_LAB_TOTAL_COMMAND_NUM

static final String PLANET_LAB_TOTAL_COMMAND_NUM
See Also:
Constant Field Values

PLANET_LAB_GET_HOST_STATUS_OVERVIEW

static final String PLANET_LAB_GET_HOST_STATUS_OVERVIEW
See Also:
Constant Field Values

PLANET_LAB_GET_COMMAND_STATUS_OVERVIEW

static final String PLANET_LAB_GET_COMMAND_STATUS_OVERVIEW
See Also:
Constant Field Values

PLANET_LAB_GET_COMMAND_OVERVIEW

static final String PLANET_LAB_GET_COMMAND_OVERVIEW
See Also:
Constant Field Values

PLANET_LAB_TOTAL_HOST_NUM

static final String PLANET_LAB_TOTAL_HOST_NUM
See Also:
Constant Field Values

PLANET_LAB_READ_CONSOLE

static final String PLANET_LAB_READ_CONSOLE
See Also:
Constant Field Values

PLANET_LAB_GET_HOSTNAME

static final String PLANET_LAB_GET_HOSTNAME
See Also:
Constant Field Values

PLANET_LAB_SHUTDOWN

static final String PLANET_LAB_SHUTDOWN
See Also:
Constant Field Values

PLANET_LAB_QUEUE_COMMAND

static final String PLANET_LAB_QUEUE_COMMAND
See Also:
Constant Field Values

PLANET_LAB_GET_COMMAND

static final String PLANET_LAB_GET_COMMAND
See Also:
Constant Field Values

PLANET_LAB_ADD_RANDOM_HOSTS_FROM_PLC

static final String PLANET_LAB_ADD_RANDOM_HOSTS_FROM_PLC
See Also:
Constant Field Values

PLANET_LAB_ADD_RANDOM_SITES_FROM_PLC

static final String PLANET_LAB_ADD_RANDOM_SITES_FROM_PLC
See Also:
Constant Field Values

PLANET_LAB_UPLOAD

static final String PLANET_LAB_UPLOAD
See Also:
Constant Field Values

PLANET_LAB_DOWNLOAD

static final String PLANET_LAB_DOWNLOAD
See Also:
Constant Field Values

SPECIAL_COMMAND_UPLOAD_DIR

static final String SPECIAL_COMMAND_UPLOAD_DIR
See Also:
Constant Field Values

SPECIAL_COMMAND_DOWNLOAD_DIR

static final String SPECIAL_COMMAND_DOWNLOAD_DIR
See Also:
Constant Field Values

CONNECT_FAILED_POLICY_SITE

static final String CONNECT_FAILED_POLICY_SITE
See Also:
Constant Field Values

CONNECT_FAILED_POLICY_ANY

static final String CONNECT_FAILED_POLICY_ANY
See Also:
Constant Field Values

CONNECT_FAILED_POLICY_CLOSEST

static final String CONNECT_FAILED_POLICY_CLOSEST
See Also:
Constant Field Values

PLANET_LAB_GET_COMMAND_STATS

static final String PLANET_LAB_GET_COMMAND_STATS
See Also:
Constant Field Values

PLANET_LAB_KILL_COMMAND

static final String PLANET_LAB_KILL_COMMAND
See Also:
Constant Field Values

PLANET_LAB_GET_HOSTS_NOT_IN_SLICE

static final String PLANET_LAB_GET_HOSTS_NOT_IN_SLICE
See Also:
Constant Field Values

PLANET_LAB_ADD_HOSTS_TO_SLICE

static final String PLANET_LAB_ADD_HOSTS_TO_SLICE
See Also:
Constant Field Values

PLANET_LAB_FETCH_COMON_DATA

static final String PLANET_LAB_FETCH_COMON_DATA
See Also:
Constant Field Values

PLANET_LAB_GET_COMON_PROGRESS

static final String PLANET_LAB_GET_COMON_PROGRESS
See Also:
Constant Field Values

PLANET_LAB_GET_HOST_STATS

static final String PLANET_LAB_GET_HOST_STATS
See Also:
Constant Field Values

PLANET_LAB_GET_ALL_HOSTS

static final String PLANET_LAB_GET_ALL_HOSTS
See Also:
Constant Field Values

PLANET_LAB_GET_AVAILABLE_HOSTS

static final String PLANET_LAB_GET_AVAILABLE_HOSTS
See Also:
Constant Field Values
Method Detail

addRandomHostsFromPLC

int addRandomHostsFromPLC(Map auth,
                          int numberOfHosts)
Requests "numberOfHosts" random hosts from PLC and tries to connect to them. The connect failed policy used is "any"

Parameters:
auth - authentication information that is matching the information on the server. The values checked are Username and AuthString. These can be provided in clear text or as md5 hashes. If md5 hashes are used, the Username field should contain the md5 hash of the username string, the AuthString field should contain the md5 hash of the username string concatenated with the password string. The use of md5 hashes makes it difficult for an attacker to get the password by monitoring the network. Keep in mind that the password can be extracted from the md5 hashes by an attacker by using a dictonary.
numberOfHosts - number of hosts to request
Returns:
number of hosts actually added, this can be less that "numberOfHosts" if, the total number of hosts available is less than "numberOfHosts"

addRandomSitesFromPLC

int addRandomSitesFromPLC(Map auth,
                          int numberOfSites)
Requests "numberOfSites" random sites from PLC and tries to connect to one random host in each site . The connect failed policy is "site" meaning that if the connect failed, the controller will try another host in the same site

Parameters:
auth - authentication information that is matching the information on the server
numberOfSites - number of sites to request
Returns:
number of sites actually added, this can be less that "numberOfSites" if, the total number of sites available is less than "numberOfSites"

commandCompleted

double commandCompleted(Map auth,
                        int commandId)
Returns what percentage of hosts that has completed command "commandId"

Parameters:
auth - authentication information that is matching the information on the server
commandId - the id of the command to query
Returns:
double between 0 and 1, 1 meaning that all hosts have completed the command

connectToHost

int connectToHost(Map auth,
                  String hostname)
Request the controller to connect to host hostname. If the ip accociated with the hostname is recognized by PLC, information from PLC, like bandwidth cap, will be associated with the connection If any commands have bee queued on other hosts previously, those command will be queued on this hosts as well

Parameters:
auth - authentication information that is matching the information on the server
hostname - hostname or ip address to connect to
Returns:
the connection id of the host (used to check host progress), or -1 on authentication failure

getConnectedHosts

Object[] getConnectedHosts(Map auth)
Queries the controller for the list of nodes currently connected to Lazy wrapper for PlanetLab.getSuccessfulHosts(auth,0)

Parameters:
auth - authentication
Returns:
a String array of hostnames

getSuccessfulHosts

Object[] getSuccessfulHosts(Map auth,
                            int commandId)
Queries the controller for a list of all nodes that succesfully have completed all commands. The returned hosts must have completed command commandId with 0 exit status

Parameters:
auth - authentication info
commandId - the command that must have completed succesfully, or -1 for all commands
Returns:
a String of hostnames

getCommand

String getCommand(Map auth,
                  int commandId)
return the command associated with a certain commmandId

Parameters:
auth - authentication information that is matching the information on the server
commandId -
Returns:
the command associated with the commandId, or -1 on authentication failure

getCommandStatusOverview

Object[] getCommandStatusOverview(Map auth)
used by the gui to get a summary of the status of each command

Parameters:
auth -
Returns:

getCommandOverview

Object[] getCommandOverview(Map auth,
                            int commandId)

getExitStats

Map getExitStats(Map auth,
                 int commandId)
returns a map of exitcode=>count

Parameters:
auth - authentication information that is matching the information on the server
commandId - the id of the command to query
Returns:
counts of how many hosts that have each exitcode

getHostname

String getHostname(Map auth,
                   int connectionId)
returns the hostname given a connectionId

Parameters:
auth - authentication information that is matching the information on the server
connectionId - the connectionId of the host to get the hostname of
Returns:
The hostname

getHostStatusOverview

Object[] getHostStatusOverview(Map auth)
used by the gui to get a summary of the status of each host

Parameters:
auth -
Returns:

queueCommand

int queueCommand(Map auth,
                 String command)
lazy wrapper for queueCommand(Map auth, String command, 0, false), Running "command" with no timeout and continuing with subsequent commands even if the command returns a non non-zero exit code

Parameters:
auth - authentication information that is matching the information on the server
command - the command to queue
Returns:
the index of the command, used to get for example exit-status when the command has completed, or -1 on authentication failure

queueCommand

int queueCommand(Map auth,
                 String command,
                 double timeout)
lazy wrapper for queueCommand(Map auth, String command, double timeout, false), Running the command until it completes, or gets killed because the timeout expired. Subsequent commands will be run even if the command returns a non non-zero exit code

Parameters:
auth - authentication information that is matching the information on the server
command - the command to queue
timeout - the maximum number of seconds (or fractions of a second) the command can run, after this the command will get killed
Returns:
the index of the command, used to get for example exit-status when the command has completed, or -1 on authentication failure

queueCommand

int queueCommand(Map auth,
                 String command,
                 double timeout,
                 boolean stopOnError)
Add the command "command" to the queue of command to execute Running the command until it completes, or gets killed because the timeout expired. Subsequent commands will not run if stop on error is true

Parameters:
auth - authentication information that is matching the information on the server
command - the command to queue
timeout - the maximum number of seconds (or fractions of a second) the command can run, after this the command will get killed
stopOnError - controller if execution of commands should stop if the commands exit with a non-zero exit code. If stop on error is enabled execution is halted until the user override.
Returns:
the index of the command, used to get for example exit-status when the command has completed, or -1 on authentication failure

queueCommand

int queueCommand(Map auth,
                 String command,
                 double timeout,
                 int stopOnError)

queueCommand

int queueCommand(Map auth,
                 String command,
                 int timeout)
lazy wrapper for queueCommand(Map auth, String command, double timeout, false), Running the command until it completes, or gets killed because the timeout expired. Subsequent commands will be run even if the command returns a non non-zero exit code

Parameters:
auth - authentication information that is matching the information on the server
command - the command to queue
timeout - the maximum number of seconds the command can run, after this the command will get killed
Returns:
the index of the command, used to get for example exit-status when the command has completed, or -1 on authentication failure

readConsole

Object[] readConsole(Map auth,
                     int connectionId,
                     int fromRow)
Reads the consle from ssh connection,

Parameters:
auth - authentication information that is matching the information on the server
connectionId - The connection ID of the host to read the console of
fromRow - Row to start reading from, useful when only new information is interesting, like for example in a terminal like window
Returns:
Object[], each object in the array an instance of Map, where each Map contrains information about one row. "line"=>String, the output line "command"=> String, the command the resulted in the line "stderr"=> Boolean, true if the line was read from stderr, false if read from stdout "time"=>Double, the number of seconds since application start the line was received "execution_time"=>Double, number of seconds the command had been running when the line was received

shutdown

int shutdown(Map auth)
stops the RPC Server and closes all current ssh connections, including any running scp transfers

Parameters:
auth - authentication information that is matching the information on the server
Returns:
0 on successful shutdown and -1 on authentication failure

kill

int kill(Map auth,
         int commandId)

totalCommandNum

int totalCommandNum(Map auth)
returns the total number of commands that have been queued on the controller

Parameters:
auth - authentication information that is matching the information on the server
Returns:
number of commands executed + in queue

totalHostNum

int totalHostNum(Map auth)
returns the total number of hosts assisated with the system

Parameters:
auth - authentication information that is matching the information on the server
Returns:
total number of hosts

upload

int upload(Map auth,
           String path,
           double timeout,
           boolean stopOnError)
Uploads a local file or directory to all hosts The upload is implemented as follows: First a md5 checksum is calculated of the file or on all files in the specified directory and subdirectories Secondly md5s are calculated on the destination to check if the file(s) already exists. If the md5 check fails, or the file doesn't exist, the file is uploaded. Thirdly a second md5 check is done on the uploaded file, if this fails the file is uploaded-and-checked two more times. If the md5 check fails the third time the command fail and execution of subsequent commands on the host will stop. All files are copied to ~/dir_name on the remote hosts, if for example /homes/isdal/bandwidth_experiment/bw_planetlab_bin/ is uplaoded, the directory ~/bw_planetlab_bin will be created on the remote hosts and all files will copied there

Parameters:
auth - authentication information that is matching the information on the server
path - the local directory to upload
timeout - maximum time allowed for the upload
stopOnError - stop exection on command if the upload was unsuccessful
Returns:
0 if the local directory exists, 1 if the local directory doesn't exist or is unreachable, -1 on authentication failure

upload

int upload(Map auth,
           String path,
           double timeout,
           int stopOnError)

getCommandStats

Object[] getCommandStats(Map auth,
                         int connectionId)

download

int download(Map auth,
             String remotePath,
             String localPath,
             String fileFilter,
             String localNamingType)

addHostsToSlice

int addHostsToSlice(Map auth,
                    Object[] hosts)

getHostsNotInSlice

Object[] getHostsNotInSlice(Map auth)

getAllHosts

Object[] getAllHosts(Map auth)

getAvailableHosts

Object[] getAvailableHosts(Map auth)

fetchCoMonData

int fetchCoMonData(Map auth)

getCoMonProgress

double getCoMonProgress(Map auth)

getHostStats

Object[] getHostStats(Map auth,
                      Object[] hosts)