c:\ibmsdk1.4.1\jre\bin;c:\ibmsdk1.4.1\bin
c:\abc\xyz;%PATH% c:\abc\xyz;%CLASSPATH%
STAF LOCAL PING PING
STAF PING PING PING
STAF LOCAL VAR LIST
STAF LOCAL SERVICE LIST REQUESTS
STAF LOCAL HANDLE QUERY ALL
STAF LOCAL HANDLE QUERY ALL
STAF LOCAL PROCESS QUERY ALL
STAF LOCAL LOG HELP
STAF LOCAL HELP ERROR [Error Number]
STAF LOCAL SHUTDOWN SHUTDOWN
STAF LOCAL PING PING
STAF LOCAL PING PING
STAF LOCAL HELP ERROR 21
staf local var global set HandsOn/Variables/MyVar=xyz
staf local var resolve {HandsOn/Variables/MyVar}Verify that you get "xyz" as the result.
staf local var resolve {HandsOn/Variables/MyVar}What is the result? ___________________________________________________________
staf local var listand verify that HandsOn/Variables/MyVar=xyz is listed.
staf local var helpto see the help for the Variable service.
staf local var resolve {HandsOn/Variables/MyVar}and verify that the response is "xyz".
staf local var resolve {HandsOn/Variables/MyVar}and verify that the response is "xyz". Why is this variable still set to "xyz"?
service event library JSTAF execute C:/STAF/services/STAFEvent.jarSave the changes to the STAF.cfg file.
staf local service listand verify that the Event service is listed.
staf local event versionand verify that the Event service version is 1.3.1.
staf local event helpand verify that you get the Help for the Event Service.
C:/STAF/data/JSTAF/STAFJVM1/JVMLog.lThis file will contain any Java errors/exceptions that the Event service (and any other Java STAF services) encounters. The end of the file should be similar to:
****************************************************************************** *** 20030418-14:40:33 - Start of Log for JVMName: STAFJVM1 *** JVM Executable: java *** JVM Options : none ******************************************************************************
staf local process start command java parms "SimpleTestcase 10" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcases
staf local process query allWhat is the output? __________________________________________________________
staf local process free handle XXwhere XX is the handle that was listed in the process query all request
staf local process query allWhat is the output now, and why has it changed? __________________________________________________________
staf local process start command java parms "STAFTestcase 60" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcasesNote that after you execute the command, the response contains a number, which is the handle number for the STAFTestcase.
staf local monitor helpto familiarize yourself with the Monitor service.
staf local monitor query machine XX handle YYsubstituting your machine's hostname for XX and the handle number for STAFTestcase for YY. Notice that the response you get back is the current information (loop #) which the testcase is publishing. Execute this command several times to get the latest status of the testcase.
staf local log helpto familiarize yourself with the Log Service commands.
staf local log list machine XXwhere XX is your machine's hostname.
staf local process start command java parms "STAFTestcase1 15" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcases
staf local log query machine XX logname STAFTestcase1.logwhere XX is your machine's hostname. You should see 15 Loop # lines.
staf local log query machine XX logname STAFTestcase1.log last 5where XX is your machine's hostname. You should see the last 5 lines in the log file.
staf local process start command java parms "STAFTestcase2 15" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcasesYou should see the testcase behaving as before, but it is now using the STAF Delay service to delay 1 second between each loop.
staf local var helpto familiarize yourself with the Var Service commands.
if ((varResult.rc == 0) && (varResult.result.equals("STAFTestcase3/Terminate"))) { System.exit(0); }In the C:\STAF\testcases directory, type "javac STAFTestcase3.java"
staf local process start command java parms "STAFTestcase3 100" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcasesNote the handle number given to the testcase.
staf local var handle YY set HandsOn/Variables/MyVar=STAFTestcase3/Terminatewhere YY is the handle number for STAFTestcase3.
staf local queue helpto familiarize yourself with the Queue Service commands.
if ((queueResult.rc == 0) && !(queueResult.result.equals(null))) { STAFQueueMessage message = new STAFQueueMessage(queueResult.result); if (message.message.equals("STAFTestcase4/Terminate")) { System.exit(0); } }In the C:\STAF\testcases directory, type "javac STAFTestcase4.java"
staf local process start command java parms "STAFTestcase4 100" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcasesNote the handle number given to the testcase.
staf local queue queue handle YY message STAFTestcase4/Terminatewhere YY is the handle number for STAFTestcase4.
staf XX process start command java parms "STAFTestcase4 100" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcaseswhere XX is the hostname of your neighbor's machine.
staf XX trust listwhere XX is the hostname of your neighbor's machine. Your machine's is not listed, and the Default Trust level is 3.
staf XX process start command java parms "STAFTestcase4 100" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcaseswhere XX is the hostname of your neighbor's machine. This time the testcase should successfully start. Note the handle number given to the testcase.
staf XX queue queue handle YY message STAFTestcase4/Terminatewhere XX is the hostname of your neighbor's machine and YY is the handle number for STAFTestcase4.
service SampleService library JSTAF execute SampleServiceSave the cfg file and restart STAFProc.
LIST [PRINTERS] [MODEMS] QUERY PRINTERYou will need to add a fAddParser and fDeleteParser, and create methods handleAdd and handleDelete. Be sure to update handleHelp to include the Add and Delete options. Compile the service by typing "javac SampleService1.java".| MODEM ADD PRINTER | MODEM DELETE PRINTER | MODEM VERSION HELP