java.lang.Object | +--com.ibm.commerce.orderitems.commands.OrderItemsCmdHelper
This is a helper class containing some useful methods used in the order item related commands.
Field Summary | |
---|---|
static int |
PRICEREF_COMPLETE_REFRESH The price refresh flag in the store table. |
static int |
PRICEREF_DEFAULT The price refresh flag in the store table. |
static int |
PRICEREF_QUICK_COMPLETE_REFRESH The price refresh flag in the store table. |
static int |
PRICEREF_QUICK_REFRESH The price refresh flag in the store table. |
Constructor Summary | |
---|---|
OrderItemsCmdHelper() OrderProcessingHelper constructor. |
Method Summary | |
---|---|
static java.lang.String[] |
getEligibleTradingAgreements(
CommandContext commandContext, java.lang.Long memberId) Obtaints a list of eligible trading agreements to be used. |
static
OrderItemsCmdHelper |
getUniqueInstance() Get the unique instance of the OrderItemsCmdHelper object. |
static void |
insertOrderItemOffer(
OrderItemAccessBean orderitemAB, java.lang.Long[] offerIds) Saves the offers that were used for searching the price for an orderitem. |
static void |
insertOrderItemTrading(
OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds) Saves the trading agreements that were used for searching the price for an orderitem. |
static boolean |
isTradingAgreementValid(java.lang.Long tradingId,
java.lang.String[] eligibleTradingIds) Verifies the input trading agreement against a list of eligible trading agreements. |
static java.lang.Long[] |
resolveTradingAgreements(
CommandContext commandContext,
OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds,
int refreshFlag) Verifies and resolves a list of eligible trading agreements for the user. |
static java.lang.Long[] |
retrieveOffers(
OrderItemAccessBean orderitemAB, int refreshFlag,
boolean retryFlag) Retrieves previously searched offers for an orderitem based on the Price Refresh Flag (PRICEREFFLAGS) in STORE: 0: Default, same as 1 except that it will not save the offer id. |
static java.lang.Long[] |
retrieveTradings(
CommandContext commandContext,
OrderItemAccessBean orderitemAB, int refreshFlag,
boolean retryFlag) Retrieves previously searched offers for an orderitem based on the Price Refresh Flag (PRICEREFFLAGS) in STORE: 0: Default, same as 1 except that it will not save the trading agreement id. |
static void |
updateContractId(
OrderItemAccessBean orderitemAB,
StoreAccessBean storeAB) Saves the default contract id that provided the price for the orderitem (old support). |
static void |
updateTotalProductPrice(
OrderItemAccessBean orderitemAB) Update the total price for the order item. |
static void |
updateTradingId(
OrderItemAccessBean orderitemAB,
StoreAccessBean storeAB,
java.lang.Long anTradingId) Saves the trading agreement ids that provided the best price for the orderitem. |
static void |
verifyTradingIsStillValid(
CommandContext theCommandContext,
OrderItemAccessBean theOrderItemAB) Verifies that the trading id of the order item is still valid. |
static void |
verifyTradingPaymentMethods(
CommandContext commandContext,
java.util.Enumeration enOrderItemABs) Validate the trading agreements used by the orderitems in an order by checking if they define compatible payment methods and are associated with the same account as the other orderitems in the order. |
static java.lang.Long[] |
verifyTradingPaymentMethods(
CommandContext commandContext,
OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds) Verifies if the trading agreements being used in an orderitem have defined compatible payment methods with those trading agreements that are being used in the order. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Field Detail |
---|
public static final int PRICEREF_DEFAULT
public static final int PRICEREF_QUICK_REFRESH
public static final int PRICEREF_QUICK_COMPLETE_REFRESH
public static final int PRICEREF_COMPLETE_REFRESH
Constructor Detail |
---|
public OrderItemsCmdHelper()
Method Detail |
---|
public static java.lang.String[] getEligibleTradingAgreements(CommandContext commandContext, java.lang.Long memberId) throws ECException, FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
The eligible list of trading agreements can be obtained directly from the Command Context (if no member id is provided or the input member id is the one in Command Context) or retrieved by means of the member id (if the id is provided and is different from that in the Command Context).
commandContext
- the current command context.memberId
- the id of the member.
ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException
public static OrderItemsCmdHelper getUniqueInstance()
public static void insertOrderItemOffer(OrderItemAccessBean orderitemAB, java.lang.Long[] offerIds) throws ECException, FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.offerIds
- the ids of the offers to be saved.ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException
public static void insertOrderItemTrading(OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds) throws ECException, FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.tradingIds
- the ids of the tradings to be saved.ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException
public static boolean isTradingAgreementValid(java.lang.Long tradingId, java.lang.String[] eligibleTradingIds) throws ECException
tradingId
- the id of the trading agreement to be
verified.eligibleTradingIds
- the ids of the list of eligible trading
agreements.
ECException
public static java.lang.Long[] resolveTradingAgreements(CommandContext commandContext, OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds, int refreshFlag) throws ECException, FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
If trading agreements are specified, the input list will be verified against the eligible list before they will be used.
If the orderitem is newly created but no trading agreements are specified, the trading agreements can be obtained from the Command Context if the input member id is the one in Command Context or retrieved by means of the member id (if the id is provided and is different from that in the Command Context). Existing orderitem will have the price refreshed according to the price refresh flag.
commandContext
- the command context.orderitemAB
- the access bean of the orderitem.tradingIds
- the input trading agreement ids.refreshFlag
- the price refresh flag.
ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException
public static void verifyTradingIsStillValid(CommandContext theCommandContext, OrderItemAccessBean theOrderItemAB) throws ECException
theCommandContext
- The command context.theOrderItemAB
- The order item to check.ECException
- If the trading is no longer valid then this exception is raised with the
message _ERR_INVALID_TRADING.public static java.lang.Long[] retrieveOffers(OrderItemAccessBean orderitemAB, int refreshFlag, boolean retryFlag) throws ECException, FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.refreshFlag
- the price refresh flag.retryFlag
- the price calculation retry flag.
ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException
public static java.lang.Long[] retrieveTradings(CommandContext commandContext, OrderItemAccessBean orderitemAB, int refreshFlag, boolean retryFlag) throws ECException, FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
commandContext
- command context.orderitemAB
- the access bean of the orderitem.refreshFlag
- the price refresh flag.retryFlag
- the price calculation retry flag.
ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException
public static void updateContractId(OrderItemAccessBean orderitemAB, StoreAccessBean storeAB) throws ECException, FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.storeAB
- the access bean of the store.ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException
public static void updateTotalProductPrice(OrderItemAccessBean orderitemAB) throws ECException, FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- OrderItemAccessBeanECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException
public static void updateTradingId(OrderItemAccessBean orderitemAB, StoreAccessBean storeAB, java.lang.Long anTradingId) throws FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException
orderitemAB
- the access bean of the orderitem.storeAB
- the access bean of the store.anTradingId
- the id of the trading agreement.FinderException
- EJB exception.CreateException
- EJB exception.javax.naming.NamingException
- EJB exception.java.rmi.RemoteException
- EJB exception.public static java.lang.Long[] verifyTradingPaymentMethods(CommandContext commandContext, OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds) throws ECException
commandContext
- the command context.orderitemAB
- the access bean of the orderitem.tradingIds
- the trading agreement ids to be used in the
orderitem.
ECException
public static void verifyTradingPaymentMethods(CommandContext commandContext, java.util.Enumeration enOrderItemABs) throws ECException
commandContext
- CommandContextenOrderItemABs
- EnumerationECException