com.jwpepper.inv
Class ProductReference

java.lang.Object
  |
  +--com.imaginary.lwp.BaseReference
        |
        +--com.jwpepper.inv.ProductReference
Direct Known Subclasses:
PepperProductReference

public class ProductReference
extends BaseReference

Client delegator for the product business component. This class serves as a client's primary interface into the product business component and performs such tedious tasks as data caching and distributed redundancy.
Last modified $Date: 1999/10/07 01:45:27 $

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

Constructor Summary
ProductReference()
          Empty constructor required by serialization.
ProductReference(long oid)
          Constructs a reference that will point to the product with the specified objectID.
ProductReference(Product ent)
          Constructs a reference that will point to the specified product.
 
Method Summary
 void addAnnotation(Identifier id, java.lang.String aud, AnnotationReference ann)
          Adds the specified annotation to this product by delegating to its associated entity's addAnnotation method.
 void addChild(Identifier id, Product prd)
          Adds the specified product as a child to this product by delegating to the associated entity's addChild() method.
 com.sun.java.util.collections.Iterator annotations()
          Provides the list of annotations associated with this product from the method of the same name in this reference's entity.
 void assign(long oid, com.sun.java.util.collections.HashMap vals)
          Assigns a reference that will point to the product whose values are represented in the specified map.
 com.sun.java.util.collections.Iterator children()
          Provides the list of children associated with this product from the method of the same name in this reference's entity.
 AnnotationReference getAnnotation(java.lang.String aud, java.util.Locale loc)
          Provides the specified annotation from the method of the same name in this reference's associated entity.
 ManufacturerReference getManufacturer()
          Provides this product's manufacturer by delegating to the entity associated with this reference.
 java.lang.String getManufacturerCode()
          Provides the manufacturer code for this product.
 java.lang.String getName(java.util.Locale loc)
          Provides the name of the product for the specified locale.
 ProductReference getParent()
          Provides the parent product of this product.
 double getPrice()
          Provides the base price for this product.
 boolean isInStock()
          Signals whether or not the product is in stock.
 void removeAnnotation(Identifier id, AnnotationReference ann)
          Removes the specified annotation from this product by delegating to the removeAnnotation() method in this reference's associated entity.
 void removeChild(Identifier id, Product c)
          Removes the specified product from this product's children by delegating to the removeChild() method in this reference's associated entity.
 void removeParent(Identifier id, Product prnt)
          Removes the specified parent from this product by delegating to the removeParent() method in this reference's associated entity.
 
Methods inherited from class com.imaginary.lwp.BaseReference
assign, assign, get, getEntity, getLastUpdateID, getLastUpdateTime, getObjectID, put, reconnect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductReference

public ProductReference()
Empty constructor required by serialization.

ProductReference

public ProductReference(long oid)
Constructs a reference that will point to the product with the specified objectID.
Parameters:
oid - the objectID of the target product

ProductReference

public ProductReference(Product ent)
                 throws java.rmi.RemoteException
Constructs a reference that will point to the specified product.
Parameters:
ent - the product to be pointed at
Throws:
java.rmi.RemoteException - a network error occurred
Method Detail

assign

public void assign(long oid,
                   com.sun.java.util.collections.HashMap vals)
Assigns a reference that will point to the product whose values are represented in the specified map.
Parameters:
id - the objectID of the product
vals - the mapping of product values
Overrides:
assign in class BaseReference

addAnnotation

public void addAnnotation(Identifier id,
                          java.lang.String aud,
                          AnnotationReference ann)
                   throws PersistenceException,
                          java.rmi.RemoteException
Adds the specified annotation to this product by delegating to its associated entity's addAnnotation method.
Parameters:
id - the client idenfitier for the transaction
aud - the audience type of the annotation
ann - the annotation to be added
Throws:
PersistenceException - an error occurred in the transaction
java.rmi.RemoteException - a network error occurred

addChild

