Library inventory using a client-server model

Library inventory using a client-server model-Data Structure & Algorithms
The LIMS to support multiple clients to query and update the library inventory using a client/server model. LIMS should allow multiple clients to safely access the inventory, and using a producer-consumer model to borrow/return library items.

Elaboration:

1. Multiple instances of a client class should be supported.

2. Use threads and locks to provide safe access to the library inventory.

3. Add a field to each record in the database representing the maximum number of that item the library will hold.

4. Functions should include:

o Returning an item to the library, blocking if the maximum number of that item is reached until an item is borrowed.

o Borrowing an item, blocking if the desired item is not in the library until an item is returned.

o Allow a client to cancel a request that has been blocked.

Referancing style: APA style

The scenario is inspired by a LIbrary Management System (LIMS). For the first version of the project, the LIMS is a very basic one, allowing just for the import of data from a text file and perfom some basic search operations.

The elements of the LIMS are: the Library itself (let’s consider just one instance for now) that contains a collection of Authors. Each Author includes a collection of Books he/she published.

Eventually (in the next versions of the project), there will be clients that will concurrently access the LIMS in order to borrow/return book copies.

The Author and Book classes will have some attributes, mainly used for searching and sorting.

Required data structure – the data structure I want you to implement is a multi-tree with the following levels:
Library – Level 0
Author – Level 1
Book – Level 2
Use at least the following classes, you are free to define others in the spirit of this application.
Specifications for a few classes – you are free to add to this list.
o Library

– ArrayList <Author> as an instance variable data structure

o Author – index, a name, an address and list of a number of Books (accessed by links to instances of the Book class).

– ArrayList <Book> as an instance variable data structure

o Book – index, a title, a genre, author by index

Use the ArrayList class to hold instances of the classes defined in item 1. Be sure to use generics appropriately.

Use a text data file with the following format – which you may extend, and may be extended in the later projects. As a minimum, each item should be specified by a single line in the data file. The initial fields should be used during the instantiation of objects and your program should ignore later fields that are not used. For simplicity, let us assume that the fields are separated by colons. The specifications look something like the following, where the angle brackets are not part of the actual data file. I think we can assume that name, address, title and genre are strings.

o b:<index>:<title>:<genre>:<price>:<author_index>

o a:<index>:<name>:<address>

Order from us and get better grades. We are the service you have been looking for.