Java Naming and - PowerPoint PPT Presentation

About This Presentation
Title:

Java Naming and

Description:

This API is uniform for all types of directories. ... File System. RMI Registry. Bea Weblogic Naming Service. Available Service Providers. Atomic Name ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 28
Provided by: Din29
Category:

less

Transcript and Presenter's Notes

Title: Java Naming and


1
Java Naming and Directory Interfaces
2
What is an Naming Services
A naming service is an entity that performs the
following tasks ? It associates names with
objects. Similar to a telephone companys
associating a persons name with a specific
residences telephone number. Application logic
components
3
What is an Naming Services (Contd)
? It provides a facility to find an object based
on a name. This is similar to a telephone
operator finding a persons telephone number
based on that persons name and connecting the
two people together.
4
What is an Naming Services (Contd)
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.
5
What is an Directory Services
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 Microsofts Active
Directory.
6
Problems with Naming and Directory Services
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 Novells Network Directory System(NDS)
7
Enter Java Naming and Directory Interfaces
Java Naming and Directory Interfaces is a system
for Java-based clients to interact with naming
and directory systems
8
Benefits of JNDI
? 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.
9
Benefits of JNDI (Contd)
? 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.
10
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.
11
Available Service Providers
  • 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

12
Understanding the concepts behind JNDI
Naming Concepts
? Atomic Name An atomic name is simple,
basic, indivisible component of a name.
For example In the string c\MyCompany\java\Jnd
i.txt Jndi.txt is an atomic name.
13
Understanding the concepts behind JNDI
Naming Concepts
? 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.
14
Binding
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\stg Consists of
multiple bindings one to user, one to people, one
to education and one to lovin.
15
Naming Service
16
How JNDI differs from other Naming Services
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."
17
How JNDI differs from other Naming Services
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 "cnLovin Varghese, oSTG, cIN"
names the person "cn Lovin Varghese " in the
organization " oSTG, cIN." Likewise, the name
"oSTG, cIN" names the organization "oSTG" in
the country "cIN" .
18
Context
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.
19
Namespace
A namespace is all the names contained within
that naming system.
20
Composite Name
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.
21
Initial Context
One question commonly asked which namespace do
you first look in when traversing the
string http//lovinjava.com/products/product.js
p 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.
22
Directory Service
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.
23
Directory Service
24
Directory Services
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
john_at_xyz.comEmail jdoe_at_abcd.com
25
Directory Services
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.
26
JNDI Api references
? javax.naming ? javax.naming.directory ?
javax.naming.event ? javax.naming.ldap ?
javax.naming.spi
27
Presented By Lovin
Varghese, Technical Manager, Software Technology
Group Ltd. Email id lovin_v_at_yahoo.com
Write a Comment
User Comments (0)
About PowerShow.com