Processing modes

Each target handle used by an application has an associated processing mode that can be modified with the NOF verb SET_PROCESSING_MODE. The mode controls file 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 configuration or status of a resource, will be rejected. This enables the application to check the configuration 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 configuration or status of a resource, will be rejected.

This is the default mode when the target handle is first assigned; it enables the application to check the configuration 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 resource's configuration or status.
AP_MODE_COMMIT
This mode is only available if the target handle identifies the domain configuration file (not when issuing verbs to a node). It obtains a lock on the file so that only this application can access it; this file lock ensures that the file will not be modified by any other process during a sequence of verbs issued by this application. The file lock also ensures that no changes are made to the file 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 file, it should be used only for as long as necessary. The application should immediately issue all the verbs that it requires to modify the file and then change to one of the other modes.

If the file lock cannot be obtained (for example, because another program is currently modifying the file), the SET_PROCESSING_MODE verb will fail.

Note: To obtain read/write or commit access to the file, your NOF application must be running with a user ID that is a member of the SNA administrators group system or sna (or running as root). If the user ID is not a member of this group or root, the only valid processing mode is AP_MODE_READ_ONLY.