com.jwpepper.inv
Class ManufacturerImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.imaginary.lwp.BaseEntity
                          |
                          +--com.jwpepper.inv.ManufacturerImpl

public class ManufacturerImpl
extends BaseEntity
implements Manufacturer

Implements the business logic associated with a J.W. Pepper manufacturer, currently publishers of titles. Manufacturers are responsible for a host of products and that relationship is captured in this class.
Last modified $Date: 1999/10/04 15:31:30 $

Version:
$Revision
Author:
Neophytos Iacovou (iacovou@ancept.com), George Reese (george@ancept.com)
See Also:
Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
ManufacturerImpl()
          Empty constructor for instantiating a ManufacturerImpl instance.
 
Method Summary
 void addProduct(Identifier id, Product prd)
          Adds the specified product to the list of products manufactured by this manufacturer.
 void create(Identifier id, java.lang.String cde, java.lang.String nom)
          Initializes this ManufacturerImpl object with the specified values as part of a transaction to create a new manufacturer record in the data store.
 java.lang.String getCode()
          Provides the three letter manufacturer code that represents this manufacturer.
 java.lang.String getName(java.util.Locale loc)
          Provides the name of this manufacturer translated for the specified locale, if a translation exists.
protected  void load(Memento mem)
          Loads the state of this ManufacturerImpl instance from the specified memento.
 com.sun.java.util.collections.Iterator products()
          Provides a list of all products produced by this manufacturer as an iterator.
 void removeProduct(Identifier id, Product prd)
          Removes the specified product from the list of products produced by this manufacturer.
protected  void store(Memento mem)
          Stores the current state of this object into the specified memento.
 
Methods inherited from class com.imaginary.lwp.BaseEntity
create, getLastUpdateID, getLastUpdateTime, getObjectID, getReference, load, reload, remove, save, store
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManufacturerImpl

public ManufacturerImpl()
                 throws PersistenceException,
                        java.rmi.RemoteException
Empty constructor for instantiating a ManufacturerImpl instance. The empty constructor is the only constructor allowed for Impl objects under LWP.
Throws:
PersistenceException - LWP was unable to assign a persistence handler
java.rmi.RemoteException - RMI was unable to export this object
Method Detail

addProduct

public void addProduct(Identifier id,
                       Product prd)
                throws PersistenceException,
                       java.rmi.RemoteException
Adds the specified product to the list of products manufactured by this manufacturer. This method assumes it is being called within a transactional context.
Specified by:
addProduct in interface Manufacturer
Parameters:
id - the client identifier
prd - the product to add
Throws:
PersistenceException - some problem occurred marking this object as part of the transaction

create

public void create(Identifier id,
                   java.lang.String cde,
                   java.lang.String nom)
            throws CreateException
Initializes this ManufacturerImpl object with the specified values as part of a transaction to create a new manufacturer record in the data store. This method will complete any transaction currently in progress.
Specified by:
create in interface Manufacturer
Parameters:
id - the client identifier that enables authentication for this operation
cde - the manufacturer code for the new manufacturer
nom - the name of the manufacturer in the language of the server's locale
Throws:
CreateException - an error occurred creating the manufacturer in the data store

getCode

public java.lang.String getCode()
Provides the three letter manufacturer code that represents this manufacturer.
Specified by:
getCode in interface Manufacturer
Returns:
the manufacturer code

getName

public java.lang.String getName(java.util.Locale loc)
Provides the name of this manufacturer translated for the specified locale, if a translation exists. Otherwise, it will return the name in the default locale.
Specified by:
getName in interface Manufacturer
Returns:
the manufacturer's name

load

protected void load(Memento mem)
             throws LoadException
Loads the state of this ManufacturerImpl instance from the specified memento.
Parameters:
mem - the memento from which the object's state is restored
Throws:
LoadException - a value could not be loaded
Overrides:
load in class BaseEntity

products

public com.sun.java.util.collections.Iterator products()
Provides a list of all products produced by this manufacturer as an iterator.
Specified by:
products in interface Manufacturer
Returns:
the products produced by this manufacturer

removeProduct

public void removeProduct(Identifier id,
                          Product prd)
                   throws PersistenceException,
                          java.rmi.RemoteException
Removes the specified product from the list of products produced by this manufacturer. This method assumes it is being called in the context of some greater transaction.
Specified by:
removeProduct in interface Manufacturer
Parameters:
id - the identifier of the client issuing the transaction
prd - the product to be removed
Throws:
PersistenceException - an error occurred associating this object with the transaction in progress
java.rmi.RemoteException - an error occurred constructing a reference object

store

protected void store(Memento mem)
              throws StoreException
Stores the current state of this object into the specified memento.
Parameters:
mem - the memento into which the state is to be stored
Throws:
StoreException - a value could not be stored
Overrides:
store in class BaseEntity