Software Engineering Recitation 6 Suhit Gupta. Review Classpath Stream vs. Reader.

Slides:



Advertisements
Similar presentations
Lightweight Directory Access Protocol (LDAP) By Raghavendra Aekka Professor Dr. Ravi Mukkamala.
Advertisements

Naming Computer Engineering Department Distributed Systems Course Asst. Prof. Dr. Ahmet Sayar Kocaeli University - Fall 2014.
Active Directory: Final Solution to Enterprise System Integration
Java Naming and Directory Interface JNDI. v001025JNDI2 Topics Naming and Directory Services JNDI Overview Features and Code Samples JNDI Providers References.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 14: Naming.
LDAP Jianwen Luo School of CTI, Depaul Univ. Oct.23, 1998.
COMS W3156: Software Engineering, Fall 2001 Lecture #14: Implementation II, LDAP Janak J Parekh
Directory & Naming Services CS-328 Dick Steflik. A Directory.
CS603 Directory Services January 30, Name Resolution: What would you like? Historical? –Mail –Telephone DNS? X.500 / LDAP? DCE? ActiveDirectory?
Computer Science Lecture 9, page 1 CS677: Distributed OS Today: Naming Names are used to share resources, uniquely identify entities and refer to locations.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 1: Introduction to Windows Server 2003.
Distributed Systems CS Naming – Part II Lecture 6, Sep 26, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
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.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 1: Introduction to Windows Server 2003.
Chapter 8: Network Operating Systems and Windows Server 2003-Based Networking Network+ Guide to Networks Third Edition.
Distributed Systems: Client/Server Computing
By Karan Oberoi.  A directory service (DS) is a software application- or a set of applications - that stores and organizes information about a computer.
LDAP LIGHT WEIGHT DIRECTORY ACCESS PROTOCOL PRESENTATION BY ALAKESH APURVA DHAN AND ASH.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 1: Introduction to Windows Server 2003.
1 CSIT 320. Just as the combination of a database and a database management system collects and organizes information about an institution/company/… as.
03/07/08 © 2008 DSR and LDAP Authentication Avocent Technical Support.
JNDI Java Naming and Directory Interface See also:
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Computer Science Lecture 9, page 1 CS677: Distributed OS Today: Naming Names are used to share resources, uniquely identify entities and refer to locations.
Corso di Formazione Sodalia “Enterprise Java Beans” JNDI Java Naming and Directory Interface.
23/4/2001LDAP Overview - HEPix - LAL 2001 LDAP Overview HEPix – LAL Apr Michel Jouvin
A Java Based Prototype Grid User Interface Janice Drohan Project Supervisor: Prof. Peter Clarke.
Introduction To OpenLDAP Directory Services. What is a Directory Service? A specialized database optimized for reading, browsing, and searching. No complicated.
LIGHT WEIGHT DIRECTORY ACCESS PROTOCOL Presented by Chaithra H.T.
The Directory A distributed database Distributed maintenance.
Network Management System The Concept –From a central computer, network administrator can manage entire network Collect data Give commands –Moving gradually.
USM Regional PeopleSoft Conference
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.
SERVER I SLIDE: 6. SERVER I Topics: Objective 4.3: Deploy and configure the DNS service Objective 5.1: Install domain controllers.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 1: Introduction to Windows Server 2003.
Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to.
Implementing LDAP Client/Server System for Directory Service By Maochun Sun Project Advisor: Dr. Chung-E Wang Department of Computer Science California.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 Recitation 8. 2 Outline Goals of this recitation: 1.Learn about loading files 2.Learn about command line arguments 3.Review of Exceptions.
LDAP Authentication Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
LDAP (Lightweight Directory Access Protocol ) Speaker: Chang-Yu Wu Adviser: Quincy Wu Date:2007/08/22.
Saving State on the WWW. The Issue  Connections on the WWW are stateless  Every time a link is followed is like the first time to the server — it has.
Linux Operations and Administration
Introduction to Active Directory
Active Directory. Computers in organizations Computers are linked together for communication and sharing of resources There is always a need to administer.
CEG 2400 Fall 2012 Directory Services Active Directory Tree Domain.
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.
Directory Services CS5493/7493. Directory Services Directory services represent a technological breakthrough by integrating into a single management tool:
Java Object-Relational Layer Sharon Diskin GUS 3.0 Workshop June 18-21, 2002.
1 CEG 2400 Fall 2012 Directory Services Directory Services eDirLDAP Active Directory.
Active Directory Domain Services (AD DS). Identity and Access (IDA) – An IDA infrastructure should: Store information about users, groups, computers and.
Planning an Active Directory Deployment Lesson 1.
1 Directory Services  What is a Directory Service?  Directory Services model  Directory Services naming model  X.500 and LDAP  Implementations of.
CollegeSource Security Application &
Master of Information System Management
Introduction to LDAP Frank A. Kuse.
Overview of Active Directory Domain Services
Objectives Differentiate between the different editions of Windows Server 2003 Explain Windows Server 2003 network models and server roles Identify concepts.
CEG 2400 Fall 2012 Directory Services - LDAP
Introduction to Name and Directory Services
Bina Ramamurthy Chapter 9
Architecture Competency Group
Bina Ramamurthy Chapter 9
Bina Ramamurthy Chapter 9
ACTIVE DIRECTORY An Overview.. By Karan Oberoi.
LDAP LIGHT WEIGHT DIRECTORY ACCESS PROTOCOL
Presentation transcript:

