java.lang.Objectcom.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 anabOrderItem, int anRefreshFlag) 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[] | 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[] | retrieveSearchedAndSavedOffers(OrderItemAccessBean anabOrderItem) Retrieves previously searched offers for an orderitem. |
static java.lang.Long[] | retrieveSearchedAndSavedTradings(OrderItemAccessBean anabOrderItem, CommandContext aCommandContext) Retrieves previously searched valid trading agreements for an orderitem. |
static java.lang.Long[] | retrieveTradings(CommandContext aCommandContext, OrderItemAccessBean anabOrderItem, int anRefreshFlag) Retrieves previously searched trading agreements 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 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 java.lang.String | toString(java.lang.Long[] anArr) |
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).
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
public static void insertOrderItemTrading(OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds) throws 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
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.
public static void verifyTradingIsStillValid(CommandContext theCommandContext, OrderItemAccessBean theOrderItemAB) throws ECException
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
public static java.lang.Long[] retrieveOffers(OrderItemAccessBean anabOrderItem, int anRefreshFlag) throws FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException
public static java.lang.Long[] retrieveSearchedAndSavedOffers(OrderItemAccessBean anabOrderItem) throws FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException
public static java.lang.Long[] retrieveTradings(CommandContext aCommandContext, OrderItemAccessBean anabOrderItem, int anRefreshFlag) throws FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException, ECException
public static java.lang.Long[] retrieveSearchedAndSavedTradings(OrderItemAccessBean anabOrderItem, CommandContext aCommandContext) throws FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException, ECException
public static java.lang.String toString(java.lang.Long[] anArr)
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
public static void updateContractId(OrderItemAccessBean orderitemAB, StoreAccessBean storeAB) throws 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
public static void updateTradingId(OrderItemAccessBean orderitemAB, StoreAccessBean storeAB, java.lang.Long anTradingId) throws FinderException, CreateException, javax.naming.NamingException, java.rmi.RemoteException
public static java.lang.Long[] verifyTradingPaymentMethods(CommandContext commandContext, OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds) throws ECException
public static void verifyTradingPaymentMethods(CommandContext commandContext, java.util.Enumeration enOrderItemABs) throws ECException
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.