public void addChild(Identifier id,
                     Product prd)
              throws IllegalProductRelationException,
                     PersistenceException,
                     java.rmi.RemoteException
Adds the specified product as a child to this product by delegating to the associated entity's addChild() method.
Parameters:
id - the client identifier for the transaction
prd - the product to be added
Throws:
IllegalProductRelationException - an attempt was made to add a child to a product with a parent
PersistenceException - an error occurred in the transaction
java.rmi.RemoteException - a network error occurred

annotations

public com.sun.java.util.collections.Iterator annotations()
                                                   throws java.rmi.RemoteException
Provides the list of annotations associated with this product from the method of the same name in this reference's entity.
Returns:
a list of annotations
Throws:
java.rmi.RemoteException - a network error occurred

children

public com.sun.java.util.collections.Iterator children()
                                                throws java.rmi.RemoteException
Provides the list of children associated with this product from the method of the same name in this reference's entity.
Returns:
a list of this product's children
Throws:
java.rmi.RemoteException - a network error occurred

getAnnotation

public AnnotationReference getAnnotation(java.lang.String aud,
                                         java.util.Locale loc)
                                  throws java.rmi.RemoteException
Provides the specified annotation from the method of the same name in this reference's associated entity.
Parameters:
aud - the audience type of the desired annotation
loc - the locale of the desired annotation
Throws:
java.rmi.RemoteException - a network error occurred

getManufacturer

public ManufacturerReference getManufacturer()
                                      throws java.rmi.RemoteException
Provides this product's manufacturer by delegating to the entity associated with this reference.
Returns:
the product manufacturer
Throws:
java.rmi.RemoteException - a network error occurred

getManufacturerCode

public java.lang.String getManufacturerCode()
                                     throws java.rmi.RemoteException
Provides the manufacturer code for this product.
Returns:
the manufacturer code
Throws:
java.rmi.RemoteException - a network error occurred

getName

public java.lang.String getName(java.util.Locale loc)
                         throws java.rmi.RemoteException
Provides the name of the product for the specified locale.
Parameters:
loc - the locale for which the name should be translated
Returns:
the name of the product
Throws:
java.rmi.RemoteException - a network error occurred

getParent

public ProductReference getParent()
                           throws java.rmi.RemoteException
Provides the parent product of this product.
Returns:
the parent product
Throws:
java.rmi.RemoteException - a network error occurred

getPrice

public double getPrice()
                throws java.rmi.RemoteException
Provides the base price for this product.
Returns:
the product price throws java.rmi.RemoteException a network error occurred

isInStock

public boolean isInStock()
                  throws java.rmi.RemoteException
Signals whether or not the product is in stock.
Returns:
true if the product is in stock

removeAnnotation

public void removeAnnotation(Identifier id,
                             AnnotationReference ann)
                      throws PersistenceException,
                             java.rmi.RemoteException
Removes the specified annotation from this product by delegating to the removeAnnotation() method in this reference's associated entity.
Parameters:
id - the client identifier for this transaction
ann - the annotation to be removed
Throws:
PersistenceException - a transaction error occurred
java.rmi.RemoteException - a network error occurred

removeChild

public void removeChild(Identifier id,
                        Product c)
                 throws PersistenceException,
                        java.rmi.RemoteException
Removes the specified product from this product's children by delegating to the removeChild() method in this reference's associated entity.
Parameters:
id - the client identifier for this transaction
c - the child product to be removed
Throws:
PersistenceException - a transaction error occurred
java.rmi.RemoteException - a network error occurred

removeParent

public void removeParent(Identifier id,
                         Product prnt)
                  throws PersistenceException,
                         java.rmi.RemoteException
Removes the specified parent from this product by delegating to the removeParent() method in this reference's associated entity.
Parameters:
id - the client identifier for this transaction
prnt - the parent to be removed
Throws:
PersistenceException - a transaction error occurred
java.rmi.RemoteException - a network error occurred