org.bsf.listOfValues
Class LovServiceBean

java.lang.Object
  extended byorg.bsf.commons.ejb.GenericAdapterBean
      extended byorg.bsf.commons.ejb.SessionAdapterBean
          extended byorg.bsf.listOfValues.LovServiceBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

public class LovServiceBean
extends org.bsf.commons.ejb.SessionAdapterBean

This stateless ejb provides access to the list of values features. It provides a way to access and update a LOV.

See Also:
LovBean, LovValue, LovBusinessInterface, Serialized Form

Field Summary
private  LOVLocalHome _lovEntityLocalHome
           
private  java.lang.String JNDI_DATABASE_NAME
           
private static java.lang.String TABLE_NAME_FROM_LOV_OID_STATEMENT
           
 
Fields inherited from class org.bsf.commons.ejb.SessionAdapterBean
_ejbContext
 
Fields inherited from class org.bsf.commons.ejb.GenericAdapterBean
 
Constructor Summary
LovServiceBean()
           
 
Method Summary
 void ejbCreate()
           
 java.util.List getListOfValues(java.lang.Long p_lovOID)
          Returns, in the order of the executed SQL, the list of LovValues corresponding to the given p_lovOID.
private  LOVLocal getLov(java.lang.Long p_lovOID)
          Utility method to provide access to the desired LOV.
 java.util.List getLOVMetaData(java.lang.Long p_lovOID)
          Provides access to the metadata for a given list of values.
 LovValue getLovValue(java.lang.Long p_lovOID, java.lang.Long p_lovValueOID)
          Returns the LovValue having the oid p_lovValueOID in the LOV whose oid is p_lovOID.
 java.util.Map getLovValues(java.lang.Long p_lovOID)
          Returns a map (LovValueOID, LovValue) of LovValues corresponding to the given p_lovOID.
 void resynchronizeListOfValues(java.lang.Long p_lovOID)
          Ensures that the LOVs using the same TABLE_NAME as the LOV identified by the given OID are reloaded (in general due to a data update).
 void resynchronizeListOfValues(java.lang.String p_tableName)
          Ensures that the LOVs referencing the TABLE_NAME are reseted.
 
Methods inherited from class org.bsf.commons.ejb.SessionAdapterBean
ejbActivate, ejbPassivate, ejbRemove, getEJBContext, getUserName, setSessionContext
 
Methods inherited from class org.bsf.commons.ejb.GenericAdapterBean
getConnection, getEJBClassName, getEJBToolBox, getHome, handleCreateSessionException, handleExceptionAsSystemException, handleFinderException, handleRemoteException, handleSQLException, logDebug, logError, logError, logFatal, logFatal, logGraphBegin, logGraphEnd, logInfo, logWarn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABLE_NAME_FROM_LOV_OID_STATEMENT

private static final java.lang.String TABLE_NAME_FROM_LOV_OID_STATEMENT
See Also:
Constant Field Values

_lovEntityLocalHome

private LOVLocalHome _lovEntityLocalHome

JNDI_DATABASE_NAME

private final java.lang.String JNDI_DATABASE_NAME
See Also:
Constant Field Values
Constructor Detail

LovServiceBean

public LovServiceBean()
Method Detail

getLOVMetaData

public java.util.List getLOVMetaData(java.lang.Long p_lovOID)
                              throws javax.ejb.FinderException
Provides access to the metadata for a given list of values.

Parameters:
p_lovOID - The OID of the list of values for which we want the metadata.
Returns:
A list of LovMetaDataItems for the LOV corresponding to the given lovOID.
Throws:
java.lang.IllegalArgumentException - if the given oid is null.
javax.ejb.FinderException - if a lov with the given oid isn't found.
See Also:
LovBean, LovValue, LovMetaDataItem

getLovValue

public LovValue getLovValue(java.lang.Long p_lovOID,
                            java.lang.Long p_lovValueOID)
                     throws NoSuchLovException,
                            NoSuchLovValueException
Returns the LovValue having the oid p_lovValueOID in the LOV whose oid is p_lovOID. If the LOV doesn't exist a NoSuchLovException is thrown whereas a NoSuchLovValueException is thrown if, while existing, the LOV does not contain the desired LovValue.

Parameters:
p_lovOID - The oid of the LOV that we want to parse.
p_lovValueOID - The oid that we want to find in the selected LOV.
Returns:
The LovValue having the oid p_lovValueOID in the LOV whose oid is p_lovOID.
Throws:
NoSuchLovException - if no LOV is found for the given p_lovOID.
NoSuchLovValueException - if no LovValue is found having the p_lovValueOID in the selected LOV.
java.lang.IllegalArgumentException - if the given p_lovOID or p_lovValueOID is (are) null.
See Also:
LovValue

getListOfValues

public java.util.List getListOfValues(java.lang.Long p_lovOID)
                               throws NoSuchLovException
Returns, in the order of the executed SQL, the list of LovValues corresponding to the given p_lovOID.

Parameters:
p_lovOID - The oid of the LOV that we want to retrieve.
Returns:
A list of LovValues corresponding to the execution of the given lovOID. The LovValues are returned as they are retrieve from the execution of the SQL statement (cf. ORDER BY clause).
Throws:
java.lang.IllegalArgumentException - if the given lovOID is null.
NoSuchLovException - if no LOV is having the given oid.
See Also:
LovBean, LovValue

getLovValues

public java.util.Map getLovValues(java.lang.Long p_lovOID)
                           throws NoSuchLovException
Returns a map (LovValueOID, LovValue) of LovValues corresponding to the given p_lovOID.

Parameters:
p_lovOID - The oid of the LOV that we want to retrieve.
Returns:
A list of LovValues corresponding to the execution of the given p_lovOID. The LovValues are returned as they are retrieve from the execution of the SQL statement (cf. ORDER BY clause).
Throws:
java.lang.IllegalArgumentException - if the given p_lovOID is null.
NoSuchLovException - if no LOV is having the given oid.
See Also:
LovBean, LovValue

resynchronizeListOfValues

public void resynchronizeListOfValues(java.lang.Long p_lovOID)
                               throws NoSuchLovException
Ensures that the LOVs using the same TABLE_NAME as the LOV identified by the given OID are reloaded (in general due to a data update). It includes, of course, the lov identified by the given lovOID.

Parameters:
p_lovOID - The oid of the LOV whose TABLE_NAME will be used to refresh the LOVs.
Throws:
java.lang.IllegalArgumentException - if the given p_lovOID is null.
NoSuchLovException - if there is no LOV having the given lovOID.
See Also:
LovBean, resynchronizeListOfValues(String p_tableName)

resynchronizeListOfValues

public void resynchronizeListOfValues(java.lang.String p_tableName)
Ensures that the LOVs referencing the TABLE_NAME are reseted. Usually because the underlying data have changed.

Parameters:
p_tableName - The oid of the LOV whose TABLE_NAME will be used to refresh the LOVs. Does nothing if the name is invalid (null, no match).
See Also:
LovBean, resynchronizeListOfValues(Long p_lovOID)

getLov

private LOVLocal getLov(java.lang.Long p_lovOID)
                 throws NoSuchLovException
Utility method to provide access to the desired LOV.

Parameters:
p_lovOID - The oid of the desired LOV.
Returns:
A LovLocal corresponding to the desired LOV.
Throws:
NoSuchLovException - if no LOV is found having the given oid.

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Throws:
javax.ejb.CreateException