dsnserver
Class XmlRpcLoadFile

java.lang.Object
  extended by dsnserver.XmlRpcLoadFile
All Implemented Interfaces:
org.apache.xmlrpc.AuthenticatedXmlRpcHandler

public class XmlRpcLoadFile
extends java.lang.Object
implements org.apache.xmlrpc.AuthenticatedXmlRpcHandler

A function wich is used as a XmlRpc function. It sends a .hex file to the BTnode. The hex. file has to be in the folder /hex.

Author:
kaltt

Field Summary
(package private)  Communication myComm
           
(package private) static boolean ready
           
(package private)  org.apache.xmlrpc.WebServer server
           
(package private) static java.lang.String transmission_err
           
(package private) static boolean transmission_failed
           
(package private) static boolean transmission_ok
           
 
Constructor Summary
XmlRpcLoadFile(Communication comm, org.apache.xmlrpc.WebServer server)
           
 
Method Summary
 boolean checkPassword(java.lang.String user, java.lang.String password)
           
protected  java.lang.Object execute(java.lang.String method, java.util.Vector v)
           
 java.lang.Object execute(java.lang.String method, java.util.Vector v, java.lang.String user, java.lang.String password)
           
 java.util.Vector loadFile(java.lang.String filename, java.lang.String type)
          It is the function which is called by the XmlRpcServer.
private  java.util.Vector loadFileLocal(java.lang.String filename, java.lang.String type)
          It starts the upload of a .hex file which is in the folder /hex.
static void setReady()
          For setting the variable ready.
static void setTransmission_failed(java.lang.String line)
          For setting the variable transmission_failed and transmission_err.
static void setTransmission_ok(java.lang.String line)
          For setting the variable transmission_ok and transmission_err.
private  void waitmillis(long millis)
          For waiting millis milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

org.apache.xmlrpc.WebServer server

myComm

Communication myComm

ready

static boolean ready

transmission_ok

static boolean transmission_ok

transmission_failed

static boolean transmission_failed

transmission_err

static java.lang.String transmission_err
Constructor Detail

XmlRpcLoadFile

public XmlRpcLoadFile(Communication comm,
                      org.apache.xmlrpc.WebServer server)
Method Detail

waitmillis

private void waitmillis(long millis)
For waiting millis milliseconds.


setReady

public static void setReady()
For setting the variable ready. It is used of the class CmdParserLoadFile and is set when the sentense "ready to receive hexfile, press enter to quit." is given out after the BTnode command loadhex.


setTransmission_ok

public static void setTransmission_ok(java.lang.String line)
For setting the variable transmission_ok and transmission_err. It is used of the class CmdParserLoadFile and is set when everything was seccessfull after the file was load up to the BTnode. (Is set if ":LH completed: ..." was written out by the BTnode)


setTransmission_failed

public static void setTransmission_failed(java.lang.String line)
For setting the variable transmission_failed and transmission_err. It is used of the class CmdParserLoadFile and is set when a error occured during the file upload to the BTnode. (Is set if ":LH failed: ..." was written out by the BTnode)


loadFile

public java.util.Vector loadFile(java.lang.String filename,
                                 java.lang.String type)
It is the function which is called by the XmlRpcServer. It is calling the function loadFileLocal.

Parameters:
String - filename the name of the file you will upload.
String type 0=dsn, 1=tg
Returns:
Vector result Key = "err" Value = the value of transmission_err

loadFileLocal

private java.util.Vector loadFileLocal(java.lang.String filename,
                                       java.lang.String type)
It starts the upload of a .hex file which is in the folder /hex. (if there occures a read error you have change something in the loop "while(!transmission_failed && ((line = input.readLine()) != null)){")

Parameters:
String - filename the name of the file you will upload to the GUI node.
String type 0=dsn, 1=tg
Returns:
Vector result Key = "err" Value = the value of transmission_err

execute

public java.lang.Object execute(java.lang.String method,
                                java.util.Vector v,
                                java.lang.String user,
                                java.lang.String password)
Specified by:
execute in interface org.apache.xmlrpc.AuthenticatedXmlRpcHandler

execute

protected java.lang.Object execute(java.lang.String method,
                                   java.util.Vector v)

checkPassword

public boolean checkPassword(java.lang.String user,
                             java.lang.String password)