Previous | Contents | Index |
The payroll example program is a simple client/server application that
makes minimal use of the DCE services. Its main intent is to show a
complete example application with FORTRAN code. See Chapter 16 for a
detailed description of this example program.
20.8 RPC Phonebook Program
This section describes how to build and run a phonebook application called phnbk. Company employees use the phnbk client program to look up employee contact information that resides with the phnbk server.
The phnbk application is included with Digital DCE for OpenVMS. Because the phnbk source code is portable, you can build and run the phnbk server on many DCE machines.
The sample phnbk client/server program demonstrates several aspects of cross-environment applications:
To build the phnbk client and server programs on an OpenVMS
system that has Digital DCE Version 1.5 installed, copy the files to
your directory and build the program, as follows:
$ COPY SYS$COMMON:[SYSHLP.EXAMPLES.DCE.RPC.PHONEBOOK]*.* [] |
$ @PHNBK.COM |
After the build is complete, you can run the server and the client. Note that you have the ability to log all events with the RPC Event Logger. See Chapter 17 for information on activating and using the event logger.
On OpenVMS systems, you must define a foreign command with the full directory specification. For example:
$ PHNBKD :== "$MYDISK:[MYDIRECTORY]PHNBKD.EXE" |
Start the server with the following command:
$ PHNBKD |
The server displays the binding information for each of the protocol sequences it is using. Three elements make up a server's binding information: a protocol sequence, a network address, and a transport end point. For example, a server might report the following binding information.
[1] 23789 ncacn_ip_udp:16.20.16.134.[1229] ncacn_ip_tcp:16.20.15.134.[1474] |
Once the server is running, you can run the client on the same host or on any other host in the network. To run the client, you can either provide the server binding information reported by the server as a command line argument or run it without arguments. Running it without arguments lets the client application resolve server binding information through the name service.
To run the client on OpenVMS, you must first define a foreign command with the full directory specification. For example:
$ PHNBK :== "$MYDISK:[MYDIRECTORY]PHNBK.EXE" |
When specifying an end point, start the client with the following command:
$ PHNBK ncacn_dnet_nsp:2.642[RPC2080001] |
The phnbk client is a simple interactive application that prompts you for the following commands:
Resolving binding through name server Server returned from name server is: ncacn_ip_tcp:16.20.16.134[] Valid commands are: (b)rowse - List next entry (r)eset - Reset to beginning of file (f)ind <STRING> - Find a substring (f)ind - Find next occurrence of <STRING> (q)uit - Exit program |
Note that the string argument is case-sensitive.
To stop the client, use the (q)uit command from the client
menu.
20.9 Other Example Programs
The following additional example programs are shipped with Digital DCE for OpenVMS:
SYS$COMMON:[SYSHLP.EXAMPLES.DCE.GDE_DCE_APPS.ARITHMETIC] |
SYS$COMMON:[SYSHLP.EXAMPLES.DCE.GDE_DCE_APPS.INVENTORY] SYS$COMMON:[SYSHLP.EXAMPLES.DCE.GDE_DCE_APPS.INVENTORY.IMPLICIT] SYS$COMMON:[SYSHLP.EXAMPLES.DCE.GDE_DCE_APPS.INVENTORY.EXPLICIT] |
SYS$COMMON:[SYSHLP.EXAMPLES.DCE.GDE_DCE_APPS.REMOTE_FILE] |
SYS$COMMON:[SYSHLP.EXAMPLES.DCE.GDE_DCE_APPS.TRANSFER_DATA] |
These example programs are all documented in detail in the appendixes of the Guide to Writing DCE Applications.
To copy, build, and run the examples on either OpenVMS or OpenVMS POSIX, see the README files for each example program.
This appendix provides information on using the Namespace Editor (NSedit). Note that at this time NSedit is only a prototype of a system management tool. Note also that this release of NSedit does not yet have complete functionality.
NSedit is a graphical user interface to the namespace. A namespace is a
collection of names that one or more CDS servers know about, look up,
modify, and share. Usually only one namespace is associated with a
particular cell.
A.1 Starting NSedit
To start NSedit, you must first log in to DCE as cell_admin. Then, enter the following command:
$ MCR DCE$NSEDIT |
NSedit is a Graphical User Interface for CDS. Although it does not provide the complete functionality of the CDS clerk interface, it does provide a user-friendly environment for creating, viewing, and modifying entries in a namespace.
NSedit provides an additional level of namespace data caching. The NSedit cache is used to store data read from the clerk's local cache or from the CDS server. This allows for faster retrieval of data at the expense of accuracy. (Changes may have occurred in the namespace that are not reflected in the NSedit cache.) The tradeoff between speed and accuracy can be controlled by setting the appropriate mode in the Display menu of the tree browser.
NSedit consists of three windows:
The tree browser lets you view the namespace and create and delete namespace entries. Each CDS entry is represented in the tree browser by a rectangle containing the name of the entry and an icon indicating the entry type. A CDS entry can be one of the following:
The tree browser provides the user with the ability to expand a node
and view all its children (objects, subdirectories, or soft links) by
clicking Mouse Button 3 (MB3) on a tree node or by specifying the
appropriate maximum tree level to display, as described in Section A.3.1.
A.2.2 Entry Attributes Window
The Entry Attributes Window is the part of NSedit that lets you create,
view, modify, and delete attributes and values from an existing object,
directory or \ soft link. When you select a CDS entry with the tree
browser, the attributes and values of this entry are shown on the Entry
Attributes Window. You can then add, modify, or delete attributes from
this entry, as described in this appendix.
A.2.3 ACL Window
This window lets you perform the following functions.
The following sections describe what you can do with NSedit.
A.3.1 Expanding and Collapsing Tree Nodes
To expand a tree node and view its children, click MB3 on the node. This works only for directory and soft link nodes. For example, by successively expanding nodes, you can see all of the hosts's children as well as their children.
To collapse a tree node whose children are at a higher level than the
maximum tree level specified by the user (with the Set Level selection
of the Display menu), click MB3 on the node. The node will not collapse
if the level of its children is lower than the maximum tree level. The
default maximum tree level is 1, which means that only the children of
the root node are displayed.
A.3.2 Creating an Object or a Directory
To create an object or directory:
If the object or directory has been successfully created, a new
rectangle with the name of the new object or directory appears as a
child of the specified parent directory. If CDS cannot create the
object or directory, an error message appears.
A.3.3 Creating and Viewing a Soft Link
Note that the following functionality is not yet supported.
If the soft link has been successfully created, a new rectangle with
the name of the new soft link is displayed as a child of the specified
parent directory. To verify the creation of the soft link, you can
click the right mouse button on the soft link rectangle. If CDS could
not create the soft link, an error message appears.
A.3.4 Deleting an Entry
To delete an entry:
If the entry has been successfully deleted, the rectangle will also
disappear from the tree structure. If CDS could not delete the entry,
an error message is displayed.
A.3.5 Viewing Attributes and Values
To view the attributes and values of a CDS entry, click the left mouse
button on this entry in the Tree Browser window. The attributes and
values of this entry is displayed in the Entry Attributes Window. An
alternative way to view an entry is to type its full name in the top
left selection area. Then the attributes and values of this entry is
displayed in the Entry Attributes Window (or an empty list will appear
if the entry does not exist).
A.3.6 Creating a Group and Adding Members
To create a group, follow the steps described in Section A.3.2. Select
Create Group from the create_entry_dialog_popup.
A.4 NSedit Menus and Dialog Box
There are three pull-down menus in NSedit and one popup dialog box:
The File menu has the following choice:
The Display menu has the following choices:
The Edit menu has the following choices:
The Create Entry Dialog Popup box has the following choices:
Index | Contents |