com.jwpepper.inv
Class AudioImpl

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

public class AudioImpl
extends BaseEntity
implements Audio

This interface defines the Audio Object.
Last Modified $Date: 1999/10/05 22:03:44 $

Version:
$Revision: 1.3 $
Author:
Robert Schmid (robert@ancept.com)
See Also:
Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
AudioImpl()
          Constructor method.
 
Method Summary
 void addProduct(Identifier id, Product prd)
          This method adds a Product to a collection of Products that the Audio belongs to.
 void create(Identifier id, java.util.Locale loc, java.io.BufferedInputStream aBuf, long len, java.lang.String mime)
          This method creates a new Audio Object and sets its attributes.
 void create(Identifier id, java.util.Locale loc, java.io.File aFil, java.lang.String mime)
          This method creates a new Audio Object and sets its attributes.
 java.io.BufferedInputStream getAudio()
          This method returns the Audio String.
 java.util.Locale getLocale()
          This method returns the Locale Object.
 java.lang.String getMimeType()
          This method returns the MimeType of the Audio Stream.
 long getSize()
          This method returns the size of the Audio Stream.
protected  void load(Memento mem)
          This method loads the Audio's attributes from a Memento Object
 com.sun.java.util.collections.Iterator products()
          This method returns an iterator over the products collection.
 void removeProduct(Identifier id, Product prd)
          This method removes a Product from a collection of Products that the Audio belongs to.
protected  void store(Memento mem)
          This method stores the Audio's attributes into a Memento Object
 
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

AudioImpl

public AudioImpl()
          throws java.rmi.RemoteException,
                 PersistenceException
Constructor method.
Throws:
PersistenceException - If an error occurs in the Lightweight Persistence Engine
java.rmi.RemoteException - If an error occurs in the Remote Method Interface
Method Detail

addProduct

public void addProduct(Identifier id,
                       Product prd)
                throws PersistenceException,
                       java.rmi.RemoteException
This method adds a Product to a collection of Products that the Audio belongs to.
Specified by:
addProduct in interface Audio
Parameters:
id - An identifer object for the Audio
prd - A Product object to add to the collection
Throws:
PersistenceException - If an error occurs in the Lightweight Persistence Engine
java.rmi.RemoteException - If an error occurs in the Remote Method Interface

create

public void create(Identifier id,
                   java.util.Locale loc,
                   java.io.File aFil,
                   java.lang.String mime)
            throws CreateException,
                   java.io.FileNotFoundException,
                   java.rmi.RemoteException,
                   PersistenceException
This method creates a new Audio Object and sets its attributes.
Specified by:
create in interface Audio
Parameters:
id - An identifer object for the Audio
loc - Country/Language Information
aFil - A Sound File
mime - The mimetype of the Audio
Throws:
java.io.FileNotFoundException - If the requested file can not be found
PersistenceException - If an error occurs in the Lightweight Persistence Engine
java.rmi.RemoteException - If an error occurs in the Remote Method Interface
CreateException - If an error occurs in the create method

create

public void create(Identifier id,
                   java.util.Locale loc,
                   java.io.BufferedInputStream aBuf,
                   long len,
                   java.lang.String mime)
            throws CreateException,
                   java.rmi.RemoteException,
                   PersistenceException
This method creates a new Audio Object and sets its attributes.
Specified by:
create in interface Audio
Parameters:
id - An identifer object for the Audio
loc - Country/Language Information
aBuf - A Buffered Input Stream of music
len - Size of the audio stream in bytes
mime - The mimetype of the Audio
Throws:
PersistenceException - If an error occurs in the Lightweight Persistence Engine
java.rmi.RemoteException - If an error occurs in the Remote Method Interface
CreateException - If an error occurs in the create method

getAudio

public java.io.BufferedInputStream getAudio()
                                     throws java.rmi.RemoteException
This method returns the Audio String.
Specified by:
getAudio in interface Audio
Returns:
A Stream containing the text of the Audio
Throws:
java.rmi.RemoteException - If an error occurs in the Remote Method Interface

getLocale

public java.util.Locale getLocale()
                           throws java.rmi.RemoteException
This method returns the Locale Object.
Specified by:
getLocale in interface Audio
Returns:
A Locale Object
Throws:
java.rmi.RemoteException - If an error occurs in the Remote Method Interface

getMimeType

public java.lang.String getMimeType()
                             throws java.rmi.RemoteException
This method returns the MimeType of the Audio Stream.
Specified by:
getMimeType in interface Audio
Returns:
String A String containing the MimeType of the Audio
Throws:
java.rmi.RemoteException - If an error occurs in the Remote Method Interface

getSize

public long getSize()
             throws java.rmi.RemoteException
This method returns the size of the Audio Stream.
Specified by:
getSize in interface Audio
Returns:
long The length of the audio stream in bytes
Throws:
java.rmi.RemoteException - If an error occurs in the Remote Method Interface

load

protected void load(Memento mem)
             throws LoadException
This method loads the Audio's attributes from a Memento Object
Parameters:
mem - A Memento Object
Throws:
LoadException - If an error occurs while loading the Memento Object
Overrides:
load in class BaseEntity

products

public com.sun.java.util.collections.Iterator products()
                                                throws java.rmi.RemoteException
This method returns an iterator over the products collection.
Specified by:
products in interface Audio
Returns:
An iterator of the collection of products
Throws:
java.rmi.RemoteException - If an error occurs in the Remote Method Interface

removeProduct

public void removeProduct(Identifier id,
                          Product prd)
                   throws PersistenceException,
                          java.rmi.RemoteException
This method removes a Product from a collection of Products that the Audio belongs to.
Specified by:
removeProduct in interface Audio
Parameters:
id - An identifer object for the Audio
prd - A Product object to add to the collection
Throws:
PersistenceException - If an error occurs in the Lightweight Persistence Engine
java.rmi.RemoteException - If an error occurs in the Remote Method Interface

store

protected void store(Memento mem)
              throws StoreException
This method stores the Audio's attributes into a Memento Object
Parameters:
mem - A Memento Object
Throws:
StoreException - If an error occurs while storing the Memento Object
Overrides:
store in class BaseEntity