Software Engineering Recitation 6 Suhit Gupta

Review Classpath Stream vs. Reader

Today LDAP

Lightweight Directory Access Protocol

Snapshot of UT

LDAP – support is wide

What is LDAP Lightweight Directory Access Protocol – A cross platform protocol for communicating with a directory server It has descended from the X.500 OSI Directory Access protocol – which was too cumbersome for microcomputers It is a data representation model optimized for arbitrary queries.

What is a directory? A centralized structured hierarchical repository of configuration, authentication and other network and systems related information. Eg - /etc/passwd, /etc/shadow It is a system optimized for a predominantly “lookup” application. It is not a database –No transactions –Not relations –Poor Update/Insert/Delete Operations

So why are we using it? A centralized cross-platform data repository greatly simplifies administration Replication support increases availability Distribution of information can reduce network load on critical segments Front-ends such as www to LDAP in conjunction with well designed access controls can place some administration tasks in the hands of the users themselves.

Why LDAP? Both NDS and MSFT-AD are LDAP servers LDAP is open, and will inter-operate with other directories It is simple

Some notation cn ou dc o dn

What the structure looks like… O=softe Ou=services Ou=actors Ou=states

However… It’s really a flat db There really isn’t this tree like structure But we don’t care

What is a schema? The schema describes the structure of the directory contents. Schemas are optional but you usually want them. The schema describes the datatype of each attribute. The schema specifies the attribute found in each object class.

Schema Janak has explicitly created three for you –Service –Actor –ActorState

Service Service reference ID: CN tag in DN: use your group ID Required: –ServerIP (string) –ServerPort (int) –ServerType (string): A or S Optional –WorldName –Extensions

Actor Actor “name”/login id: CN tag in DN Required: –HP: int –XP: int –Gold: int –Password: String Optional: –ImageURL

ActorState CN in DN: unique identifier –We’ll use combination of actor, world, and service –“ac=actorname+wn=worldname+sv=servicename” Required –LocationX: int –LocationY: int –Status: int –WorldInstance: int

JNDI Relatively simple Java API, built into 1.3 and higher Actually more than LDAP: DNS, etc. For LDAP, uses concept of directory context in which the operation will be done –ldap://softe.cs.columbia.edu:389/o=softe Once set, go ahead and do operation

JNDI Lookups getAttributes() method searches by (unique) DN –similar to lookup() but more powerful Returns Attributes object: collection of attribute-value pairs; you can “get” and “put”, like a Hashtable

JNDI Searches search() searches within a DN for all entries that match the Attributes set you provide –list() finds all in the DN context Returns NamingEnumeration (subinterface of Enumeration) –Each entry in the Enumeration is a SearchResult, which you can convert toString() and then do a lookup –For list(), returns a NameClassPair Example

JNDI Writes Just like we can getAttributes(), we can… (re)bind() –Ok, so the parallel isn’t ideal –Name: DN –Object: null (Java can serialize to LDAP!) –Attributes: our good friend Example

JNDI Deletes unbind(); Must supply whole DN to it –Use search() if you don’t know what the full DN of the relevant object is

JNDI Miscellany Name class –You don’t have to use this: it’s a bit more “civilized” way of dealing with DN’s, though –For the scope of this class, it’s acceptable just to use Strings for DN’s

The receive code Update to new version, Suhit

import javax.naming.*; import javax.naming.directory.*; import java.util.*; public class SearchForServices { public static void main(String[] args) { if(args.length != 1) { System.out.println("usage: java SearchForServices :port"); System.exit(-1); } // Create the environment in which we will do lookups Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://" + args[0] + "/dc=softe,dc=cs,dc=columbia,dc=edu"); // Now connect and perform the list request DirContext ctx = null; NamingEnumeration ne = null; try { ctx = new InitialDirContext(env); ne = ctx.list("ou=services"); } catch(NamingException e) { e.printStackTrace(); } // Now list all services while(ne.hasMoreElements()) { NameClassPair ncp = (NameClassPair)ne.nextElement(); System.out.println("Found " + ncp + "; attributes are:"); // Lookup this element Attributes a = null; try { a = ctx.getAttributes(ncp.getName() + ",ou=services"); } catch(NamingException e) { e.printStackTrace(); } // Print out the set of attributes System.out.println(a + " "); }}}

The send code Update to new version, Suhit

import javax.naming.*; import javax.naming.directory.*; import java.util.*; public class AddService { public static void main(String[] args) { if(args.length != 5) { System.out.println("usage: java AddService "); System.exit(-1); } // Create the environment in which we will do binds Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://" + args[0] + "/o=softe"); env.put(Context.SECURITY_PRINCIPAL, "cn=Manager,o=softe"); env.put(Context.SECURITY_CREDENTIALS, "cs3156"); // Now connect and perform the list request DirContext ctx = null; NamingEnumeration ne = null; try { ctx = new InitialDirContext(env); // Create the attributes Attributes a = new BasicAttributes(); a.put("objectClass", "Service"); a.put("ServerIP", args[2]); a.put("ServerPort", args[3]); a.put("ServerType", args[4]); ctx.bind("cn=" + args[1] + ",ou=services",null,a); } catch(NamingException e) { e.printStackTrace(); } System.out.println("Done!"); }}

Where does our LDAP server exist?? liberty.psl.cs.columbia.edu (but we call it softe.cs.columbia.edu) We shall give you the username/password etc. on the webpage in the next few days We will also update the requirement field names