Filesystems Yellow pages The general idea of directories and entries

That is, if Im in building C and Im trying to print a PDF file for a meeting Im attending in building A, I probably dont want to send it to a dot-matrix printer in building D. Since a substantial portion of this functionality is almost completely generic it is required whenever a client program can contact more than one server, we should probably add more functionality to our naming service, and make it capable of handling these requests. The upshot of this discussion is that whenever you have many similar servers between which the users choose on a regular basis e.g., when there is no stable notion of a default server, the RMI registrys design choices are almost certainly inadequate.

14.5.1 Directories and Entries

Recall how we defined a naming service: A naming service is a centralized resource that a number of applications use as a phone book-like resource. That is, it is an easily locatable and well-known application that maps logical names to actual servers so client programs can easily locate and use appropriate server applications. The phone book is a white-pages-style phone book, and logical names are strings. Finding means retrieval based on case-sensitive string equality. That the design choices inherent in the RMI registry are often inadequate doesnt tell us much about how to fix them. Fortunately, we have several decent models available. In particular, either the file systems or the yellow pages approach will work.

14.5.1.1 Filesystems

A filesystem is usually built out of two basic abstractions: Files A file typically has two types of properties: access properties and content-description properties. Access properties include information such as who has permission to edit the file and when the file was last modified. Content-description properties describe what sort of data the file contains. Some operating systems, like Windows, dont really store much in the way of content description. Other operating systems store much more information. For example, BeOS stores a MIME type for each file. Directories or folders A directory sometimes called a folder is something that contains and organizes other things, including files and other directories. Most of the properties associated with a directory are access properties and apply to all the files in the directory.

14.5.1.2 Yellow pages

The yellow pages are an index to goods-and-services providers, located in the back of most phone books. Theyre organized as follows: Entries An entry in the yellow pages consists of the name of an organization or company, the companys main address, and a phone number. In recent years, some yellow pages have also begun including a line of text. Here, for example, is an entry from the yellow pages for Mountain View, California: AQC: Air Quality Control Inc. Cleaning and Decontamination Services 1-800-433-7117 Topics A topic is a logical grouping of entries according to similarity of goods or services provided by the entries. For example, Cleaners is a topic. Topics have only one property: an empty topic can refer you to another topic. Thus, for example, the following topic is empty in my local yellow pages: Swing Sets See: Playground Equipment Unlike directories, which can be nested, topics dont contain other topics. Instead, topics are ordered alphabetically, to make it easier for a human being to search the yellow pages.

14.5.1.3 The general idea of directories and entries

Whats good enough for the yellow pages and filesystems is most likely good enough for a naming service. That is, naming services for distributed applications usually consist of two basic abstractions: Entries An entry is a name, a set of name-value pairs, and enough information to construct a stub. Contexts A context [ 3] is analogous to a directory or a topic. It contains other contexts, and entries as well. Contexts are named and are often allowed to have properties. In addition, there is usually a single base context from which all entries can be reached, either directly or by accessing a context contained in the base context. [ 3] The word context is, unfortunately, the standard term. In addition, we need to define the idea of a logical name. A logical name is neither an entry nor a context. It consists of the following information, rendered in a suitable format: • The machine running the naming service containing the base context and the port to which the server listens • A set of context names that form a path e.g., the first name in the path is the name of a context contained in the base context, the second name in the path is the name of a context contained in the first context, and so on • An entry name In Chapt er 15 , when we build a naming service to replace the RMI registry, we will implement this sort of hierarchical structure.

14.6 Security Issues