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

Slides:



Advertisements
Similar presentations
Communicating in J2EE.
Advertisements

11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Technische universität dortmund Service Computing Service Computing Prof. Dr. Ramin Yahyapour IT & Medien Centrum 12. November 2009.
DIGIDOC A web based tool to Manage Documents. System Overview DigiDoc is a web-based customizable, integrated solution for Business Process Management.
Java Network Programming Vishnuvardhan.M. Dept. of Computer Science - SSBN Java Overview Object-oriented Developed with the network in mind Built-in exception.
General introduction to Web services and an implementation example
JNDI Java Naming Directory Interface JNDI is an API specified in Java that provides naming and directory functionality to applications written in Java.
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.
Distributed Application Development B. Ramamurthy.
Name Services Jessie Crane CPSC 550. History ARPAnet – experimental computer network (late 1960s) hosts.txt – a file that contained all the information.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 14: Naming.
3.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 3: Introducing Active Directory.
Software Engineering Recitation 6 Suhit Gupta. Review Classpath Stream vs. Reader.
1. Introducing Java Computing  What is Java Computing?  Why Java Computing?  Enterprise Java Computing  Java and Internet Web Server.
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.
Component Based Systems Analysis Introduction. Why Components? t Development alternatives: –In-house software –Standard packages –Components 60% of the.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 7: Planning a DNS Strategy.
3.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 3: Introducing Active Directory.
LDAP LIGHT WEIGHT DIRECTORY ACCESS PROTOCOL PRESENTATION BY ALAKESH APURVA DHAN AND ASH.
Understanding and Managing WebSphere V5
Configuration Management Supplement 67 Robert Horn, Agfa Healthcare.
ADVANCED MICROSOFT ACTIVE DIRECTORY CONCEPTS
ODBC Open DataBase Connectivity a standard database access method developed by Microsoft to access data from any application regardless of which database.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Java Beans.
卓越計劃進度報告 JNDI Java Naming and Directory Interface 網際網路實驗室 報告人 潘燕弘.
Corso di Formazione Sodalia “Enterprise Java Beans” JNDI Java Naming and Directory Interface.
LIGHT WEIGHT DIRECTORY ACCESS PROTOCOL Presented by Chaithra H.T.
Enterprise JavaBeans EJB Container Services. EJB container Enterprise JavaBeans are deployed in an EJB container within the application server EJB container.
Microsoft Active Directory(AD) A presentation by Robert, Jasmine, Val and Scott IMT546 December 11, 2004.
Component Architecture (CORBA – RMI) -Shalini Pradhan.
第十四章 J2EE 入门 Introduction What is J2EE ?
1 LDAP and Java Naming Services Murali. M.Nagendranath.
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.
Designing and Developing WS B. Ramamurthy. Plans We will examine the resources available for development of JAX-WS based web services. We need an IDE,
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.
Comparing JavaBeans and OSGi Towards an Integration of Two Complementary Component Models HUMBERTO CERVANTES JEAN-MARIE FAVRE 09/02.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
12/6/2015B.Ramamurthy1 Java Database Connectivity B.Ramamurthy.
Jini Architecture Introduction System Overview An Example.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
WEB SERVER SOFTWARE FEATURE SETS
Java Network Programming Network Programming Spring 2000 Jeffrey E. Care
Spring LDAP Dima Ionut Daniel.
Active Directory. Computers in organizations Computers are linked together for communication and sharing of resources There is always a need to administer.
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.
Directory Services CS5493/7493. Directory Services Directory services represent a technological breakthrough by integrating into a single management tool:
Active Directory Domain Services (AD DS). Identity and Access (IDA) – An IDA infrastructure should: Store information about users, groups, computers and.
Master of Information System Management
Knowledge Byte In this section, you will learn about:
Introduction to Name and Directory Services
Bina Ramamurthy Chapter 9
Java Database Connectivity
Bina Ramamurthy Chapter 9
Bina Ramamurthy Chapter 9
ACTIVE DIRECTORY An Overview.. By Karan Oberoi.
Knowledge Byte In this section, you will learn about:
LDAP LIGHT WEIGHT DIRECTORY ACCESS PROTOCOL
TN19-TCI: Integration and API management using TIBCO Cloud™ Integration
Presentation transcript:

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

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI API n Standard access for Java programs to naming and directory services and features – abstraction over naming and directory services APIs – Provides a key integration point between Java and enterprise naming and directory service middleware n Allows Java applications to access multiple directory services independent of implementation n Using JNDI applications can store and retrieve named Java objects of any type n Provides methods for performing standard directory operations – associating attributes with objects – searching for objects using those attributes as search keys n Consists of two API sets – JNDI API - application access to naming and directory services – JNDI SPI - interface that vendors use to wrap their implementation to conform to JNDI

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Architecture Java Applications CORBA COS LDAPRMINDSWebLogic JNDI API JNDI SPI JNDI Implementation Manager

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Naming Service n Naming Service – Map names to objects or object references – Maps a logical, easy-to-read name to a physical endpoint Naming Service Logical Name Physical Name CustomerData URL=jdbc:odbc:customer ColorPrinter machine:xxx.yyy.zzz.aaa Database CustomerDatabase; Printer myPrinter; CustomerDatabase = lookup (CustomerData); myPrinter = lookup (ColorPrinter);

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Directory Service n Directory Service – Extends a naming service by allowing association of attributes with an object – Allows lookup based upon attribute values Directory Service Attr. 1 Dir Object Attr. 2 Attr. 3 Attr. 4 // Search for objects based on attributes // Modifying attributes on directory // Store objects in directory

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Definitions n NameSpace – Set of names that are all unique n Compound Name – Sequence of naming elements that conform to the naming convention of a namespace n Composite Name – A name that spans multiple namespaces n Service Provider – Provides naming and directory functionality and supports the JNDI SPI

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Service Providers Service ProviderDescription COS NamingProvides access to CORBA naming service. File SystemProvides access to file system in a platform-independent manner. Even allows storage of object references. LDAPSupports versions 2 and 3. NISProvides access to UNIX machines running NIS. NIS+Provides better support for security, scalability and dynamic updates. NovellProvides access to Novells 3.x bindery, Novell File System as well as other Novell services. RMI RegistryProvides access to objects stored in the RMI Registry. SLPProvides a dynamic framework for selection of networks services. WebLogic JNDIProvides interface for java application server services, including RMI, JDBC, EJB. Includes toolkits for building customized naming an directory providers.

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Composite Namespace

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services LDAP n Provides a light-weight version of the X.500 directory service that runs on TCP/IP. n Allows networked users access to information and resources in a simple and clean manner – Prides simple searching facility that allows you to search and modify entries based upon their position in the hierarchy – context – Attributes can be associated with entries -

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Packages javax.naming classes and interfaces for accessing naming services. javax.naming.directory classes that extend javax.naming to provide access to directories javax.naming.event Classes and interfaces that support event notification in naming and directory services javax.naming.ldap Classes and interfaces that support LDAP v3 extensions and controls javax.naming.spi Classes and interfaces that support the addition of new services providers

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Constructs n Context – Specifies naming context operations – Interface that is implemented by InitialContext and InitialDirContext classes n NameClassPair – Contains an objects name and the name of the objects class n Binding – Contains the name of the bound object, name of the objects class, and the object n Reference – Represents an object that is not stored in the directory service n JNDI Environment – Contains the setting for JNDI run-time n Directory Object – Represents the variety of information in a computing environment – Provides operations for creating attributes, adding, removing and modifying attributes associated with the directory object

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Environment Variables n Environment properties can be specified in: – Hashtable that is programmatically setup – Read in from a stored JNDI resource file that stores name/value pairs – Application resource files located in CLASSPATH n Environment is passed into InitialContext and InitialDirContext constructors CategoryDescription Standard JNDI PropertiesDefined by JNDI and are common across all service providers. Individual service providers map these to an interpretation appropriate for their service. INITIAL_CONTEXT_FACTORY Service-SpecificCommon across all service providers that implement a particular service or protocol. DNS_URL, PROVIDER_URL Feature-SpecificCommon across all service providers that support a particular feature. SECURITY_PRINCIPAL, SECURITY_PRINCIPAL Provider-SpecificApply to a particular service provider.

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Object Operations OperationDescription LookupLocates an object by name Store objectObject stored in directory service if directory service support object storage and the object is serializable. Uses Context.bind method Store object referenceObject reference stored in directory service. Object stored in external data source. Add ObjectObject can be added to namespace. Rename ObjectObject can be renamed in namespace. Move ObjectObject can be moved around namespace. Delete ObjectObject can be deleted from namespace.

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Working with References Naming Service Logical Name Physical Name Fred Jones physical address reference … Customer customer; CustomerDatabase = lookup (CustomerData); customer = (Customer)lookup (Fred Jones); Object Repository locate Instantiate

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Naming Package CompositeName CompoundName InitialContext NameClassPair Binding NamingEnumeration Context Name

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Programming Model n Read in Environment – Configuration of the JNDI environment n Everything starts with a Context – Either InitialContext or DirContext n Use Context to add, delete, rename and move entries

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Context Operations // Step 1 - Setup Environment using File System provider Hashtable env = new Hashtable(); env.put (Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put (Context.PROVIDER_URL, "file:/company"); // Step 2 - Get InitialContext Context ctx = new InitialContext (env); // Step 3 – Add an object File myFile; // Create the physical file and add info Ctx.bind (marketing/brochure.txt, myFile); // Step 4 – Locate an object File myFile = (File)ctx.lookup (marketing/brochure.txt); Setup the environment for a specific service provider Create the initial context Uses the jndi environment Locating a specific file uses lookup method Adding a file uses bind method

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Context Operations // Step 1 - Setup Environment Hashtable env = new Hashtable(); env.put (Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put (Context.PROVIDER_URL, "file:/company"); // Step 2 - Get InitialContext Context ctx = new InitialContext (env); // Rename an object ctx.rename ("Feb", "Feb2000"); // Create an object ctx.createSubcontext ("Feb2000"); // Delete an object ctx.unbind ("Feb2000"); Setup the environment for a specific service provider Create the initial context Renaming a specific file uses bind method Deleting a file uses unbind method Creating a file directory uses createSubcontext method

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Context Operations – List Entries // Step 1 - Setup Environment Hashtable env = new Hashtable(); env.put (Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put (Context.PROVIDER_URL, "file:/company"); // Step 2 - Create initial context Context ctx = InitialContext(env); // Step 3 - setup list criteria NamingEnumeration list = ctx.list (presentations"); // Step 4 - Process List while (list.hasMore()) { NameClassPair entry = (NameClassPair)list.next(); System.out.println(entry); } Setup the environment for a specific service provider Create the initial context Uses the jndi environment Each entry in NamingEnumeration is a NameClassPair Use the list method to return a NamingEnumeration for a certain directory

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI Context Operations – List Bindings // Step 1 - Setup Environment Hashtable env = new Hashtable(); env.put (Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put (Context.PROVIDER_URL, "file:/company"); // Step 2 - Create initial context Context ctx = InitialContext(env); // Step 3 - setup list criteria NamingEnumeration bindings = ctx.listBindings ("presentation"); // Step 4 - Process List while (list.hasMore()) { Binding binding= (Binding)bindings.next(); System.out.println(binding.getName() + ":" + binding.getObject()); } Setup the environment for a specific service provider Create the initial context Uses the jndi environment Each entry in NamingEnumeration is a Binding Use the listBindings method to return a NamingEnumeration for a certain directory

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Service Provider Differences // Step 1 - Setup Environment Hashtable env = new Hashtable(); env.put (Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put (Context.PROVIDER_URL, "file:/company"); // Step 2 - Get InitialContext Context ctx = new InitialContext (env); // Step 3 – Add an object File myFile; // Create the physical file and add info Ctx.bind (marketing/brochure.txt, myFile); // Step 4 – Locate an object File myFile = (File)ctx.lookup (marketing/brochure.txt); // Step 1 - Setup Environment Hashtable env = new Hashtable(); env.put (Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put (Context.PROVIDER_URL, ldap://marketing.qes.com"); // Step 2 - Get InitialContext Context ctx = new InitialContext (env); // Step 3 – Add an object File myFile; // Create the physical file and add info Ctx.bind (cn=marketing/brochure.txt, myFile); // Step 4 – Locate an object File myFile = (File)ctx.lookup (cn=marketing/brochure.txt);

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI and JDBC - Storing JDBC URLs // Step 1 - Setup Environment env.put (Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.T3InitialContextfactory"); env.put (Context.PROVIDER_URL, "t3://marketing:7001"); env.put (Context.SECURITY_PRINCIPAL user); env.put (Context.SECURITY_CREDENTIALS, password); // Step 2 - Create initial context Context ctx = InitialContext(env); // Step 3 - Store the URL using JNDI String strJDBCUrl = new String; strJDBCUrl = "jdbc:inetdae:marketing:1433database=marketing"; ctx.bind ("MarketingDB", strJDBCUrl); Store the URL using MarketingDB as logical name Using weblogic jndi provider

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services JNDI and JDBC - Retrieving JDBC URLs // Step 1 - Setup Environment env.put (Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.T3InitialContextfactory"); env.put (Context.PROVIDER_URL, "t3://marketing:7001"); env.put (Context.SECURITY_PRINCIPAL user); env.put (Context.SECURITY_CREDENTIALS, password); // Step 2 - Create initial context Context ctx = InitialContext(env); // Step 3 - Retrieve the URL using JNDI String strJBDCUrl = new String; strJDBCUrl = (String)ctx.lookup ("MarketingDB"); // Step 4 - Open the database Connection con = DriverManager.getConnection (strJDBCUrl, env.SECURITY_PRINCIPAL env.SECURITY_CREDENTIALS); Using weblogic jndi provider Lookup the MarketingDB URL Pass the URL to JDBC To create connection

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Directory Package BasicAttributes ModificationItem BasicAttribute InitialContext InitialDirContext DirContext Attribute Attributes Context SearchControls NameClassPair Binding SearchResult java.io.Serializable

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Read Attributes from a Directory Entry // Step 1 - Setup Environment env.put (Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.T3InitialContextfactory"); env.put (Context.PROVIDER_URL, "t3://marketing:7001"); env.put (Context.SECURITY_PRINCIPAL user); env.put (Context.SECURITY_CREDENTIALS, password); // Step 2 - Create initial context Context dirCtx = InitialDirContext(env); // Step 3 - setup list criteria Attributes attrList = dirCtx.getAttributes (cn=name, ou=marketing); // Step 4 - Process List while (attrList.hasMore()) { Attribute attr = (Attribute )attrList.next(); for (NamingEnumeration ne = attr.getAll() ; ne.hasMore(): System.out.println( value: + ne.next() ) ); } Use getAttributes to get attributes for an entry Use next and hasMore to loop through attributes

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Search Entries by Attributes // get input from user String strLastName; strLastName = … // Step 1 – Specify attributes to match // Search by Last Name Attributes matchAttrs = new BasicAttributes (true); matchAttrs.put(new BasicAttribute(sn, strLastName) ); // Step 2 – Search for objects within a context NamingEnumeration results = ctx.search(ou=Marketing, matchAttr); // Step 3 - Process List while (result.hasMore()) { SearchResult result = (SearchResult )result.next(); System.out.println( name: + result.getName()) ); printAttributes (result.getAttributes()); } Use next and hasMore to loop through results Use search and pass the attribute to search on

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Working with Events n Uses an event model similar to that of AWT and JavaBeans n Can be used for the following – Notification of namespace changes n adding, changing, renaming objects – Notification of object changes n Changing object

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Event Package ObjectChangeListener EventContext NamingListener NamespaceChangeListener Java.util.EventObject NamingEvent java.io.Serializable n Uses an event model similar to that of AWT and JavaBeans n Can be used for the following – Notification of namespace changes n adding, changing, renaming objects – Notification of object changes n Changing object

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Working with Events NamingListeners NamespaceChangeListenerObjectChangeListener Context Object Register Event

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Wrap Up n JNDI is full-featured – We touched the tip of the iceberg n Storage of objects – Can store all types of objects n Location Service for system objects – Store JBDC URLs – EJB n Event support provide event-driven programming and notifications – Create proactive environments that respond to events

Quantum © Quantum Enterprise Solutions, Inc.2000 Peter Fischer Director of Technical Services Questions Peter Fischer Director of Technical Services 115 Route 46 Suite A4 Mountain Lakes, New Jersey Phone