com.jwpepper.cat
Class EntryImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.imaginary.lwp.BaseEntity
                          |
                          +--com.jwpepper.cat.EntryImpl
Direct Known Subclasses:
CompositeEntryImpl, SimpleEntryImpl

public abstract class EntryImpl
extends BaseEntity
implements Entry

Implements the business logic associated with the entry business component.
Last modified $Date: 1999/10/05 17:13:06 $

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
EntryImpl()
          Empty constructor required for LWP entity objects.
 
Method Summary
 void create(Identifier id, java.util.Locale loc, java.lang.String ttl, java.lang.String desc)
          Initializes a new entry with the specified information.
 void create(Identifier id, java.util.Locale loc, java.lang.String ttl, java.lang.String desc, CompositeEntryReference prnt)
          Initializes a new entry with the specified information.
 CatalogReference getCatalog()
          Provides the catalog in which this entry is placed.
 java.lang.String getDescription(java.util.Locale loc)
          Provides a description for the entry translated for the specified locale.
 CompositeEntryReference getParent()
          Provides the parent to this entry.
 java.lang.String getTitle(java.util.Locale loc)
          Provides the entry title translated for the specified locale.
protected  void load(Memento mem)
          Loads the entry from the data store using the state information contained in the specified memento.
protected  void store(Memento mem)
          Saves the current state of the entry into the specified memento for storage in a persistent data store.
 
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

EntryImpl

public EntryImpl()
          throws PersistenceException,
                 java.rmi.RemoteException
Empty constructor required for LWP entity objects.
Throws:
PersistenceException - a persistence handler could not be assigned
java.rmi.RemoteException - this object could not be exported
Method Detail

create

public void create(Identifier id,
                   java.util.Locale loc,
                   java.lang.String ttl,
                   java.lang.String desc)
            throws CreateException,
                   java.rmi.RemoteException
Initializes a new entry with the specified information. This method begins a transaction before initializing the values and commits the transaction upon completion.
Specified by:
create in interface Entry
Parameters:
id - the client identifier for the transaction
loc - the locale for the information
ttl - the title for the entry
desc - the entry description
Throws:
CreateException - an error occurred creating the new entry
java.rmi.RemoteException - a network error occurred

create

public void create(Identifier id,
                   java.util.Locale loc,
                   java.lang.String ttl,
                   java.lang.String desc,
                   CompositeEntryReference prnt)
            throws CreateException,
                   java.rmi.RemoteException
Initializes a new entry with the specified information. This method begins a transaction before initializing the values and commits the transaction upon completion. In the middle of this transaction, it will call addEntry() in the parent so that an association is created with the parent.
Specified by:
create in interface Entry
Parameters:
id - the client identifier for the transaction
loc - the locale for the information
ttl - the title for the entry
desc - the entry description
prnt - the parent of the entry
Throws:
CreateException - an error occurred creating the new entry
java.rmi.RemoteException - a network error occurred

getCatalog

public CatalogReference getCatalog()
                            throws java.rmi.RemoteException
Provides the catalog in which this entry is placed. If this entry is itself the catalog, then this method returns this object.
Specified by:
getCatalog in interface Entry
Returns:
the catalog to which this entry belongs
Throws:
java.rmi.RemoteException - a network error occurred

getDescription

public java.lang.String getDescription(java.util.Locale loc)
Provides a description for the entry translated for the specified locale. If no translation is available for the specified locale, then a translation for the default locale is provided.
Specified by:
getDescription in interface Entry
Parameters:
loc - the locale for which a translation is desired
Returns:
a description of the entry

getParent

public CompositeEntryReference getParent()
Provides the parent to this entry.
Specified by:
getParent in interface Entry
Returns:
the entry's parent

getTitle

public java.lang.String getTitle(java.util.Locale loc)
Provides the entry title translated for the specified locale. If no translation is available for the desired locale, then one is provided from the default locale.
Specified by:
getTitle in interface Entry
Parameters:
loc - locale for which a translation is desired
Returns:
the entry title

load

protected void load(Memento mem)
             throws LoadException
Loads the entry from the data store using the state information contained in the specified memento.
Parameters:
mem - the memento containing the state information from the data store
Throws:
LoadException - an error occurred assigning values from the memento
Overrides:
load in class BaseEntity

store

protected void store(Memento mem)
              throws StoreException
Saves the current state of the entry into the specified memento for storage in a persistent data store.
Parameters:
mem - the memento into which to save the current entry state
Throws:
StoreException - an error occurred saving the state into the memento
Overrides:
store in class BaseEntity