SalesPoint Framework v3.1

data
Interface NameContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
CatalogImpl, StockImpl

public interface NameContext
extends Serializable

A name context.

Name contexts are a policy to shield rename functions. You can think of a name context as a name space that comes with certain rules that decide validity of names. One rule could be, for example, that names must be unique in a name context.

Since:
v2.0
Author:
Steffen Zschaler

Method Summary
 void checkNameChange(DataBasket db, String sOldName, String sNewName)
          Check a name change for compliance with the rules of this NameContext.
 Object getNCMonitor()
          Return an object that can be used as a monitor to synchronize name changes.
 void nameHasChanged(DataBasket db, String sOldName, String sNewName)
          Indicate a successful name change.
 

Method Detail

checkNameChange

public void checkNameChange(DataBasket db,
                            String sOldName,
                            String sNewName)
                     throws NameContextException
Check a name change for compliance with the rules of this NameContext.

If the proposed name change is not valid, a NameContextException is thrown. Otherwise, checkNameChange simply returns.

Parameters:
db - the DataBasket relative to which the name change is to take place.
sOldName - the name to be changed.
sNewName - the new name.
Throws:
NameContextException - if the name change would not be valid.
Override:
Always

nameHasChanged

public void nameHasChanged(DataBasket db,
                           String sOldName,
                           String sNewName)
Indicate a successful name change.

Calls to this method indicate to the NameContext that a name change has been successful. The NameContext may adjust internal tables or structures here.

Parameters:
db - the DataBasket relative to which the name change has taken place.
sOldName - the old name of the object whose name was changed.
sNewName - the new name of the object.
Override:
Always

getNCMonitor

public Object getNCMonitor()
Return an object that can be used as a monitor to synchronize name changes. All changes that can influence the return value of checkNameChange(data.DataBasket, java.lang.String, java.lang.String) or the execution of nameHasChanged(data.DataBasket, java.lang.String, java.lang.String) must be synchronized on this monitor.

Override:
Always

SalesPoint Framework v3.1