95-702 OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 14: Naming.

Slides:



Advertisements
Similar presentations
Quantum Quantum Enterprise Solutions, Inc. Quantum JNDI Unleashed Java Conference 2000 March 29, 2000 Peter Fischer Director of Technical Services.
Advertisements

Communicating in J2EE.
Welcome to Middleware Joseph Amrithraj
Web Service Architecture
1 Lecture 12 George Koutsogiannakis/ Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
JNDI Java Naming Directory Interface JNDI is an API specified in Java that provides naming and directory functionality to applications written in Java.
Domain Name System. DNS is a client/server protocol which provides Name to IP Address Resolution.
Naming Computer Engineering Department Distributed Systems Course Asst. Prof. Dr. Ahmet Sayar Kocaeli University - Fall 2014.
Active Directory: Final Solution to Enterprise System Integration
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
Java Naming and Directory Interface JNDI. v001025JNDI2 Topics Naming and Directory Services JNDI Overview Features and Code Samples JNDI Providers References.
Organizational Communication Technologies 1 Enterprise Java Beans Overview.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Name Services Jessie Crane CPSC 550. History ARPAnet – experimental computer network (late 1960s) hosts.txt – a file that contained all the information.
Lecture 10: Web Services. Outline Overview of Web Services Create a Web Service with Sun J2EE (JAX-RPC)
EJB Development and Support Services. EJB Development and Support Services Topics to be Covered: EJB Design Bean/Container Interaction Java Naming and.
Software Engineering Recitation 6 Suhit Gupta. Review Classpath Stream vs. Reader.
Directory & Naming Services CS-328 Dick Steflik. A Directory.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Faculty of Information Technology © Copyright UTS Faculty of Information Technology - JNDIJNDI-1 Advanced Java Programming JNDI v2 Chris Wong
Basics of JNDI Alessio Bechini June Naming and Directory Services: Rationale A fundamental element in every application is the capability to find.
Windows Server WHAT IS ACTIVE DIRECTORY? FUNDAMENTALS OF THE ACTIVE DIRECTORY – Benefits of Using the Active Directory in an Enterprise Environment.
LDAP LIGHT WEIGHT DIRECTORY ACCESS PROTOCOL PRESENTATION BY ALAKESH APURVA DHAN AND ASH.
JNDI Java Naming and Directory Interface See also:
Ch-9: NAME SERVICES By Srinivasa R. Gudipati. To be discussed.. Fundamentals of Naming Services Naming Resolution The Domain Name System (DNS) Directory.
Chapter 16 – DNS. DNS Domain Name Service This service allows client machines to resolve computer names (domain names) to IP addresses DNS works at the.
卓越計劃進度報告 JNDI Java Naming and Directory Interface 網際網路實驗室 報告人 潘燕弘.
Corso di Formazione Sodalia “Enterprise Java Beans” JNDI Java Naming and Directory Interface.
Microsoft Active Directory(AD) A presentation by Robert, Jasmine, Val and Scott IMT546 December 11, 2004.
5.1 Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
1 LDAP and Java Naming Services Murali. M.Nagendranath.
Domain Name System CH 25 Aseel Alturki
October 8, 2015 University of Tulsa - Center for Information Security Microsoft Windows 2000 DNS October 8, 2015.
Topic : JNDI Kaster Nurmukan. JNDI2(c)CDAC(Formerly NCST) What is JNDI? Naming and Directory Services Naming Concepts Issues JNDI Architecture Programming.
Middleware Technology (J2EE/EJB) RMI-IIOP/JNDI. 2 Distributed Objects EJB components are based on distributed objects. A distributed object can be called.
Advanced Programming Rabie A. Ramadan 7.
Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to.
1 Chapter Summary Understanding DNS Understanding Name Resolution Configuring a DNS Client Understanding Active Directory Understanding Active Directory.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI-IIOP.  RMI-IIOP combines RMI-style ease of use with CORBA cross-language interoperability  Java™ Remote Method Invocation (RMI) provides a simple.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Page 1 Active Directory and DNS Lecture 2 Hassan Shuja 09/14/2004.
Enterprise Integration Patterns CS3300 Fall 2015.
Java Naming and Directory Interface Matt. 2 What is JNDI.
The Ecology and Biodiversity of Libraries Chris Mueller Software Libraries Workshop Dagstuhl, Germany March 9, 2005.
Kemal Baykal Rasim Ismayilov
WEB SERVER SOFTWARE FEATURE SETS
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Library Example February 2010 – August 2010
Java Naming and Directory Interface. Contents Naming and directory services JNDI RMI Conclusion.
JAVA LDAP Dima Ionut Daniel. Contents What is LDAP? LDAP Operations Directory Service JNDI as LDAP API Pooling Spring LDAP UnboundId LDAP SDK JAVA LDAP.
Windows 2003 Architecture, Active Directory & DNS Lecture # 3 Hassan Shuja 02/14/2006.
Lecture 9: Name and Directory Servers CDK4: Chapter 9 CDK5: Chapter 13 TVS: Chapter 5.
DEVELOPING WEB SERVICES WITH JAVA DESIGN WEB SERVICE ENDPOINT.
Active Directory Domain Services (AD DS). Identity and Access (IDA) – An IDA infrastructure should: Store information about users, groups, computers and.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
J2EE Lecture 10: EJB 3.0 Overview
Master of Information System Management
Net 323 D: Networks Protocols
Bina Ramamurthy Chapter 9
Bina Ramamurthy Chapter 9
Remote method invocation (RMI)
Bina Ramamurthy Chapter 9
LDAP LIGHT WEIGHT DIRECTORY ACCESS PROTOCOL
Presentation transcript:

OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 14: Naming

OCT 2 Master of Information System Management Before working with EJB’s Understand the role of JNDI (Java Naming and Directory Interface)

OCT 3 Master of Information System Management Naming Concepts from the JNDI Tutorial Java Naming and Directory Interface

OCT 4 Master of Information System Management Naming Concepts We often need to map people friendly names to objects. Examples: Mike’s mailbox -> cnn’s web serverwww.cnn.com c:\somedir\f1.dat -> a file on a C drive Notice the hierarchies in each case.

OCT 5 Master of Information System Management Naming Conventions Different naming systems use different conventions (or syntax) for names Examples: DOS uses slashes and colons and periods c:\some\f.dat Unix uses slashes /usr/local/filename DNS uses dots LDAP (The lightweight directory access protocol) uses name, value pairs cn=Rosanna Lee, o=Sun, c=US

OCT 6 Master of Information System Management Bindings A binding is the association of a name with an object or an object reference. Examples: is bound to an IP address. c:\exam1.doc is bound to a file is bound to a phone.

OCT 7 Master of Information System Management Bindings A binding is the association of a name with an object or object reference. The phone book maps names to numbers which act as references to objects. The number is a communication endpoint. A communication endpoint is specific information on how to access an object

OCT 8 Master of Information System Management Context A context is a set of name-to-object bindings. Every context has an associated naming convention. A context may allow operations such as bind, unbind, lookup. A context may associate a name with another context (subcontext, or subdirectory).

OCT 9 Master of Information System Management Naming System A naming system is a connected set of contexts of the same type (they have the same naming convention) and provides a common set of operations. DNS and LDAP, for example, are two naming system. A naming system provides a naming service to its customers for performing naming-related operations. For example, associate a new name with an IP address. A namespace is the set of names in a naming system.

OCT 10 Master of Information System Management Directory Service A Directory Service is an extension of a naming service that allows one to lookup objects based on names or based on attributes. Attributes have attribute identifiers and a set of attribute values. For example, UDDI - Universal Description, Discovery and Integration is a Directory Service.

OCT 11 Master of Information System Management Reverse lookup or content- based searching Example queries to directory services: Find all machines whose IP address begins with Find all companies that provide hardware support services.

OCT 12 Master of Information System Management Directory Enabled Applications A directory-enabled application is an application that uses a naming or directory service. Applications can share the common infrastructure provided by the directory. Example: A mail client, scheduling systems and mail forwarding program might all use the same address book stored in a common directory. The directory may also be used as an Object store for programs needing the same object.

OCT 13 Master of Information System Management Java Naming and Directory Interface JNDI

OCT 14 Master of Information System Management Java Naming and Directory Interface (JNDI) An abstraction API (like JDBC handles different RDBMS databases) The JNDI API handles or sits on top of different naming services. Java Application JNDI API LDAPDNSrmiregistry Various Service Providers File System must be downloaded File System

OCT 15 Master of Information System Management JNDI The javax.naming packages contains mostly Java interfaces. Some vendor implements the interface to provide JNDI support for their service. To use the service, you need a JNDI Service Provider that implements the interface. JDK1.4 comes with RMI, DNS, COS, and LDAP Service providers. Sun’s web site has an additional JNDI Service Provider that works with the local file system

OCT 16 Master of Information System Management JNDI A namespace is a logical space in which names can be defined. The same names in different namespaces cause no collisions. Namespaces can be nested: - file system directories are nested. - the Internet DNS domains and sub-domains are nested.

OCT 17 Master of Information System Management Namespaces are represented by the Context Interface Different classes implement this interface differently depending on which naming service they are accessing. Has methods to - bind and unbind objects to names - create and delete sub-contexts - lookup and list names Since a Context is a Java object it can be registered in another Context with its own name.

OCT 18 Master of Information System Management The Context Interface Start from some “root” context. Get the “root” from the InitialContext class Examples LookUp.java ListCurrentDirectory.java

OCT 19 Master of Information System Management LookUp.java // pre: download JNDI provider from Sun // add.jar files to classpath import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import java.util.Hashtable; import java.io.File;

OCT 20 Master of Information System Management public class LookUp { public static void main(String args[]) throws NamingException { try { System.out.println("Using a file system (FS) provider"); // initialize the context with properties for provider // and current directory Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put(Context.PROVIDER_URL, "file:D:\\McCarthy\\www\\95-702\\examples\\JNDI"); Context ctx = new InitialContext(env); Object obj = ctx.lookup(args[0]);

OCT 21 Master of Information System Management if(obj instanceof File) { System.out.println("Found a file object"); System.out.println(args[0] + " is bound to: " + obj); File f = (File) obj; System.out.println(f + " is " + f.length() + " bytes long"); } // Close the context when we're done ctx.close(); } catch(NamingException e) { System.out.println("Naming exception caught" + e); }

OCT 22 Master of Information System Management D:\McCarthy\www\95-702\examples\JNDI>java LookUp LookUp.java Using a file system (FS) provider Found a file object LookUp.java is bound to: D:\McCarthy\www\95-702\examples\JNDI\LookUp.java D:\McCarthy\www\95-702\examples\JNDI\LookUp.java is 1255 bytes long

OCT 23 Master of Information System Management ListCurrentDirectory.java // Use JNDI to list the contents of the current // directory import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.naming.NamingEnumeration; import javax.naming.NameClassPair; import java.util.Hashtable; import java.io.File;

OCT 24 Master of Information System Management public class ListCurrentDirectory { public static void main(String args[]) throws NamingException { try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put(Context.PROVIDER_URL, "file:D:\\McCarthy\\www\\95-702\\examples\\JNDI");

OCT 25 Master of Information System Management Context ctx = new InitialContext(env); NamingEnumeration list = ctx.list("."); while (list.hasMore()) { NameClassPair nc = (NameClassPair)list.next(); System.out.println(nc); } ctx.close(); } catch(NamingException e) { System.out.println("Naming exception caught" + e); }

OCT 26 Master of Information System Management D:\McCarthy\www\95-702\examples\JNDI>java ListCurrentDirectory ListCurrentDirectory.class: java.io.File ListCurrentDirectory.java: java.io.File LookUp.java: java.io.File SimpleJNDI.java: java.io.File x: javax.naming.Context x is a DOS directory

OCT 27 Master of Information System Management // Use JNDI to change to a sub directory and list contents import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.naming.NamingEnumeration; import javax.naming.NameClassPair; import java.util.Hashtable; import java.io.File; public class ChangeContext { public static void main(String args[]) throws NamingException { try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put(Context.PROVIDER_URL, "file:D:\\McCarthy\\www\\95-702\\examples\\JNDI");

OCT 28 Master of Information System Management Context ctx = new InitialContext(env); // a subdirectory called x contains a file f.txt and a subdirectory t Context sub = (Context)ctx.lookup("x"); NamingEnumeration list = sub.list("."); while (list.hasMore()) { NameClassPair nc = (NameClassPair)list.next(); System.out.println(nc); } ctx.close(); sub.close(); } catch(NamingException e) { System.out.println("Naming exception caught" + e); }

OCT 29 Master of Information System Management D:\McCarthy\www\95-702\examples\JNDI>java ChangeContext f.txt: java.io.File t: javax.naming.Context