140 likes | 310 Views
Naming and Directory Services. Celsina Bignoli bignolic@smccd.net. Naming Services. maintains a set of bindings bindings relate names to objects must provide the following minimal functionality ability to bind names to objects ability to look up objects by name
E N D
Naming and DirectoryServices Celsina Bignoli bignolic@smccd.net
Naming Services • maintains a set of bindings • bindings relate names to objects • must provide the following minimal functionality • ability to bind names to objects • ability to look up objects by name • names within the service must abide to the same naming conventions
Name Name Name Naming Service Structure Client Name Binding Binding Binding Naming Service
Existing Naming Services • COS (Common Object Services) Naming • The naming service for CORBA applications • DNS (Domain Name System) • The Internet's naming service; maps people-friendly names (such as www.etcee.com) into computer-friendly IP (Internet Protocol) addresses • LDAP (Lightweight Directory Access Protocol) • Developed by the University of Michigan; as its name implies, it is a lightweight version of DAP (Directory Access Protocol), which in turn is part of X.500, a standard for network directory services. Currently, over 40 companies endorse LDAP. • NIS (Network Information System) and NIS+ • Network naming services developed by Sun Microsystems. Both allow users to access files and applications on any host with a single ID and password.
Directory Services • a directory is a system of correlated entries • each entry may refer to any concrete or abstract object (employee, printer, service, file …) • An entry has attributes associated with it • an attribute consists of a name and one or more values • A directory service is a naming service with additional functionality for manipulating attributes • simple databases • allow you to locate entries based on attributes, not only name
Name Name Name Attr Attr Attr Directory Service Structure Client Name Entry Entry Entry Directory Service
Directory Structure Employee1 Employees Employee2 Company Printers Computer1 Hardware Computers Computer2 Fax Machines
Existing Naming & Directory Services • Examples: • LDAP (Lightweight Directory Access Protocol) • NIS (Network Information System) • Novell’s NDS (Network Directory System) • Each has its own proprietary set of services • Makes it hard to switch between systems
JNDI • Provides a common interface to disparate directory services • You can use behind the scene an heterogeneous set of Naming and Directory systems making it look like one, and not having to learn their specific APIs
JNDI Architecture Client Code JNDI Client API Service Provider Interface LDAP Service Provider NIS Service Provider File System Service Provider
JNDI Concepts • Atomic name: indivisible name • Ex: usr, local • Compound name:zero or more atomic names put together according to a specific syntax • Ex: /usr/local • Binding: association of a name with an object • Ex: /usr/local has 2 bindings one for usr and one for local • Context:a set of 0 or more bindings, with its own distinct atomic name • Ex: directory /etc contains mtab and exports /etc is a context containing bindings mtab and exports
JNDI Concepts (2) • Naming system: connected set of contexts that use the same name syntax • Ex: folder tree in a file system • Namespace: set of names in a name system • Composite Name: name that spans multiple naming systems • Ex: http://www.trilogy.com/products/products.jsp URLscheme-idDNSfile system
The Context Interface public NamingEnumeration list(Name name) throws NamingException; public NamingEnumeration list(String name) throws NamingException; public Object lookup(Name name) throws NamingException; public Object lookup(String name) throws NamingException; public void bind(Name name, Object obj) throws NamingException; public void bind(String name, Object obj) throws NamingException; public void rebind(Name name, Object obj) throws NamingException; public void rebind(String name, Object obj) throws NamingException; public void unbind(Name name) throws NamingException; public void unbind(String name) throws NamingException; …
Initial Context Factories • Initial Context: starting point from where to perform naming and directory operations • Initial Context Factory: used to acquire initial context. Implemented by JNDI Drivers see code example using JNDI