HP-UX SNAplus2 R7 NOF Programmer's Guide

Writing NOF Applications
Target For NOF Verbs
Different QUERY_* verbs return information about the denition of a resource, on its current status, or on both
denition and status. Status information can only be obtained from a running node. Verbs that return only status
information cannot be issued to an inactive node, and verbs that return both denition and status will return only
denition information when issued to an inactive node. For example, QUERY_PARTNER_LU_DEFINITION
can be issued either to an inactive node (to determine the stored conguration) or to a running node (to determine
the current denition). However, QUERY_PARTNER_LU (which returns information about the LUs current
sessions) can be issued only to a running node. QUERY_LS (which returns both the denition of the LS and
its current status) can be issued either to an inactive node or to a running node, but status information is not
returned if you issue it to an inactive node. The description of each QUERY_* verb in Chapter 3,
NOF API
Verbs includes information about the valid target types for the verb.
Verbs associated with managing backup master servers (ADD_BACKUP, DELETE_BACKUP,
QUERY_SNA_NET, and REGISTER_INDICATION_SINK or UNREGISTER_INDICATION_SINK for SNA
network le indications) must be issued to the
sna.net le.
2.4.1 Processing Modes
Each target handle used by an application has an associated processing mode that can be modied with the NOF
verb SET_PROCESSING_MODE. The mode controls le locking and access permissions for the application.
For a NOF application running on a client, read-only mode is the only mode available. Only QUERY_* verbs are
enabled in this mode. All other verbs, which modify the conguration or status of a resource, will be rejected. This
enables the application to check the conguration or status of a resource but not to change it.
For a NOF application running on a server, the following modes are available:
AP_MODE_READ_ONLY
Only QUERY_* verbs are enabled in this mode. All other verbs, which modify the conguration or status of
a resource, will be rejected.
This is the default mode when the target handle is rst assigned; it enables the application to check the con-
guration or status of a resource but not to change it.
AP_MODE_READ_WRITE
All NOF verbs are enabled in this mode, including those that change a resources conguration or status.
AP_MODE_COMMIT
This mode is only available if the target handle identies the domain conguration le (not when issuing
verbs to a node). It obtains a lock on the le so that only this application can access it; this le lock ensures
that the le will not be modied by any other process during a sequence of verbs issued by this application.
The le lock also ensures that no changes are made to the le until the complete sequence of verbs has been
issued (until the application changes from AP_MODE_COMMIT mode to one of the other modes).
Because this mode prevents any other program from accessing the le, it should be used only for as long as
necessary. The application should immediately issue all the verbs that it requires to modify the le and then
change to one of the other modes.
If the le lock cannot be obtained (for example, because another program is currently modifying the le), the
SET_PROCESSING_MODE verb will fail.
Note
To obtain read/write access to the le, your NOF application must be running with a user
ID that is a member of the SNA administrators group sna. If the user ID is not a member
of this group, the only valid processing mode is AP_MODE_READ_ONLY.
75