OpMath

com.opmath.test.j2ee.book
Interface ContactBook

All Superinterfaces:
EJBObject, Remote

public interface ContactBook
extends EJBObject

The (remote) Remote interface of the ContactBook EJB. Specifies the functionality of ContactBook instances, avaliable to remote clients.

Copyright: (c) 2002 The Open Math Company Limited

The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.

Since:
J2SDK 1.3.1, J2SDKEE 1.3.1, EJB 2.0
Version:
OpMath J2EE Example v1.0
Author:
Bruno Beloff bruno.beloff@opmath.com
See Also:
ContactBean

Method Summary
 Contact createContact(ContactVO data)
          Requests that a new Contact EJB is created in this contact book.
 Collection getAllContacts()
          Finds all the Contact EJBs in this contact book.
 Contact getContact(ContactPK key)
          Finds the specified Contact EJB in this contact book.
 Collection getContactsForNames(String givenName, String familyName)
          Finds all Contact EJBs in this contact book whose 'given name' field exactly matches the parameter givenName or 'family name' field exactly matches the parameter familyName.
 void removeContact(ContactPK key)
          Requests that the specified Contact EJB in this contact book is removed.
 Contact updateContact(ContactPK key, ContactVO data)
          Requests that the state of the specified Contact EJB is set using the given value object.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

createContact

public Contact createContact(ContactVO data)
                      throws RemoteException,
                             CreateException

Requests that a new Contact EJB is created in this contact book. The new contact will have state determined by the given value object. The key for the new contact will be set automatically. The method returns the (remote interface of) the new EJB.

Parameters:
data - a ContactVO carrying the state for the new Contact EJB.
Returns:
a Contact remote interface to the new Contact EJB.
Throws:
RemoteException - if problems were encountered in communicating with the application server.
CreateException - if the request not be completed, for whatever reason.
See Also:
ContactBookBean.createContact(ContactVO)

updateContact

public Contact updateContact(ContactPK key,
                             ContactVO data)
                      throws RemoteException,
                             FinderException

Requests that the state of the specified Contact EJB is set using the given value object.

Parameters:
key - a ContactPK specifying the Contact EJB.
data - a ContactVO carrying the new state for the specified Contact EJB.
Throws:
RemoteException - if problems were encountered in communicating with the application server.
FinderException - if the request not be completed, for whatever reason (for example, because no Contact EJB exists for the given key within this contact book).
See Also:
ContactBookBean.updateContact(ContactPK, ContactVO)

removeContact

public void removeContact(ContactPK key)
                   throws RemoteException,
                          RemoveException

Requests that the specified Contact EJB in this contact book is removed.

Parameters:
key - a ContactPK specifying the Contact EJB.
Throws:
RemoteException - if problems were encountered in communicating with the application server.
RemoveException - if the request not be completed, for whatever reason (for example, because no Contact EJB exists for the given key within this contact book).
See Also:
ContactBookBean.removeContact(ContactPK)

getContact

public Contact getContact(ContactPK key)
                   throws RemoteException,
                          FinderException

Finds the specified Contact EJB in this contact book. The method returns the remote interface for the found Contact EJB.

Parameters:
key - a ContactPK specifying the Contact EJB.
Throws:
RemoteException - if problems were encountered in communicating with the application server.
FinderException - if the request not be completed, for whatever reason (for example, because no Contact EJB exists for the given key within this contact book).
See Also:
ContactBookBean.getContact(ContactPK)

getContactsForNames

public Collection getContactsForNames(String givenName,
                                      String familyName)
                               throws RemoteException,
                                      FinderException

Finds all Contact EJBs in this contact book whose 'given name' field exactly matches the parameter givenName or 'family name' field exactly matches the parameter familyName. Parameters may be empty Strings, but may not be null. Regular expressions are not recognised. Matching is case-sensitive.

Parameters:
givenName - a String specifying the 'given name' field.
familyName - a String specifying the 'family name' field.
Throws:
RemoteException - if problems were encountered in communicating with the application server.
FinderException - if the request not be completed, for whatever reason (for example, because no matching Contact EJBs exist within this contact book).
See Also:
ContactBookBean.getContactsForNames(String, String)

getAllContacts

public Collection getAllContacts()
                          throws RemoteException,
                                 FinderException

Finds all the Contact EJBs in this contact book.

Throws:
RemoteException - if problems were encountered in communicating with the application server.
FinderException - if the request not be completed, for whatever reason (for example, because no Contact EJBs exist within this contact book).
See Also:
ContactBookBean.getAllContacts()

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK