CD Database Server (CDDB)

Download Report

Transcript CD Database Server (CDDB)

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
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
Implementation
• CDDB level 1 protocol
– A text-based protocol
• TCP/IP connection
• MySQL and Enterprise JavaBeans (EJB)
manage database
• OpenEJB Container
Data Flow
CD
Player
Protocol
Server
EJB
MySQL
Server
Music Player
• Must Support CDDBP level 1
• Client Configuration
– Connect via TCP/IP to CDDB server
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
ServerProtocol
•
•
•
•
Implements CDDBP level 1 protocol
Parses and interprets client requests
Provides appropriately formatted responses
Requests CD database information from
EJBClient
What is an EJB?
• Enterprise Java Bean
• Server-side objects
• Aids in transactions between client and
database
• Consists of methods that encapsulate
business logic
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)
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
EJB Analogy
Layering in EJBs
EJB Bean
EJB Container
EJB Server
Operating System
Layering in typical
operating system
Applications Programs
Operating System
BIOS
Hardware
A High-Level View of an EJB
Conversation
• Finding the bean
• Getting access to a bean
• Calling the bean’s methods
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
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)
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
Advantages of EJB’s
•
•
•
•
•
Transaction processing
Persistent storage of objects
Platform independence
Multitiered architecture
“Write once, run anywhere”
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
The End!
Questions?