CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

20
CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman

Transcript of CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Page 1: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

CD Database Server (CDDB)

Zachary Carter

Alan Savage

Diana Abbas

Kyle Dorman

Page 2: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

What Does a CDDB Server Do?

• Provides Internet-based access to CD database

• Database Provides music CD information– Artist– Track Titles– Release Date

• Because most music CDs do not have this information

Page 3: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Why Another CDDB Server?

• Gracenote denies non-certified music players, and only supports CDDB2

• Gracenote is not free

• Provide a platform independent server

• Provide an alternative when other free databases are down

Page 4: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Implementation

• CDDB level 1 protocol– A text-based protocol

• TCP/IP connection

• MySQL and Enterprise JavaBeans (EJB) manage database

• OpenEJB Container

Page 5: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Data Flow

CD Player

Protocol Server

MySQL ServerEJB

Page 6: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Music Player

• Must Support CDDBP level 1

• Client Configuration– Connect via TCP/IP to CDDB server

Page 7: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Server

• CD Player connects to multithreaded server

• Server instantiates a client thread

• Client thread sends and receives data to the CD player

• Client thread uses ServerProtocol to process CD player requests

• Client thread dies when transactions finish

Page 8: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

ServerProtocol

• Implements CDDBP level 1 protocol

• Parses and interprets client requests

• Provides appropriately formatted responses

• Requests CD database information from EJBClient

Page 9: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

What is an EJB?

• Enterprise Java Bean

• Server-side objects

• Aids in transactions between client and database

• Consists of methods that encapsulate business logic

Page 10: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

EJB Architecture

• Three tiers:– The client (makes calls to remote EJBs)– The EJB server (where the container resides)– The database (EJB business methods directly

accesses database)

Page 11: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.
Page 12: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

EJB Container

• Provides support for:– Transactions– Persistence– Management of multiple instances of a given bean– Concurrent execution of many beans– Keeping track of their state

• Does not allow the bean to be accessed directly from the client

• Protects the bean from the client

Page 13: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

EJB Analogy

EJB Bean

EJB Container

EJB Server

Operating System

Applications Programs

Operating System

BIOS

Hardware

Layering in EJBsLayering in typical operating system

Page 14: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

A High-Level View of an EJB Conversation

• Finding the bean

• Getting access to a bean

• Calling the bean’s methods

Page 15: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

EJB Conversation

• Finding a bean: Java Naming and Directory Interface (JNDI)

• Access to a bean: Home Interface

• Calling the bean’s methods: Remote Interface

• Analogous to JNDI: DNS translation from symbolic names

Page 16: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Entity Beans

• Track beans and CDAlbum beans

• Life cycle includes:– Nonexistence– Pooled (Beans exist in the container with no

identity)– Ready (Business methods can be invoked)

Page 17: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

MySQL

• An opensource database

• Data elements are organized using primary keys generated by MySQL database

• SQL statements inserts data into the database using a script

Page 18: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Advantages of EJB’s

• Transaction processing

• Persistent storage of objects

• Platform independence

• Multitiered architecture

• “Write once, run anywhere”

Page 19: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

Visions

• Implement higher level CDDB protocols• Implement a façade pattern• Index database by discid• Implement search features

– Artist, disc title, track name, genre

• Add file logging– Usage Statistics

• Create a server side GUI

Page 20: CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.

The End!Questions?