|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Remote interface to the Operations stateless session bean. A repository for simple operations such as adding a new book or borrowing an existing book.
Method Summary | |
java.lang.Integer |
addBook(java.util.Map attributes)
Adds a book which will be owned and held by the specified owner. |
java.lang.Integer |
addBook(java.util.Map attributes,
java.lang.String publisherName)
Adds a book, which will be owned and help by the specified owner. |
Book |
borrowBook(java.lang.Integer bookPrimaryKey,
java.lang.Integer borrowerPrimaryKey)
Locates the book and the borrower, then sets the holder of the book to the borrower and increments the lend count on the book. |
Book |
deleteBook(java.lang.Integer bookPrimaryKey)
Deletes a Book. |
Book |
getBook(java.lang.Integer primaryKey)
Retrieves a single Book by its primary key. |
java.util.Map |
getBookAttributes(java.lang.Integer primaryKey)
Retrieves the attributes of a IBook as a Map . |
Person |
getPerson(java.lang.Integer primaryKey)
Retrieves a single Person by its primary key. |
java.util.Map |
getPersonAttributes(java.lang.Integer primaryKey)
Retrieves the attributes of a IPerson as a Map . |
Person[] |
getPersons()
Retrieves the light-weight version of all the IPerson beans, sorted
by last name, then by first name. |
Publisher[] |
getPublishers()
Retrieves the light-weight version of all IPublisher beans, sorted by name. |
Person |
login(java.lang.String email,
java.lang.String password)
Attempts to login the user in. |
Person |
registerNewUser(java.lang.String firstName,
java.lang.String lastName,
java.lang.String email,
java.lang.String password)
Attempts to register a new user, first checking that the e-mail and names are unique. |
Book |
returnBook(java.lang.Integer bookPrimaryKey)
Returns a book to its owner. |
void |
transferBooks(java.lang.Integer newOwnerPrimaryKey,
java.lang.Integer[] books)
Transfers a number of books to a new owner. |
void |
updateBook(java.lang.Integer bookPK,
java.util.Map attributes)
Updates a book to an existing publisher. |
void |
updateBook(java.lang.Integer bookPK,
java.util.Map attributes,
java.lang.String publisherName)
Updates a book for a unknown publisher. |
void |
updatePerson(java.lang.Integer personPK,
java.util.Map attributes)
Updates a Person. |
void |
updatePersons(Person[] updated,
java.lang.Integer[] resetPassword,
java.lang.Integer[] deleted,
java.lang.Integer adminPK)
Updates a list of Persons. |
void |
updatePublishers(Publisher[] updated,
java.lang.Integer[] deleted)
Updates the list of Publishers in the database. |
Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
Method Detail |
public Book borrowBook(java.lang.Integer bookPrimaryKey, java.lang.Integer borrowerPrimaryKey) throws BorrowException, FinderException, java.rmi.RemoteException
public java.lang.Integer addBook(java.util.Map attributes) throws CreateException, java.rmi.RemoteException
Returns the primary key of the newly created book.
public java.lang.Integer addBook(java.util.Map attributes, java.lang.String publisherName) throws CreateException, java.rmi.RemoteException
The publisherName may either be the name of a known publisher, or
a new name. A new IPublisher
will be created as necessary.
Returns the primary key of the newly created book.
public void updateBook(java.lang.Integer bookPK, java.util.Map attributes) throws FinderException, java.rmi.RemoteException
public void updateBook(java.lang.Integer bookPK, java.util.Map attributes, java.lang.String publisherName) throws CreateException, FinderException, java.rmi.RemoteException
public void updatePerson(java.lang.Integer personPK, java.util.Map attributes) throws FinderException, java.rmi.RemoteException
public Publisher[] getPublishers() throws java.rmi.RemoteException
IPublisher
beans, sorted by name.public Person[] getPersons() throws java.rmi.RemoteException
IPerson
beans, sorted
by last name, then by first name.public Person getPerson(java.lang.Integer primaryKey) throws FinderException, java.rmi.RemoteException
Person
by its primary key.FinderException
- if the Person does not exist.public Person login(java.lang.String email, java.lang.String password) throws LoginException, java.rmi.RemoteException
LoginException
- if the email address is invalid, the password
is invalid, or the user may not log in for other reasons.public java.util.Map getPersonAttributes(java.lang.Integer primaryKey) throws FinderException, java.rmi.RemoteException
IPerson
as a Map
.public Book getBook(java.lang.Integer primaryKey) throws FinderException, java.rmi.RemoteException
Book
by its primary key. Returns the
book's attributes as a Map
.FinderException
- if the Book does not exist.public java.util.Map getBookAttributes(java.lang.Integer primaryKey) throws FinderException, java.rmi.RemoteException
IBook
as a Map
.public Person registerNewUser(java.lang.String firstName, java.lang.String lastName, java.lang.String email, java.lang.String password) throws RegistrationException, CreateException, java.rmi.RemoteException
IPerson
.public Book returnBook(java.lang.Integer bookPrimaryKey) throws java.rmi.RemoteException, FinderException
FinderException
- if the book is not known.public Book deleteBook(java.lang.Integer bookPrimaryKey) throws RemoveException, java.rmi.RemoteException
public void transferBooks(java.lang.Integer newOwnerPrimaryKey, java.lang.Integer[] books) throws FinderException, java.rmi.RemoteException
public void updatePublishers(Publisher[] updated, java.lang.Integer[] deleted) throws FinderException, RemoveException, java.rmi.RemoteException
updated
- an array of Publisher
used to update
existing publishers (used to change their names). May be null or
empty.deleted
- an array of Integer
, the primary key
of any publisher to be deleted. No check is made that
existing books aren't tied to this Publisher. May be null or
empty.public void updatePersons(Person[] updated, java.lang.Integer[] resetPassword, java.lang.Integer[] deleted, java.lang.Integer adminPK) throws FinderException, RemoveException, java.rmi.RemoteException
Explicitly, names and email addresses may not be changed.
In addition, users may be deleted entirely, or may have their password reset.
updated
- a list of persons to update. May be null or empty.resetPassword
- a list of primary keys; corresponding Persons will
have thier password reset. May be null or empty.deleted
- a list of persons to delete. Books owned by any of these persons
are transfered to the administrator. May be null or empty.adminPk
- the administrator performing the operation; books may be transferred
to this person.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |