java naming and directory interfaces. a naming service is an entity that performs the following...

27
Java Naming and Java Naming and Directory Interface Directory Interface

Upload: marlene-hopkins

Post on 16-Jan-2016

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Java Naming andJava Naming andDirectory InterfacesDirectory Interfaces

Page 2: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

A naming service is an entity that performs the following tasks:

It associates names with objects. Similar to a telephone company’s associating a person’s name with a specific residence’s telephone number. Application logic components

What is an Naming Services

Page 3: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

It provides a facility to find an object based on a name. This is similar to a telephone operator finding a person’s telephone number based on that person’s name and connecting the two people together.

What is an Naming Services (Contd)

Page 4: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

The common example of Naming Services is the Domain Naming Service (DNS), this associate a name with the IP address of the system. The users have to remember the DNS name not the IP address. We do have the File System naming service, which save or opens a specific file based on the file name given.

What is an Naming Services (Contd)

Page 5: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

A directory service is a naming service that has been extended and enhanced to provide directory object operations for manipulating attributes. A directory is a system of directory objects, all connected. Some of the products are Netscape Directory Server and Microsoft’s Active Directory.

What is an Directory Services

Page 6: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Directory vendors differentiate their product lines by offering different types of services. Unfortunately, this leads to different naming and directory standards. For example, directories based on the

Lightweight Directory Access Protocol (LDAP) are accessed differently than those based on

Network Information System(NIS) or

Novell’s Network Directory System(NDS)

Problems with Naming and Directory Services

Page 7: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Java Naming and Directory Interfaces is a system for Java-based clients to interact with naming and directory systems

Enter Java Naming and Directory Interfaces

Page 8: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

JNDI is unified system to access all sorts of directory service information, such as security credentials, phone numbers, electronic and postal mail addresses.…

JNDI is a single API to access different directories with different protocols.

JNDI insulates the application from protocol and implementation details.

JNDI is extensible. Future providers of directories can plug in their particular directory services to JNDI without affecting your client code.

Benefits of JNDI

Page 9: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

JNDI can read and write whole Java objects from directories

You can link different types of directories, such as an LDAP directory with an NDS directory and have the combination appear to be one large, federated directory. The federated directory appears to be on contiguous directory to the client.

JNDI is supported by Sun Microsystems and it is a standard Java extension.

Benefits of JNDI (Contd)

Page 10: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

JNDI Architecture

JNDI made up of two halves: the client API and the Service Provider Interface(SPI). The client API allows Java code to perform directory operations. This API is uniform for all types of directories. JNDI architecture is somewhat like the Java Database Connectivity (JDBC)

In JDBC there is one uniform client API for performing database operations.

In JDBC, relational database vendors provide JDBC drivers to access their particular database.

Page 11: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

• Lightweight Directory Access Protocol (LDAP)• Network Information service( NIS)• Novell Directory Services (NDS )• Service Location Protocol(SLP)• Corba Object Naming Service or COS Naming• File System• RMI Registry• Bea Weblogic Naming Service

Available Service Providers

Page 12: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Atomic Name

An atomic name is simple, basic, indivisible component of a name. For example :

In the string c:\MyCompany\java\Jndi.txt

Jndi.txt is an atomic name.

Understanding the concepts behind JNDI

Naming Concepts

Page 13: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Compound Name

A compound name is zero or more atomic names put together. In the previous example the entire string “c:\MyCompany\java\Jndi.txt” is a compound name.

Understanding the concepts behind JNDI

Naming Concepts

Page 14: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

A binding is an association of a name with an object. For example the file autoexec.bat in the windows file system has a binding to the file data on your hard disk. Note that compound name like

C:\user\people\education\stgConsists of multiple bindings one to user, one to people, one to education and one to lovin.

Binding

Page 15: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Naming Service

Page 16: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Domain Naming Service (DNS)

In DNS, names are built from components that are separated by dots ("."). They read from right to left. The name "www.lovinjava.com" names a machine called "www" in the ”lovinjava.com" domain. Likewise, the name ”lovinjava.com" names the domain ”lovinjava" in the top-level domain "com."

How JNDI differs from other Naming Services

Page 17: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Lightweight Directory Access Protocol(LDAP)

In LDAP, the situation is slightly more complicated. Names are built from components that are separated by commas (","). Like DNS names, they read from right to left. However, components in an LDAP name must be specified as name/value pairs. The name "cn=Lovin Varghese, o=STG, c=IN" names the person "cn= Lovin Varghese " in the organization " o=STG, c=IN." Likewise, the name "o=STG, c=IN" names the organization "o=STG" in the country "c=IN" .

How JNDI differs from other Naming Services

Page 18: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

A context is an object that contains zero or more bindings. A context represents a set of bindings within a naming service that all share the same naming convention. A Context object provides the methods for binding names to objects and unbinding names from objects, for renaming objects, and for listing the bindings.

Context

Page 19: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

A namespace is all the names contained within that naming system.

Namespace

Page 20: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

A composite name is a name that spans multiple naming systems. For example on the web the URL http://lovinjava.com/products/product.jsp is composed from the following namespaces:http : comes from the URL scheme-id namespace. This namespace defines the protocol you use to communicate.Lovinjava.com uses the Domain Name Service(DNS) to translate machine names into IP address.Products and products.jsp are from the file system namespace on the web server machine.

Composite Name

Page 21: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

One question commonly asked which namespace do you first look in when traversing the string

http://lovinjava.com/products/product.jsp

The starting point of exploring a namespace is called an initial context. An initial context simply is the first context you happen to use. An initial context is a starting point for performing all naming and directory operations.

Initial Context

Page 22: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

A directory service associates names with objects and also allows such objects to have attributes. Thus, you not only can look up an object by its name but also get the object's attributes or search for the object based on its attributes.

Directory Service

Page 23: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Directory Service

Page 24: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

A directory service manages a directory of entries. An entry also has attributes associated with it; an attribute consists of a name or identifier and one or more values. These attributes describe the entry. For example, the entry for an individual might have the following attributes (note the two email addresses): Name: John DoeAddress: 123 Somewhere StreetEmail: [email protected]: [email protected]

Directory Services

Page 25: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Directory services are simple databases. Like their relational cousins, many common directory services provide search and filter functionality. Instead of locating an entry only by name, these directory services allow you to locate entries based on a set of search criteria.

Directory Services

Page 26: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

javax.naming javax.naming.directory

javax.naming.event javax.naming.ldap javax.naming.spi

JNDI Api references

Page 27: Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to

Presented By

Lovin Varghese,Technical Manager,Software Technology Group Ltd.

Email id : [email protected]