|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.salespointframework.core.data.DataBasketEntryImpl<T>
public class DataBasketEntryImpl<T>
Basic simple implementation of the DataBasketEntry interface. DataBasketEntries may be coalesced, meaning that two separate operations may be expressed by one DataBasketEntry, if this is possible. Applications that inspect DataBasketEntries directly should not make assumptions about whether or not they have been coalesced.
Field Summary | |
---|---|
protected DataBasketEntryDestination |
m_dbedDest
The destination of the operation. |
protected DataBasketEntrySource |
m_dbesSource
The source of the operation. |
protected DataBasketImpl |
m_dbiOwner
The DataBasket owning this entry.. |
protected boolean |
m_fHandled
true if the entry was commited or rolled back completely. |
protected T |
m_oValue
The object moved by the operation. |
protected java.lang.String |
m_sMainKey
The entry's main key. |
protected java.lang.String |
m_sSecondaryKey
The entry's secondary key. |
Fields inherited from interface org.salespointframework.core.data.interfaces.DataBasketKeys |
---|
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY |
Constructor Summary | |
---|---|
DataBasketEntryImpl(java.lang.String sMainKey,
java.lang.String sSecondaryKey,
DataBasketEntrySource dbesSource,
DataBasketEntryDestination dbedDest,
T oValue)
Create a new DataBasketEntryImpl. |
Method Summary | |
---|---|
void |
commit()
Commit the operation. |
static CatalogItem |
DBEtoCatalogItem(DataBasketEntry dbe)
Extracts the catalog item out of a data basket entry |
DataBasketEntryDestination |
getDestination()
Get the entry's destination. |
LogEntry |
getLogData()
Return a LogEntry that describes this DataBasketEntry. |
java.lang.String |
getMainKey()
Get the entry's main key. |
java.lang.String |
getName()
|
DataBasket |
getOwner()
Return the DataBasket containing this DataBasketEntry. |
java.lang.String |
getSecondaryKey()
Get the entry's secondary key. |
DataBasketEntrySource |
getSource()
Get the entry's source. |
T |
getValue()
Get the entry's value, i.e. |
boolean |
isHandled()
Return true, if the entry has been either completely commited or rolled back. |
void |
rollback()
Rollback the operation. |
void |
setOwner(DataBasket dbOwner)
Set the DataBasket owning this DataBasketEntry. |
void |
setSecondaryKey(java.lang.String key)
Set the entry's secondary key. |
void |
setValue(T value)
set the entry's value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DataBasketEntrySource m_dbesSource
protected DataBasketEntryDestination m_dbedDest
protected T m_oValue
protected java.lang.String m_sMainKey
protected java.lang.String m_sSecondaryKey
protected boolean m_fHandled
protected DataBasketImpl m_dbiOwner
Constructor Detail |
---|
public DataBasketEntryImpl(java.lang.String sMainKey, java.lang.String sSecondaryKey, DataBasketEntrySource dbesSource, DataBasketEntryDestination dbedDest, T oValue)
sMainKey
- the entry's main key.sSecondaryKey
- the entry's secondary key.dbesSource
- the operation's source. Assumed to be a SelfManagingDBESource
.dbedDest
- the operation's destination. Assumed to be a SelfManagingDBEDestination
.oValue
- the object moved by the operation.Method Detail |
---|
public void rollback()
SelfManagingDBEDestination.rollbackAdd(org.salespointframework.core.data.interfaces.DataBasket, org.salespointframework.core.data.interfaces.DataBasketEntry)
in
the destination and then SelfManagingDBESource.rollbackRemove(org.salespointframework.core.data.interfaces.DataBasket, org.salespointframework.core.data.interfaces.DataBasketEntry)
in the source of the entry.
rollback
in interface DataBasketEntry<T>
public void commit()
SelfManagingDBESource.commitRemove(org.salespointframework.core.data.interfaces.DataBasket, org.salespointframework.core.data.interfaces.DataBasketEntry)
in the
source and then SelfManagingDBEDestination.commitAdd(org.salespointframework.core.data.interfaces.DataBasket, org.salespointframework.core.data.interfaces.DataBasketEntry)
in the destination of the entry.
commit
in interface DataBasketEntry<T>
public void setOwner(DataBasket dbOwner)
This method is public as an implementation detail and must not be called directly.
setOwner
in interface DataBasketEntry<T>
dbOwner
- the DataBasket that owns this DataBasketEntry. Can be null
.public DataBasket getOwner()
null
. Once
setOwner(org.salespointframework.core.data.interfaces.DataBasket)
has been called, always returns the last value of the dbOwner
parameter passed to setOwner
.
getOwner
in interface DataBasketEntry<T>
public DataBasketEntrySource getSource()
getSource
in interface DataBasketEntry<T>
public DataBasketEntryDestination getDestination()
getDestination
in interface DataBasketEntry<T>
public T getValue()
getValue
in interface DataBasketEntry<T>
public void setValue(T value)
value
- public java.lang.String getMainKey()
getMainKey
in interface DataBasketEntry<T>
public java.lang.String getSecondaryKey()
getSecondaryKey
in interface DataBasketEntry<T>
public void setSecondaryKey(java.lang.String key)
key
- new secondary keypublic boolean isHandled()
isHandled
in interface DataBasketEntry<T>
public LogEntry getLogData()
getLogData
in interface Loggable
public static CatalogItem DBEtoCatalogItem(DataBasketEntry dbe)
dbe
- container
public java.lang.String getName()
getName
in interface SpItem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |