Software Testing Automation Framework (STAF) V3 Migration Guide
April 23, 2005
The intended reader for this document is anyone who is currently using STAF V2 and who will be migrating to STAF V3.
STAF has remained basically backward compatible for 7 years and over 25 releases (since STAF V1.0 was first made available in April 1998). To further advance STAF and to accomplish some features requested by our customers, STAF V3 will not be fully backward compatible with STAF V2 / V1. Our intention is to make all the backward incompatible changes in STAF V3.0 so that future versions of STAF will be backwards compatible with STAF V3.0 and later.
End of service for all STAF V2 releases is planned for April 21, 2006. As of April 21, 2006, we will no longer fix bugs in STAF V2 and will not release any new versions of STAF V2 (though we will continue to try to answer STAF V2 questions). Note that since STAF is open source, you can fix a problem in STAF V2 yourself. But, to have complete support from the STAF Development team, move to STAF V3.
New STAF clients should start with the latest STAF V3 release. Existing STAF V2 clients should wait for a break in their test cycles to migrate to STAF V3, but we encourage our clients to migrate as soon as realistically possible to take advantage of the many new features and capabilities in STAF V3.
Upgrading from STAF V2 to STAF V3 is supported (instead of having to uninstall STAF V2 before installing STAF V3). It is recommended, if possible, that when upgrading to STAF V3, you upgrade all of your STAF machines to V3 at the same time.
If you register any external STAF services with STAF V3, you will have to install a version of the external STAF service that supports STAF V3. Note that STAF services that support V2 don't work with STAF V3 and vice versa because of different service interface levels. For example, to run the STAX service on a STAF V3 machine, you must have STAX V3 installed as an earlier version of STAX such as V1.5.5 will not work with STAF V3.
To help current STAF V2 customers prepare for migrating from STAF V2 to V3, we provided a new DIAG (Diagnostics) internal service in STAF V2.6 and instrumented all requests whose syntax and/or results will be changing in STAF V3 so that clients can identify which test cases, STAX jobs, applications, and services that they have written will need to be updated to work with STAF V3.
Use the migration data provided by enabling the DIAG service on your STAF V2 machines to gauge how much migration work will be required. You will need to enable diagnostics on all machines involved in running a test, STAX job, etc., and then collect the diagnostics information from all machines after running the test. See "Appendix A: STAF V3 Migration Diagnostic Triggers in STAF V2.6.x" for more information.
You will probably need to make updates to existing STAF-enabled testcases, STAX jobs, custom services, etc., due to changes in the syntax and results for some STAF requests, service interface changes, etc.
For example, if you wanted to gather STAF V3 migration diagnostics data for a particular STAX job, you would enable diagnostics on the STAX service machine (and possibly on other STAF machines as well if you are running STAF-enabled testcases on other machines in the STAX job) and then run the job. When the job is complete, you can then disable diagnostics.
For example, you can list the sources for the diagnostics information. If you run a STAX job, you could see information like the following.
STAF stax1 DIAG LIST SOURCES Response -------- From Date/Time : 20041108-13:15:27 To Date/Time : 20041108-13:20:39 Elapsed Time : 00:05:12 Number of Sources : 4 2807;STAX/JobMonitor/lucas/2;lucas.austin.ibm.com;28 658;STAX/Job/2;lucas.austin.ibm.com;27 460;STAX/JobMonitor/Extension/STAFCmdTable;lucas.austin.ibm.com;30 44;STAX/JobMonitor/Extension/ProcessTable;lucas.austin.ibm.com;29You can ignore STAF V3 migration diagnostics from sources like STAX/JobMonitor/... because STAF Development is responsible for updating the STAX Monitor to work with STAF V3. You'll want to look at the triggers generated by the source of your STAX job, which in this case, is STAX/Job/2;lucas.austin.ibm.com;27 which represents the handle name, the machine, and the handle number. For example, you can list all diagnostics for this source and sort by trigger (or count).
STAF stax1 DIAG LIST SOURCE STAX/Job/2;lucas.austin.ibm.com;27 SORTBYTRIGGER Response -------- From Date/Time : 20041108-13:15:27 To Date/Time : 20041108-13:21:19 Elapsed Time : 00:05:52 Source : STAX/Job/2;lucas.austin.ibm.com;27 Number of Triggers: 37 19;STAF/V3.0-Mig/FS DELETE (No IGNOREERRORS) 4;STAF/V3.0-Mig/FS LIST 8;STAF/V3.0-Mig/HANDLE QUERY 1;STAF/V3.0-Mig/MISC MACHINE 4;STAF/V3.0-Mig/MISC TRACE LIST 15;STAF/V3.0-Mig/MISC TRACE 4;STAF/V3.0-Mig/MONITOR LIST 3;STAF/V3.0-Mig/MONITOR QUERY 10;STAF/V3.0-Mig/MONITOR SET 2;STAF/V3.0-Mig/PROCESS FREE ALL|WORKLOAD 1;STAF/V3.0-Mig/PROCESS NOTIFY LIST 4;STAF/V3.0-Mig/PROCESS QUERY 15;STAF/V3.0-Mig/PROCESS START WAIT 1;STAF/V3.0-Mig/PROCESS STOP ALL|WORKLOAD 545;STAF/V3.0-Mig/QUEUE GET|PEEK 1;STAF/V3.0-Mig/RESPOOL LIST 1;STAF/V3.0-Mig/RESPOOL QUERY 1;STAF/V3.0-Mig/SEM EVENT DELETE 2;STAF/V3.0-Mig/SEM EVENT POST|PULSE 1;STAF/V3.0-Mig/SEM EVENT QUERY 1;STAF/V3.0-Mig/SEM EVENT RESET 1;STAF/V3.0-Mig/SEM EVENT WAIT 2;STAF/V3.0-Mig/SEM LIST 25;STAF/V3.0-Mig/SEM MUTEX DELETE 2;STAF/V3.0-Mig/SEM MUTEX QUERY 14;STAF/V3.0-Mig/SEM MUTEX RELEASE 13;STAF/V3.0-Mig/SEM MUTEX REQUEST 2;STAF/V3.0-Mig/SHUTDOWN NOTIFY LIST 1;STAF/V3.0-Mig/STAX LIST 1;STAF/V3.0-Mig/STAX QUERY 26;STAF/V3.0-Mig/VAR DELETE 6;STAF/V3.0-Mig/VAR GET 5;STAF/V3.0-Mig/VAR LIST 4;STAF/V3.0-Mig/VAR RESOLVE (Multiple) 25;STAF/V3.0-Mig/VAR RESOLVE 34;STAF/V3.0-Mig/VAR SET 10;STAF/V3.0-Mig/ZIP LIST
You'll probably want to redirect the diagnostics information from each machine to a file:
STAF stax1 DIAG LIST SOURCE STAX/Job/2;lucas.austin.ibm.com;27 SORTBYTRIGGER > C:\client1DiagForSTAXJob1.txt
Here is a list of some of the major enhancements in STAF V3:
The following sections provide a more in-depth description for each enhancement.
5.1 Communication Interface Enhancements
Many communication interface enhancements have been included in STAF V3. Some of the major enhancements include:
client1@6500 tcp://client1.austin.ibm.com@6501 9.3.182.20@6500One of the things this allows you to do is communicate with a STAF V2 system that is using a different TCP/IP port.
For example, to configure two tcp interfaces, one for IPv6 and one for IPv4, you could specify the following in the STAF configuration file:
# Enable TCP/IP connections INTERFACE tcp LIBRARY STAFTCP OPTION Port=6500 Protocol=ipv4 INTERFACE tcp6 LIBRARY STAFTCP OPTION Port=6600 Protocol=ipv6
For example, here's an example of configuring an authenticator in the STAF configuration file and using it in trust specifications:
AUTHENTICATOR AuthSample LIBRARY JSTAF \ EXECUTE C:\STAF\services\AuthSample.jar PARMS "USERPROPERTIESFILE C:\STAF\services/auth.prp" TRUST LEVEL 5 USER AuthSample://JohnDoe@us.ibm.com TRUST LEVEL 4 USER AuthSample://*@us.ibm.com
5.5 New Format for Multi-Valued Results
The STAF command automatically unmarshalls the result and prints it in the most appropriate format: simple (or default), table, or verbose.
If the result is a <List> of <String>, then each entry in the list will be printed on its own line. For example,
C:\>STAF client2 FS LIST DIRECTORY C:\ Response -------- AUTOEXEC.BAT CONFIG.SYS Documents and SettingsIf the result is a <Map> (or <Map:<Class>>) which has values that are all of type <String> or <None>, then each key/value pair will be printed on its own line. For example,
C:\>STAF server1 MONITOR LIST SETTINGS Response -------- Max Record Size : 1024 Resolve Message : Disabled Resolve Message Var: Disabled
If the result is a <List> of <Map:<Class>> where every item in the list is an instance of the same map class and all the values in all the maps are of type <String> or <None>, the data will be printed out in a tabular format, called "table format". Otherwise, the data will be displayed in a verbose format. For example,
C:>STAF local HANDLE LIST HANDLES Response -------- Handle Handle Name State Last Used Date-Time ------ ------------------------------- ---------- ------------------- 1 STAF_Process InProcess 20040929-13:57:40 2 STAF/Service/STAFServiceLoader1 InProcess 20040929-16:06:47 5 STAF/Service/LOG InProcess 20040929-13:57:52 7 STAF/Service/RESPOOL InProcess 20040929-13:58:04 51 STAF/Service/MONITOR InProcess 20040929-16:06:47 57 STAF/Client Registered 20040929-16:09:35
You can disable the output of tables by setting the environment variable STAF_PRINT_NO_TABLES to any value. If you disable the output of tables, their data will show up in the more verbose mode.
You can force the table mode when a key has a "structured value" by setting STAF_NO_STRICT_TABLES to any value.
You can force the exclusive use of the verbose mode by setting the environment variable STAF_PRINT_MODE to "verbose".
If the result is more complex than the previous examples (or tables have been turned off), the output will be printed in a hierarchical nested format, called "verbose format". For example, here's a result that is a <Map:<Class>> that contains <String> entries as well as a <Map:<Class>> entry and a <List> entry:
C:>STAF local SEM QUERY MUTEX DataSource1 Response -------- { State : Owned Owner : { Machine : machine1 Handle Name : STAX/Job/1 Handle : 17 User : none://anonymous Date-Time Requested: 20040926-23:54:41 Date-Time Acquired : 20040926-23:54:41 } Pending Requests: [] }
You can change the amount of indentation used by setting the environment variable STAF_INDENT_DELTA to any non-negative integer.
See section 6.5 Marshalling Structured Data for more information on how to handle multi-value results (marshalled structured data) and examples on how to do this via different programming languages or via a STAX job.
5.6 Inform on Garbage Collected Handles
C:\>STAF local SEM REQUEST MUTEX myMutex Response -------- C:\>STAF local SEM QUERY MUTEX myMutex Response -------- { State : Unowned Owner :Note that you are not the mutex owner because the STAF command executable deleted the handle and it was garbage collected.Pending Requests: [] }
C:\>STAF local HANDLE CREATE HANDLE NAME MyHandle Response -------- 33 C:\>set STAF_STATIC_HANDLE=33 C:\>STAF local SEM REQUEST MUTEX myMutex Response -------- C:\>STAF local SEM QUERY MUTEX myMutex Response -------- { State : Owned Owner : { Machine : client1.ibm.com Handle Name : MyHandle Handle : 33 User : none://anonymous Endpoint : tcp://client1.ibm.com@6500 Date-Time Requested: 20041012-10:16:20 Date-Time Acquired : 20041012-10:16:20 } Pending Requests: [] }Note that you are the mutex owner since the handle is a static one and, thus, still exists.
5.7 Send Variables Across the Network
In STAF V2, a STAF handle's variable pool is only used in variable resolution if the request is processed locally. If a request is made to a remote machine, the STAF handle's variable pool is not delivered to the remote machine so it is not used in variable resolution. On remote machines, only the remote system's global variable pool is used. This leads to issues where variables such as a handle's log mask are not propagated to remote machines. However, of possibly larger consequence is that this flaw limits the ability of services to provide configurability on a per-handle basis. For example, the Log service could potentially allow for a default logging level to be specified in a STAF variable. But, in STAF V2, this would only work for systems doing local logging. With the addition of the following enhancements in STAF V3, STAF services will be able to start leveraging STAF variables for defining configurable behavior.
A new SHARED option has been added to the VAR service SET, GET, DELETE, LIST, and RESOLVE requests. On SET, GET, and DELETE requests, this option will direct the request to the system's shared variable pool. On a RESOLVE request, the SHARED option will resolve variables in the context of the system's shared variable pool. On a LIST request, this option will list the contents of the system's shared variable pool. For more information on the changes made in STAF V3 for this enhancement, please see sections "2.4, Variables" and "8.19, Variable (VAR) Service" in the STAF V3 User's Guide.
Here's a summary of the new variable enhancements:
Here is the updated syntax for the VAR service:
C:\>STAF local VAR HELP Response -------- VAR Service Help SET [SYSTEM | SHARED | HANDLE <Handle>] VAR <Name=Value> [VAR <Name=Value>]... GET [SYSTEM | SHARED | HANDLE <Handle>] VAR <Name> DELETE [SYSTEM | SHARED | HANDLE <Handle>] VAR <Name> [VAR <Name>]... LIST [SYSTEM | SHARED | HANDLE <Handle> | ASHANDLE <Handle> | REQUEST [<Request Number>] ] RESOLVE [SYSTEM | SHARED | HANDLE <Handle> | ASHANDLE <Handle> | REQUEST [<Request Number>] ] STRING <String> [STRING <String>]... HELP
5.8 Standardize Request Strings for Services
5.9 Provide/Use Data Directory for STAF and its Services
For example: C:\STAF\data\STAF
We have standardized where data within the "STAF data directory" should be stored. For example, a service should write its data to a directory named <STAF Write Location>/service/<Service Name (lower-case)>.
// Assign the location that the service can write data to, // <STAF Write Location>/service/<service name (lower-case)> // and create the directory if it doesn't exist. fDataDir = info.writeLocation + fileSep + "service" + fileSep + fServiceName.toLowerCase(); File dir = new File(fDataDir); if (!dir.exists()) { dir.mkdirs(); }
Here's a table showing the location that STAF V3 services write data compared to the location that STAF V2 services write data. If you want to use existing data for a STAF V2 service, then you will have to copy the directory or files from the old STAF V2 location to the new STAF V3 location.
Comparison of Write Locations for STAF V3 and STAF V2 | |||
---|---|---|---|
Service | Directory or Files to Copy | STAF V3 Location | STAF V2 Location |
Log Service | Directory | {STAF/DataDir}/service/<Service name (lower-case)> | {STAF/Config/STAFRoot}/data/log |
ResPool Service | Directory | {STAF/DataDir}/service/<Service name (lower-case)> | {STAF/Config/STAFRoot}/data/<Service name (lower-case)> |
EventManager Service | Directory | {STAF/DataDir}/service/<Service name (lower-case)> | {STAF/Config/STAFRoot}/data/eventmanagerdata |
Cron Service | Directory | {STAF/DataDir}/service/<Service name (lower-case)> | <System.getProperty(user.home)>/crondata |
Event Service | Files | {STAF/DataDir}/service/<Service name (lower-case)>/GenManager.out and RegManager.out | <Directory where STAFProc was started>/GenManager.out and RegManager.out |
NamedCounter Service | File | {STAF/DataDir}/service/<Service name (lower-case)>/namedCounter.ser | <Directory where STAFProc was started>/ |
Timer Service | Files | {STAF/DataDir}/service/<Service name (lower-case)>/tlist.ser and wlist.ser | {STAF/Config/STAFRoot}/bin/tlist.ser and wlist.ser |
5.10 Installation Enhancements
Note: Since there are changes in the location of the STAF data directory and the STAF V3 configuration file, you'll need to customize the STAF configuration file and, if desired, move log files, etc. to the new STAF V3 locations manually.
Many enhancements have been added in STAF V3. Some of these enhancements resulted in changes that are not backward compatible with STAF V2. Some of the changes that you may encounter are described in this section.
Some of the installation improvements in STAF V3 are:
If you migrated from STAF V2 to STAF V3, there are a couple of things you'll need to consider:
In addition, now that you can have more than one version of STAF installed on a machine, we are providing script files in STAF V3 that you can run to set up your STAF environment. These are located in the root STAF directory (STAFEnv.bat on Windows, STAFEnv.sh on Unix). In STAF V3 (GA release and later) we will also be creating a similar file for any STAF 2.x version installed on the machine. Here's a sample one for Windows you can use for STAF V2 if you are running STAF V2 and STAF V3 on the same system.
@echo off REM STAF environment variables set PATH=C:\STAF\bin;%PATH% set CLASSPATH=C:\STAF\bin\JSTAF.jar;C:\STAF\samples\demo\STAFDemo.jar;%CLASSPATH% set STAFCONVDIR=C:\STAF\codepageOf course, if you have STAF V2 installed in a location other than C:\STAF, you would need to change this sample script. The sample scripts that are created automatically by STAF V3 will use the actual install directories in the files.
Note: When you install STAF V3 on a Windows system that already has STAF 2.6.5 or earlier installed (at a different location), only the STAF V3 uninstall is available in Add/Remove Programs. To uninstall STAF V2, you will need to open a command prompt, go to the _uninst directory in the root STAF V2 installation directory, and run "uninstaller.exe". To uninstall STAF 2.6.6 or later, instead of running the uninstaller.exe from a command prompt, there is a "Uninstall STAF" icon in the "STAF - Software Testing Automation Framework" folder that can be used to uninstall STAF 2.6.6 or later.
6.2 STAF Configuration File Changes
The STAF configuration file that you used from STAF V2 will not work with STAF V3. Here is a list of the changes that you may need to make:
You may enable or disable STAF trace points and STAF services for tracing using the TRACEM configuration statement. In addition, you can set the trace output destination and set the default tracing state for newly registered services. By default, all STAF services are enabled for tracing. Also, if you are using the default STAF configuration file provided, only the ERROR and DEPRECATED trace points are enabled by default.
Note: The TRACE ENABLE/DISABLE SERVICE(S) statements affect the current list of services. So, if you add line TRACE DISABLE ALL SERVICES to the configuration file and then register any external services later in the configuration file, those services will not necessarily be disabled. To ensure that all registered services are disabled, either set the default service state to disabled, or add the TRACE statements after the SERVICE configuration statements in the configuration file. Here's the new syntax for TRACE statements in the STAF configuration file:
TRACE ENABLE ALL [ TRACEPOINTS | SERVICES ] TRACE ENABLE TRACEPOINTS <Trace point list> | SERVICES <Service list> TRACE ENABLE TRACEPOINT <Trace point> [TRACEPOINT <Trace point>]... TRACE ENABLE SERVICE <Service> [SERVICE <Service>]... TRACE DISABLE ALL [ TRACEPOINTS | SERVICES ] TRACE DISABLE TRACEPOINTS <Trace point list> | SERVICES <Service list> TRACE DISABLE TRACEPOINT <Trace point> [TRACEPOINT <Trace point>]... TRACE DISABLE SERVICE <Service> [SERVICE <Service>]... TRACE SET DESTINATION TO < STDOUT | STDERR | FILE <File name> > TRACE SET DEFAULTSERVICESTATE <Enabled | Disabled>
It is no longer needed.
The MACHINENICKNAME configuration statement is used to specify a nickname for your machine. This overrides the value of the STAF/Config/MachineNickname system variable which defaults to the value of the STAF/Config/Machine system variable (e.g. the long host name). This primarily effects the data stored by services such as the Log and Monitor services, which store data based on the machine from which it came by using the STAF/Config/MachineNickname system variable as part of the directory path when creating logs and monitor data. By allowing the STAF/Config/MachineNickname system variable to be overridden, it allows you to better manage your data.
Note: The machine nickname is not used to communicate with other systems and does not have any effect on trust.
You indicate that you wish to send and accept requests on a network interface using the INTERFACE configuration statement. The INTERFACE configuration statement registers connection providers (also called network interfaces, or interfaces for short). In STAF V3, you can register multiple, pluggable interfaces.
The syntax for the default tcp interface changed in STAF V3:
Notes:
Here's an example of configuring two TCP interfaces, one using the default port, 6500, and a second one using port 6600 for IPv6 traffic with a longer connect timeout.
INTERFACE tcp LIBRARY STAFTCP INTERFACE tcp2 LIBRARY STAFTCP OPTION Port=6600 OPTION PROTOCOL=IPv6 \ OPTION ConnectTimeout=15000
Added the ability to specify multiple, pluggable Authenticator services via the new AUTHENTICATOR configuration statement. The first Authenticator registered is the default, unless overridden by using the new DEFAULTAUTHENTICATOR operational parameter.
Here's an example of registering the sample authenticator:
AUTHENTICATOR AuthSample LIBRARY JSTAF \ EXECUTE {STAF/Config/STAFRoot}\services\auth\AuthSample.jar \ PARMS "USERPROPERTIESFILE {STAF/Config/STAFRoot}/services/auth/authsample.prp"
You may set STAF variables in the system or shared variable pool at startup by using the SET VAR configuration statement. SET VAR will set a variable to a certain value. The variable is created if it does not exist. Note that you may SET multiple variables with a single request.
The new syntax is: SET [SYSTEM | SHARED] VAR <Name=Value> [VAR <Name=Value>] ...
SYSTEM means the variable is to be set in system variable pool. This is the default.
SHARED means the variable is to be set in shared variable pool.
VAR means the variable to be set.
Name is the name of the variable and Value is the value of the variable.
Here are some examples of setting some STAF variables in the system and shared variable pools:
SET SYSTEM VAR STAFDemo/JavaAppClassPath={STAF/Env/CLASSPATH};C:\STAF\samples\demo\STAFDemo.jar; SET VAR STAFDemo/JavaAppCommand=java.exe VAR STAFDemo/Dummy=dummy SET SHARED VAR STAFDemo/JavaAppParms=STAFProcess
You may grant access to machines or users by using the TRUST configuration statement. Trust configuration statements for machines are based on the network identification of the system. In particular, different trust levels can be given to the same system coming in through different networking interfaces. Both logical (e.g. hostnames) and physical identifiers (e.g. IP addresses) may be used in trust configuration statements for machines. Trust configuration statements for users require that you have an authenticator registered.
The syntax for a trust statement is:
TRUST LEVEL <Level> < DEFAULT | MACHINE <Machine> [MACHINE <Machine>]... | USER <User> [USER <User>]... >
Notes:
To determine effective trust for a User:
If multiple trust specifications would match the same user, STAF will rank the matching specifications as follows and use the match with the highest (i.e. lowest numbered) rank:
To determine effective Trust for a Machine:
If multiple trust specifications would match the same system, STAF will rank the matching specifications as follows and use the match with the highest (i.e. lowest numbered) rank:
Note: The user authentication overrides the machine authentication. For example, if the machine trust level is 3 and the authenticated user has a trust level of 4, then the handle will have a trust level of 4. If the user has been authenticated, but there are no user authentication trust matches, the machine trust level is used. If there is no machine trust level specified, then the default trust level is used.
Here's the default STAF configuration file of STAF V3:
# Turn on tracing of internal errors and deprecated options trace enable tracepoints "error deprecated" # Enable TCP/IP connections interface tcp library STAFTCP # Set default local trust trust machine local://local level 5 # Add default service loader serviceloader library STAFDSLS
Here's an example of a customized STAF configuration file for STAF V3:
# Enable TCP/IP connections interface tcp LIBRARY STAFTCP interface tcp2 LIBRARY STAFTCP OPTION Port=6600 OPTION ConnectTimeout=15000 # Turn on tracing of internal errors trace enable tracepoints "deprecated error" # Add default service loader SERVICELOADER LIBRARY STAFDSLS # Authenticator registration AUTHENTICATOR AuthSample LIBRARY JSTAF \ EXECUTE {STAF/Config/STAFRoot}\services\auth\AuthSample.jar \ PARMS "USERPROPERTIESFILE {STAF/Config/STAFRoot}/services/auth/authsample.prp" # Set default local trust TRUST LEVEL 5 MACHINE local://local # Set trusts TRUST LEVEL 2 DEFAULT TRUST LEVEL 3 MACHINE *.austin.ibm.com TRUST LEVEL 4 MACHINE 9.41.53.* TRUST LEVEL 5 MACHINE tcp://9.41.53.147 TRUST LEVEL 5 MACHINE tcp://client1.austin.ibm.com TRUST LEVEL 5 USER AuthSample://* TRUST LEVEL 0 USER AuthSample://User5 # Register services SERVICE STAX LIBRARY JSTAF EXECUTE {STAF/Config/STAFRoot}\services\stax\STAX.jar \ OPTION JVMName=STAX OPTION JVM=C:\j2sdk1.4.2_03\bin\java \ OPTION J2=-Xmx384m \ PARMS "EXTENSIONXMLFILE C:/staf/services/extensions.xml" SERVICE Event LIBRARY JSTAF \ EXECUTE {STAF/Config/STAFRoot}\services\stax\STAFEvent.jar \ OPTION JVMName=STAX SERVICE Cron LIBRARY JSTAF \ EXECUTE {STAF/Config/STAFRoot}\services\cron\STAFCron.jar # Set up some STAF variables SET SYSTEM VAR STAFDemo/JavaAppClassPath=C:\STAF\lib\JSTAF.jar;C:\STAF\samples\demo\STAFDemo.jar; SET VAR STAFDemo/JavaAppCommand=java.exe VAR STAFDemo/Dummy=dummy SET SHARED VAR STAFDemo/JavaAppParms=STAFProcess
6.3 Pre-defined STAF Variable Changes
STAF maintains a "system" variable pool that is common to all the processes on a given STAF Client. STAF predefines a set of system variables. Some of these system variables (formerly known as "global" variables in STAF V2) have been removed in STAF V3 and some variables have been added in STAF V3.
The following variable was removed from the set of system variables that STAF pre-defines:
The following variables were added to the set of system variables that STAF pre-defines:
6.4 Removed Deprecated Functions
6.5 Marshalling Structured Data
If you're the owner of a custom STAF service and you want to leverage the multi-value result change in your service or if your testcase or application is providing a multi-value queued message, read this section to learn more about providing the result or message in a marshalled data structure.
The multi-value result change is applicable to any command that can logically return multiple values. Essentially any command where the user would take the result buffer and parse it into multiple values instead of just using the whole thing as a string. The most common examples of these are LIST and QUERY commands which almost always return multiple values. But, that doesn't mean there might not be other commands that return multiple values. For example doing a PROCESS FREE ALL will return two values (the total number of processes and the total that were freed). In some cases, the multiple values are only returned as part of an error (for example an FS DELETE, generally of a directory, without IGNOREERRORS will return a list of the files/directories that couldn't be deleted).
For example, in STAF V2, a LIST MUTEX request to the SEM service could result in the following output:
DataSource1: Unowned Printers/Printer1: Owned - 2 pending request(s)You had to parse this information in order to get the name of each mutex, to determine if a mutex is owned or unowned and if there are any pending requests.
In STAF V3, multi-valued results are now returned as marshalled data structures. In STAF V3, a LIST MUTEX request to the SEM service results in a marshalled <List> of <Map:STAF/Service/Sem/MutexInfo> representing the mutex semaphores. This map class is defined with keys: name, state, pendingRequests. In STAF V3, a LIST MUTEX request to the SEM service issued from the command line, could look like the following in table format:
Name State Pending Requests ----------------- ------- ---------------- DataSource1 Unowned 0 Printers/Printer1 Owned 2But, more importantly, when accessed via a testcase (e.g. a Java program) or a STAX job, you do not have to parse the result to obtain the name of each mutex, or its state, or the number of pending requests. So, after the result is unmarshalled, you can iterate through the list accessing the name, state, and pending requests via the map keys for each entry in the list.
Read section "6.1 Marshalling Structured Data" in the STAF V3 User's Guide for more information about how STAF supports the automatic marshalling and unmarshalling of structured data. The act of marshalling takes a data structure and converts it into a string-based representation. The act of unmarshalling reverses this and converts the string-based representation back into a data structure.
Also, see the STAF V3 Service Developer's Guide for more information on how to convert a multi-valued result into a marshalled data structure.
Once the data structure is generated, the data structure needs to be set as the root of a marshalling context. Then you can marshall the marshalling context itself to create a string which can then be returned in the result buffer.
When structured data is returned in the result string, the STAF command will automatically unmarshall the data and print it in the most appropriate format. See section "5.2 STAF" in the STAF V3 User's Guide for more information on this.
If a request returns a multi-valued result, such as a LIST or QUERY request, you should create a marshalled data structure to be returned in the result buffer.
Here are some examples of marshalling structured data in Java and C++. These are examples from the sample Device service described in the STAF V3 Service Developer's Guide that shows how to generate marshalled structured data for a LIST request. See the STAF V3 Service Developer's Guide for the complete code.
Here's the definition of the map class definition variables used in this example.
// Map Class Definitions used to create marshalled results public static STAFMapClassDefinition fListDeviceMapClass; public static STAFMapClassDefinition fQueryDeviceMapClass;Here's a code snippet from the init method for the service to generate the map class definitions used by the LIST and QUERY requests.
// Construct map class for the result from a LIST request. fListDeviceMapClass = new STAFMapClassDefinition( "STAF/Service/Device/ListDevice"); fListDeviceMapClass.addKey("name", "Name"); fListDeviceMapClass.addKey("type", "Type"); fListDeviceMapClass.addKey("model", "Model"); fListDeviceMapClass.addKey("serial#", "Serial #"); // If you wanted a "short" display heading that could be used by the // STAF command line executable when displaying results in table // format if the length of the display heading exceeded the longest // length of any data for that field and when data for other fields // could use more space fListDeviceMapClass.setKeyProperty( "serial#", "display-short-name", "Ser#"); // Construct map class for the result from a QUERY request. fQueryDeviceMapClass = new STAFMapClassDefinition( "STAF/Service/Device/QueryDevice"); fQueryDeviceMapClass.addKey("model", "Model"); fQueryDeviceMapClass.addKey("serial#", "Serial #");Here's the code snippet from the handleList method that generates a <List> of a map class, <Map:STAF/Service/Device/ListDevice>, to represent a list of printers and returns the marshalled result:
// Create a marshalling context and set any map classes (if any). STAFMarshallingContext mc = new STAFMarshallingContext(); mc.setMapClassDefinition(fListDeviceMapClass); // Create an empty result list to contain the result List resultList = new ArrayList(); // Add printer entries to the result list if (defaultList || printersOption > 0) { Iterator iter = fPrinterMap.keySet().iterator(); while (iter.hasNext()) { String key = (String)iter.next(); DeviceData data = (DeviceData)fPrinterMap.get(key); Map resultMap = fListDeviceMapClass.createInstance(); resultMap.put("name", key); resultMap.put("type", "Printer"); resultMap.put("model", data.model); resultMap.put("serial#", data.sn); resultList.add(resultMap); } } // Set the result list as the root object for the marshalling context // and return the marshalled result mc.setRootObject(resultList); return new STAFResult(STAFResult.Ok, mc.marshall());Here's a code snippet from the handleQuery method that generates a map class, <Map:STAF/Service/Device/QueryDevice, to represent detailed information about a printer and returns the marshalled result:
// Create a marshalling context and set any map classes (if any). STAFMarshallingContext mc = new STAFMarshallingContext(); mc.setMapClassDefinition(fQueryDeviceMapClass); // Create an empty result map to contain the result Map resultMap = fQueryDeviceMapClass.createInstance(); // Find the specified printer and add its info to the result map if (fPrinterMap.containsKey(printer)) { DeviceData data = (DeviceData)fPrinterMap.get(printer); resultMap.put("model", data.model); resultMap.put("serial#", data.sn); } else { return new STAFResult(STAFResult.DoesNotExist, printer); } // Set the result map as the root object for the marshalling context // and return the marshalled result mc.setRootObject(resultMap); return new STAFResult(STAFResult.Ok, mc.marshall());
Here's the definition of the map class definition variables used in this example shown in bold.
// DEVICE Service Data struct DeviceServiceData { unsigned int fDebugMode; // Debug Mode flag STAFString fShortName; // Short service name STAFString fName; // Registered service name STAFHandlePtr fHandlePtr; // Device service's STAF handle STAFCommandParserPtr fAddParser; // DEVICE ADD command parser STAFCommandParserPtr fDeleteParser; // DEVICE DELETE command parser STAFCommandParserPtr fQueryParser; // DEVICE QUERY command parser STAFCommandParserPtr fListParser; // DEVICE LIST command parser STAFCommandParserPtr fHelpParser; // DEVICE HELP command parser STAFCommandParserPtr fVersionParser; // DEVICE VERSION command parser STAFCommandParserPtr fParmsParser; // DEVIC PARMS command parser // Map Class Definitions for marshalled results STAFMapClassDefinitionPtr fListDeviceMapClass; STAFMapClassDefinitionPtr fQueryDeviceMapClass; STAFMutexSemPtr fPrinterMapSem; // Semaphore to control // access to the PrinterMap STAFMutexSemPtr fModemMapSem; // Semaphore to control // access to the ModemMap DeviceMap fPrinterMap; // Map of all printers DeviceMap fModemMap; // Map of all modems };Here's a code snippet from the init method for the service to generate the map class definitions used by the LIST and QUERY requests.
// Construct map class for the result from a LIST request. pData->fListDeviceMapClass = STAFMapClassDefinition::create( "STAF/Service/Device/ListDevice"); pData->fListDeviceMapClass->addKey("name", "Name"); pData->fListDeviceMapClass->addKey("type", "Type"); pData->fListDeviceMapClass->addKey("model", "Model"); pData->fListDeviceMapClass->addKey("serial#", "Serial #"); // If you wanted a "short" display heading that could be used by the // STAF command line executable when displaying results in table // format if the length of the display heading exceeded the longest // length of any data for that field and when data for other fields // could use more space pData->fListDeviceMapClass->setKeyProperty( "serial#", "display-short-name", "Ser#"); // Construct map class for the result from a QUERY request. pData->fQueryDeviceMapClass = STAFMapClassDefinition::create( "STAF/Service/Device/QueryDevice"); pData->fQueryDeviceMapClass->addKey("model", "Model"); pData->fQueryDeviceMapClass->addKey("serial#", "Serial #");Here's the code snippet from the handleList method that generates a <List> of a map class, <Map:STAF/Service/Device/ListDevice>, to represent a list of printers and returns the marshalled result:
// Create a marshalling context and set any map classes (if any). STAFObjectPtr mc = STAFObject::createMarshallingContext(); mc->setMapClassDefinition(pData->fListDeviceMapClass->reference()); // Create an empty result list to contain the result STAFObjectPtr resultList = STAFObject::createList(); // Add printer entries to the result list if (printers || all) { STAFMutexSemLock lock(*pData->fPrinterMapSem); DeviceMap::iterator iter; for (iter = pData->fPrinterMap.begin(); iter != pData->fPrinterMap.end(); ++iter) { STAFObjectPtr resultMap = pData->fListDeviceMapClass->createInstance(); resultMap->put("name", iter->second->name); resultMap->put("type", "Printer"); resultMap->put("model", iter->second->model); resultMap->put("serial#", iter->second->serialNumber); resultList->append(resultMap); } } // Set the result list as the root object for the marshalling context // and return the marshalled result mc->setRootObject(resultList); return STAFResultPtr(new STAFResult(kSTAFOk, mc->marshall()), STAFResultPtr::INIT);Here's a code snippet from the handleQuery method that generates a map class, <Map:STAF/Service/Device/QueryDevice, to represent detailed information about a printer and returns the marshalled result:
// Create a marshalling context and set any map classes (if any). STAFObjectPtr mc = STAFObject::createMarshallingContext(); mc->setMapClassDefinition(pData->fQueryDeviceMapClass->reference()); // Create an empty result map to contain the result STAFObjectPtr resultMap = pData->fQueryDeviceMapClass->createInstance(); // Find the specified printer/modem and add its info to the result map STAFMutexSemLock lock(*pData->fPrinterMapSem); DeviceMap::iterator iter = pData->fPrinterMap.find(printer); if (iter == pData->fPrinterMap.end()) { return STAFResultPtr(new STAFResult(kSTAFDoesNotExist, printer), STAFResultPtr::INIT); } resultMap->put("model", iter->second->model); resultMap->put("serial#", iter->second->serialNumber); // Set the result map as the root object for the marshalling context // and return the marshalled result mc->setRootObject(resultMap); return STAFResultPtr(new STAFResult(kSTAFOk, mc->marshall()), STAFResultPtr::INIT); // Create a marshalling context and set any map classes (if any). STAFObjectPtr mc = STAFObject::createMarshallingContext(); mc->setMapClassDefinition(pData->fQueryDeviceMapClass->reference()); // Create an empty result map to contain the result STAFObjectPtr resultMap = pData->fQueryDeviceMapClass->createInstance(); // Find the specified printer/modem and add its info to the result map STAFMutexSemLock lock(*pData->fPrinterMapSem); DeviceMap::iterator iter = pData->fPrinterMap.find(printer); if (iter == pData->fPrinterMap.end()) { return STAFResultPtr(new STAFResult(kSTAFDoesNotExist, printer), STAFResultPtr::INIT); } resultMap->put("model", iter->second->model); resultMap->put("serial#", iter->second->serialNumber); // Set the result map as the root object for the marshalling context // and return the marshalled result mc->setRootObject(resultMap); return STAFResultPtr(new STAFResult(kSTAFOk, mc->marshall()), STAFResultPtr::INIT);
6.6 Handling Marshalled Structured Data (Unmarshalling)
This section shows you examples of handling marshalled data structures, in this case, the result from a LIST request, via a Java program, a C++ program, and a STAX job.
When you submit a LIST POOLS request to the RESPOOL service in STAF V3, the result is a data structure consisting of a list of maps, one for each pool.
C:\>STAF local RESPOOL LIST POOLS Response -------- Pool Name Description --------- ----------------------- pool1 Pool 1 STAFDemo STAF Demo Resource PoolHere are some examples of how you can access values in the multi-valued result:
Here's a snippet of Java code that submits a LIST POOLS request to the RESPOOL service, unmarshalls the result, and iterates through the unmarshalled result (a List containing a Map for each resource pool) and prints the pool name and description for each entry in the list:
STAFResult res = handle.submit2("local", "RESPOOL", "LIST POOLS"); if (res.rc != 0) return res; STAFMarshallingContext mc = STAFMarshallingContext.unmarshall(res.result); List poolList = (List)mc.getRootObject(); Iterator iter = poolList.iterator(); while (iter.hasNext()) { Map poolMap = (HashMap)iter.next(); System.out.println("Name: " + poolMap.get("poolName") + ", Description: " + poolMap.get("description")); }Here's the output from running this sample Java program:
Name: pool1, Description: Pool 1 Name: STAFDemo, Description: STAF Demo Resource Pool
Here's a snippet of C++ code that submits a LIST POOLS request to the RESPOOL service, unmarshalls the result, and iterates through the unmarshalled result (a List containing a Map for each resource pool) and prints the pool name and description for each entry in the list:
STAFResultPtr res = pData->fHandlePtr->submit("local", "RESPOOL", "LIST POOLS"); if (res->rc != 0) return res; STAFObjectPtr mc = STAFObject::unmarshall(res->result); STAFObjectPtr outputList = mc->getRootObject(); STAFObjectIteratorPtr iter = outputList->iterate(); while (iter->hasNext()) { STAFObjectPtr poolMap = iter->next(); cout << "Name: " << poolMap->get("poolName")->asString() << ", Description: " << poolMap->get("description")->asString() << endl; }Here's the output from running this sample C++ program:
Name: pool1, Description: Pool 1 Name: STAFDemo, Description: STAF Demo Resource Pool
The STAFResult from a <stafcmd> element is unmarshalled by the STAX service so that you don't have to do any unmarshalling in a STAX job.
Here's a snippet from a STAX xml file that submits a LIST POOLS request to the RESPOOL service, and iterates through the result (a List containing a Map for each resource pool) and displays the pool name and description for each entry in the list in the STAX Monitor messages panel:
<stafcmd> <location>'local'</location> <service>'RESPOOL'</service> <request>'LIST POOLS'</request> </stafcmd> <if expr="RC == 0"> <iterate var="poolMap" in="STAFResult"> <message> 'Name: %s, Description: %s' % (poolMap['poolName'], poolMap['description']) </message> </iterate> </if>This results in a message sent to the STAX Monitor for each entry in the pool:
20041007-18:10:06 Name: pool1, Description: Pool 1 20041007-18:10:06 Name: STAFDemo, Description: STAF Demo Resource Pool
6.7 STAF Custom Service Changes
If you have written any custom STAF services, you will need to make changes to them in order for them to work with STAF V3. This section talks about changes that are specific to custom services. Other changes described elsewhere in this migration guide may also apply to your service. For example, if your service submits any requests to STAF services, you'll want to gather the STAF V3 migration diagnostics to see if the syntax and/or results for the request have changed. Also, if your services resolves any STAF variables, you'll want to make sure that those variables still exist. If your service submits requests to STAF services on remote machines, you'll need to consider whether your service should support remote machines that are running STAF V2 or just STAF V3.
6.7.1 STAF Java Service Changes
If you wrote a custom STAF service in Java, you must make the following changes to enable your service to work with STAF V3:
public class MyService implements STAFServiceInterfaceLevel30
public STAFResult init(STAFServiceInterfaceLevel30.InitInfo info)
public STAFResult acceptRequest(STAFServiceInterfaceLevel30.RequestInfo info) private STAFResult handleXXX(STAFServiceInterfaceLevel30.RequestInfo info)
public InitInfo(String name, String parms, JarFile serviceJar, int serviceType, String writeLocation) { this.name = name; this.parms = parms; this.serviceJar = serviceJar; this.serviceType = serviceType; this.writeLocation = writeLocation; }In STAF V3, we have standardized where data within the directory specified by the writeLocation field should be stored. A service should write its data to a directory named info.writeLocation + "/service/" + info.name.toLowerCase().
Here's a snippet of code that could be used in the init() method, to assign the location that the service should write its data.
// Assign the location that the service can write data to and create the // directory if it doesn't exist. fDataDir = info.writeLocation + fileSep + "service" + fileSep + info.name.toLowerCase(); File dir = new File(fDataDir); if (!dir.exists()) { dir.mkdirs(); }
STAFResult init(InitInfo initInfo) STAFResult term()The STAFResult class consists of an int rc (return code) and a String result so that your service can now return not only a return code, but also more information about the error.
Both the RC and Result will be provided in the STAFProc window if an error occurs registering or unregistering a service when starting STAF, or if dynamically registering/unregistering a service via a SERVICE ADD/REMOVE request, the result buffer will contain the additional information about the error.
For example, if in the init() method, your Java service submitted a request to resolve a STAF variable, you should change the service to return the STAFResult object from the resolve request, instead of just a return code.
// Get the file separator String fileSep; STAFResult res = fHandle.submit2( "local", "VAR", "RESOLVE STRING {STAF/Config/Sep/File}"); if (res.rc != 0) return res; else fileSep = res.result;
static public class RequestInfo { public String stafInstanceUUID; public String machine; public String machineNickname; public String handleName; public int handle; public int trustLevel; public boolean isLocalRequest; public int diagEnabled; public String request; public int requestNumber; public String user; public String endpoint; public String physicalInterfaceID; ... }
Change your service to not use the following fields which were removed from the STAFServiceInterfaceLevel30.RequestInfo class:
The following fields were added to the STAFServiceInterfaceLevel30.RequestInfo class:
6.7.2 STAF C++ Service Changes
If you wrote a STAF service in C++, you must make the following changes:
STAFRC_t STAFServiceConstruct(STAFServiceHandle_t *pServiceHandle, void *pServiceInfo, unsigned int infoLevel, STAFString_t *pErrorBuffer) { if (infoLevel != 30) return kSTAFInvalidAPILevel; try { STAFServiceInfoLevel30 *pInfo = reinterpret_cast<STAFServiceInfoLevel30 *>(pServiceInfo); ... STAFRC_t STAFServiceInit(STAFServiceHandle_t serviceHandle, void *pInitInfo, unsigned int initLevel, STAFString_t *pErrorBuffer) { if (initLevel != 30) return kSTAFInvalidAPILevel; try { STAFServiceInitLevel30 *pInfo = reinterpret_cast<STAFServiceInitLevel30 *>(pInitInfo); ... STAFRC_t STAFServiceAcceptRequest(STAFServiceHandle_t serviceHandle, void *pRequestInfo, unsigned int reqLevel, STAFString_t *pResultBuffer) { if (reqLevel != 30) return kSTAFInvalidAPILevel; try { STAFServiceRequestLevel30 *pInfo = reinterpret_cast<STAFServiceRequestLevel30 *>(pRequestInfo); ...
STAFRC_t STAFServiceGetLevelBounds(unsigned int levelID, unsigned int *minimum, unsigned int *maximum) { switch (levelID) { case kServiceInfo: { *minimum = 30; *maximum = 30; break; } case kServiceInit: { *minimum = 30; *maximum = 30; break; } case kServiceAcceptRequest: { *minimum = 30; *maximum = 30; break; } case kServiceTerm: case kServiceDestruct: { *minimum = 0; *maximum = 0; break; } default: { return kSTAFInvalidAPILevel; } } return kSTAFOk; }
struct STAFServiceInfoLevel30 { STAFString_t name; STAFString_t exec; STAFString_t writeLocation; STAFServiceType_t serviceType; unsigned int numOptions; STAFString_t *pOptionName; STAFString_t *pOptionValue; };
The serviceType field specifies the type of service (e.g. regular service, service loader service, or authenticator service).
No changes are required to be made to your service for this change.
struct STAFServiceRequestLevel30 { STAFString_t stafInstanceUUID; STAFString_t machine; STAFString_t machineNickname; STAFString_t handleName; STAFHandle_t handle; unsigned int trustLevel; unsigned int isLocalRequest; unsigned int diagEnabled; STAFString_t request; STAFRequestNumber_t requestNumber; STAFString_t user; STAFString_t endpoint; STAFString_t physicalInterfaceID; };
Change your service to not use the following fields which were removed from the STAFServiceInterfaceLevel30.RequestInfo class:
The following fields were added to the STAFServiceInterfaceLevel30.RequestInfo class:
Appendix A: STAF V3 Migration Diagnostic Triggers in STAF V2.6.x
This section contains a list of the triggers for all STAF commands owned by the STAF Development team that will be changing in STAF V3 due to one or both of the following reasons:
Note that many results vary depending on the request options specified, with results for some requests sometimes containing multiple values and at other times only containing one value.
The format of the trigger recorded by STAF services for STAF V2 to aid in migrating to STAF V3 is:
STAF/V3.0-Mig/<Service> <Request>where:
The format of the source recorded by STAF services to aid in migrating to STAF V3 is:
<Handle Name>;<Machine Name>;<Handle#>where:
STAF V3 Migration Diagnostics Triggers | |
---|---|
Trigger | Meaning |
STAF/V3.0-Mig/CRON LIST | This indicates a LIST request to the CRON service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/EVENT LIST | This indicates a LIST request to the EVENT service.
The result and syntax for the request will change in STAF V3.
The syntax changes include:
|
STAF/V3.0-Mig/EVENT QUERY | This indicates a QUERY request to the EVENT service.
The result and syntax for the request will change in STAF V3.
The syntax changes include:
|
STAF/V3.0-Mig/EVENTMANAGER LIST | This indicates a LIST request to the EVENTMANAGER service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/FS COPY DIRECTORY (no IGNOREERRORS) | This indicates a COPY DIRECTORY request to the FS service, without the IGNOREERRORS option. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/FS DELETE (no IGNOREERRORS) | This indicates a DELETE request to the FS service, without the IGNOREERRORS option. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/FS GET ENTRY SIZE | This indicates a GET ENTRY request to the FS service, with the SIZE option specified. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/FS LIST | This indicates a LIST request to the FS service. The result for the request will change in STAF V3. Also, changed the request syntax: the FORMAT option will change to the DETAILS option in STAF V3. Also, note that the default format when using the LONG option is different in STAF V3. |
STAF/V3.0-Mig/FS QUERY | This indicates a QUERY request to the FS service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/FSEXT QUERY | This indicates a QUERY request to the FSEXT service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/FSEXT COMPAREDIR (No EXISTS) | This indicates a COMPARDIR request to the FSEXT service that does not specify the EXISTS option. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/FSEXT FILECONTAINS NOT | This indicates a FILECONTAINS request to the FSEXT service with the NOT option specified. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/FSEXT LINECONTAINS | This indicates a LINECONTAINS request to the FSEXT service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/HANDLE QUERY | This indicates a QUERY request to the HANDLE service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/HELP ERROR | This indicates a ERROR request to the HELP service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/HELP LIST | This indicates a LIST request to the HELP service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/HTTP FOLLOW LINK | This indicates a FOLLOW LINK request to the HTTP service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/HTTP LIST | This indicates a LIST request to the HTTP service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/HTTP REQUEST|POST|DOGET | This indicates a REQUEST, POST, or DOGET request to the HTTP service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/HTTP QUERY | This indicates a QUERY request to the HTTP service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/HTTP SUBMIT FORM | This indicates a SUBMIT FORM request to the HTTP service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/LOG LIST | This indicates a LIST request to the LOG service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/LOG PURGE | This indicates a PURGE request to the LOG service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/LOG QUERY | This indicates a QUERY request to the LOG service. The result for the request will change in STAF V3. :p. In addition, there are some changes to the request syntax in STAF V3: :ul. :li.The FIELDSEP option has been removed since it is no longer needed with the way multi-valued results are handled in STAF V3. :li.There is now a DefaultMaximumQueryRecords parameter/setting in STAF V3 that is set by default to 100. You may need to add the ALL option to your QUERY request in STAF V3 if you really want all of the records even if the number of records matching the query criteria exceeds the default maximum query records. :eul. |
STAF/V3.0-Mig/LOG SET | This indicates a SET request to the LOG service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/MISC MACHINE | This indicates a MACHINE request to the MISC service. This request does not exist in STAF V3 as it is no longer needed since there a USELONGNAMES operational setting no longer exists (e.g. the effective machine name and machine name are now the same). |
STAF/V3.0-Mig/MISC TRACE | This indicates any TRACE request to the MISC service, other than a TRACE LIST request. The syntax for the request will change in STAF V3 due to moving the TRACE requests from the MISC service to a new TRACE service. |
STAF/V3.0-Mig/MISC TRACE LIST | This indicates a LIST request to the MISC service. The result for the request will change in STAF V3, as well as the syntax. |
STAF/V3.0-Mig/MONITOR LIST | This indicates a LIST request to the MONITOR service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/MONITOR QUERY | This indicates a QUERY request to the MONITOR service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/MONITOR SET | This indicates a SET request to the MONITOR service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/NAMEDCOUNTER LIST | This indicates a LIST request to the NAMEDCOUNTER service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/PROCESS FREE ALL|WORKLOAD | This indicates a FREE ALL or FREE WORKLOAD request to the PROCESS service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/PROCESS NOTIFY LIST | This indicates a NOTIFY LIST request to the PROCESS service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/PROCESS QUERY | This indicates a QUERY request to the PROCESS service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/PROCESS START WAIT | This indicates a START request to the PROCESS service with the option WAIT specified. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/PROCESS STOP ALL|WORKLOAD | This indicates a STOP ALL or STOP WORKLOAD request to the PROCESS service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/QUEUE GET|PEEK | This indicates a GET or PEEK request to the QUEUE service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/QUEUE LIST | This indicates a LIST request to the QUEUE service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/RESPOOL LIST | This indicates a LIST request to the RESPOOL service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/RESPOOL QUERY | This indicates a QUERY request to the RESPOOL service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM EVENT DELETE | This indicates an EVENT DELETE request to the SEM service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM EVENT POST|PULSE | This indicates an EVENT POST or PULSE request to the SEM service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM EVENT QUERY | This indicates an EVENT QUERY request to the SEM service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM EVENT RESET | This indicates an EVENT RESET request to the SEM service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM EVENT WAIT | This indicates an EVENT WAIT request to the SEM service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM LIST | This indicates a LIST request to the SEM service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM MUTEX DELETE | This indicates a MUTEX DELETE request to the SEM service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM MUTEX QUERY | This indicates a MUTEX QUERY request to the SEM service. The syntax and the result for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM MUTEX RELEASE | This indicates a MUTEX RELEASE request to the SEM service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/SEM MUTEX REQUEST | This indicates a MUTEX REQUEST request to the SEM service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/SERVICE FREE | This indicates a FREE request to the SERVICE service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/SERVICE LIST | This indicates a LIST request to the SERVICE service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/SERVICE QUERY | This indicates a QUERY request to the SERVICE service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/SHUTDOWN NOTIFY LIST | This indicates a NOTIFY LIST request to the SHUTDOWN service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/STAX EXECUTE TEST RETURNDETAILS | This indicates a TEST request to the STAX service specifying option RETURNDETAILS. The result for the request will change in STAF V3. Note that RETURNDETAILS is an undocumented option and is for use by STAF developers only. |
STAF/V3.0-Mig/STAX EXECUTE WAIT RETURNRESULT | This indicates an EXECUTE request to the STAX service specifying options WAIT and RETURNRESULT. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/STAX LIST | This indicates a LIST request to the STAX service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/STAX QUERY | This indicates a QUERY request to the STAX service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/STAX SET | This indicates a SET request to the STAX service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/SXE EXECUTE | This indicates an EXECUTE request to the SXE service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/TIMER LIST | This indicates a LIST request to the TIMER service. The result for the request and the syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/TRUST LIST | This indicates a LIST request to the TRUST service. The result for the request will change in STAF V3. |
STAF/V3.0-Mig/VAR DELETE | This indicates a DELETE request to the VAR service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/VAR GET | This indicates a GET request to the VAR service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/VAR LIST | This indicates a LIST request to the TRUST service. The syntax and result for the request will change in STAF V3. |
STAF/V3.0-Mig/VAR RESOLVE | This indicates a RESOLVE request to the VAR service, specifying one RESOLVE option. The syntax for the request will change in STAF V3. Not only has the syntax been restructured, but the DELIMIT option for resolving multiple variables will be removed in STAF V3 as it is no longer needed due to the new format for multi-valued results. |
STAF/V3.0-Mig/VAR RESOLVE (Multiple) | This indicates a RESOLVE request to the VAR service, specifying more than one RESOLVE option such that the result returns the resolved value for more than one STAF variable. The syntax and result for the request will change in STAF V3. |
STAF/V3.0-Mig/VAR SET | This indicates a SET request to the VAR service. The syntax for the request will change in STAF V3. |
STAF/V3.0-Mig/ZIP LIST | This indicates a LIST request to the ZIP service. The result for the request will change in STAF V3. |
To view the diagnostics data that has been recorded, use the LIST request for the DIAG service. See :hdref refid=diagList. for more information.
Appendix B: Queued Message Format Changes in STAF V3
Messages queued by STAF V3 and it's services have a different format than in STAF V2. A new TYPE option was added in STAF V3 to identify the type of message being queued. STAF V3 and it's services specify a type for all the message that they generate because queued messages can contain various marshalled data structures, such as a map, so the type let's you know the structure of the message.
Here's a table showing the new format of the messages queued by STAF V3 and it's services, as well as showing the format of these messages queued by STAF V2 clients to a STAF V3 machine.
STAF V3 Queued Messages | |
---|---|
Queued Messages from STAF V3 | Queued Messages from STAF V2 |
TYPE: STAF/RequestComplete
MESSAGE: A map containing the request completion information as follows: { requestNumber: <Request #> rc : <Request return code> result : <Request result buffer> } | TYPE: <None>
MESSAGE: A string containing request completion information as follows: STAF/RequestComplete <Request #>;<Request return code>;<Request result buffer> |
TYPE: STAF/Process/End
MESSAGE: A map containing the process completion information as follows: { handle : <Handle #> endTimestamp: <YYYMMDD-HH&colon.MM&colon.SS> rc : <Process Return Code> key : <Key> | <None> fileList : [ { rc : <Returned File #1 RC> data: <Returned File #1 Data> } ] } | TYPE: <None>
MESSAGE: A string containing process completion information as follows: STAF/PROCESS/END |
TYPE: STAF/Start
MESSAGE: Blank | TYPE: <None>
MESSAGE: A string containing STAF/START. |
TYPE: STAF/Shutdown
MESSAGE: Blank | TYPE: <None>
MESSAGE: A string containing STAF/SHUTDOWN. |
TYPE: STAF/Service/Event
MESSAGE: A map containing the event information as follows: { eventID : <Event ID> eventServiceName: <Event Service Name> handle : <Handle #> handleName : <Handle Name> machine : <Machine> propertyMap : { <Name>: <Value> ... } subtype : <Subtype> timestamp : <YYYYDDMM-HH:MM:SS> type : <Type> } | TYPE: <None>
MESSAGE: A string containing the event information as follows: STAF/SERVICE/<Event Service Name>/;<Event ID>;<Generating Machine>;<Generating Process>;<Generating Handle>;<TimeStamp>;<Type>;<Subtype>; [<Name>=<Value>;]... |
TYPE: STAF/Service/EventManager/End
MESSAGE: Blank | TYPE: <None>
MESSAGE: A string containing EventManager/End. |
TYPE: STAF/Service/Cron/End
MESSAGE: Blank | TYPE: <None>
MESSAGE: A string containing Cron/End. |
TYPE: STAF/Service/STAX/End
MESSAGE: Blank | TYPE: <None>
MESSAGE: A string containing STAX/End. |
TYPE: STAF/Service/STAX/JobWaitComplete/ MESSAGE: Blank | TYPE: <None>
MESSAGE: A string containing STAX/Job/Wait/Complete/ |
TYPE: STAF/STAXMonitor/End
MESSAGE: Blank | TYPE: <None>
MESSAGE: A string containing STAXMonitorJob/End or STAXJobMonitor/End. |
TYPE: STAF/Service/Timer
MESSAGE: A map containing the timer information as follows: { timerServiceName: <Timer Service Name> type : <Timer Type> timestamp : <YYYYDDMM-HH&colon.MM&colon.SS> key : <Key (blank if no KEY specified)> } | TYPE: <None>
MESSAGE: A string containing the timer information as follows: STAF/SERVICE/<Timer Service Name>;<Type>;<Timestamp>; |
TYPE: STAF/Service/Timer/End
MESSAGE: A string containing QUIT. | TYPE: <None>
MESSAGE: A string containing QUIT. |
TYPE: STAF/STAFDemo/Stop
MESSAGE: Blank | TYPE: <None>
MESSAGE: A string containing STAFDemo/End. |