com.ibm.commerce.account.util

Class AccountTCFactory

  • java.lang.Object
    • com.ibm.commerce.account.util.AccountTCFactory


  • public class AccountTCFactory
    extends java.lang.Object
    Reserved for IBM internal use.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASSNAME
      The name of this class.
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void checkAccountTC(org.w3c.dom.Element aelmTC)
      Checks the type of specified term and condition.
      static java.lang.Long createNewTC(java.lang.Long argTradingId, org.w3c.dom.Element argTCElement)
      Creates a new term and condition into the specified trading agreement.
      static void deleteTC(java.lang.String argTCId, org.w3c.dom.Element argTCElement)
      Deletes the specified term and condition.
      static java.lang.String getTCAccessBeanClassName(org.w3c.dom.Element argTCElement)
      Gets the AccessBean class name of a term and condition based on the given term condition Element object.
      static java.lang.String getTCAccessBeanClassName(java.lang.String argTCSubType)
      Gets the AccessBean class name of a term and condition on the given term and condition sub-type.
      static java.lang.String getTCType(org.w3c.dom.Element aelmTC)
      Gets the type of the term and condition.
      static void processTC(java.lang.Long argTradingId, org.w3c.dom.Element argTCElement, java.sql.Timestamp currentTime)
      Creates or updates a term and condition.
      static java.lang.Long processTC(java.lang.Long argTradingId, org.w3c.dom.Element argTCElement, java.sql.Timestamp currentTime, boolean isCreate)
      Creates or updates a term and condition.
      static void updateTC(java.lang.String argTCId, org.w3c.dom.Element argTCElement)
      Updates a term and condition.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The name of this class.
        See Also:
        Constant Field Values
      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Method Detail

      • checkAccountTC

        public static void checkAccountTC(org.w3c.dom.Element aelmTC)
                                   throws com.ibm.commerce.exception.ECException
        Checks the type of specified term and condition.
        Parameters:
        aelmTC - The Element object of the term and condition.
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_ACCOUNT_TC_NOT_SUPPORTED when the type of the term and condition is not one of the following type: PaymentTC, InvoiceTC, POTCBlanket, POTCLimited, POTCIndividual, DisplayCustomizationTC.
      • createNewTC

        public static java.lang.Long createNewTC(java.lang.Long argTradingId,
                                                 org.w3c.dom.Element argTCElement)
                                          throws com.ibm.commerce.exception.ECApplicationException,
                                                 javax.naming.NamingException,
                                                 java.rmi.RemoteException,
                                                 javax.ejb.CreateException,
                                                 javax.ejb.RemoveException,
                                                 java.sql.SQLException,
                                                 java.lang.Exception
        Creates a new term and condition into the specified trading agreement.
        Parameters:
        argTradingId - The trading agreement ID
        argTCElement - The term and condition Element object
        Returns:
        The ID of the new created term and condition
        Throws:
        com.ibm.commerce.exception.ECApplicationException -

        Raised with message _ERR_RETRIEVE_STORE_ID if the store ID cannot be retrieved from the information provided in the StoreRef element in one of the terms and conditions.

        Raised with message _ERR_RETRIEVE_POLICY_TYPE if the policy type cannot be retrieved based on information in policy reference element.

        Raised with message _ERR_RETRIEVE_ORG_ID if an error occurred when retrieving the organization ID.

        Raised with message _ERR_RETRIEVE_USER_ID if an error occurred when retrieving the user ID.

        Raised with message _ERR_RETRIEVE_MEMBER_GROUP_ID if an error occurred when retrieving the member group ID.

        Raised with message _ERR_RETRIEVE_OPERATOR_ID if an error occurred when retrieving the opearator ID. The value of "operator" in "AttributeValue" element is incorrect.

        Raised with message _ERR_RETRIEVE_PATTRIBUTE_ID if an error occurred when retrieving the pattribute_id. The value of "attributeName" in "AttributeDetail" element is incorrect.

        Raised with message _ERR_RETRIEVE_CATENTRY_ID if an error occurred when retrieving the catentry_id. The information specified in "OrderTCOrderItemPAttribute" element is incorrect.

        Raised with message _ERR_RETRIEVE_POLICY_ID if an error occurred when retrieving the policy_id. The information specified in the policy reference element is incorrect.

        Raised with message _ERR_RETRIEVE_FFMCENTER_ID if an error occurred when retrieving ffmcenter_id. The information specified in "FilfillmentCenterRef" element is incorrect.

        Raised with message _ERR_COLUMN_ACCESSBEANNAME_IN_PATTRIBUTE_NOT_POPULATED if an error occurred when retrieving personalization attribute value access bean. Column ACCESSBEANNAME in table PATTRIBUTE is not populated correctly.

        Raised with message _ERR_PATTRIBUTE_NOT_REGISTERED_IN_TABLE_PATTRPROD_FOR_CATENTRY if an error occurred when validating whether the catentry has the corresponding personalization attribute registered in table PattrProd. catentry_id and pattribute_id retrieved from OrderTCOrderItemPAttribute element should be registered in the PATTRPROD table.

        Raised with message _ERR_TOO_MANY_FULFILLMENT_TC if a contract has more than three fulfillment centers defined in a term and condition.

        Raised with message _ERR_SAVE_TC_ATTR if an error occurred when saving the attribute of the term and condition to the TCATTR table.

        Raised with message _ERR_DUPLICATE_KEY_IN_PROCESSING_TC if a duplicate key error occurred when processing a term and condition.

        javax.naming.NamingException
        java.rmi.RemoteException
        javax.ejb.CreateException
        javax.ejb.RemoveException
        java.sql.SQLException
        java.lang.Exception - any other exceptions
      • deleteTC

        public static void deleteTC(java.lang.String argTCId,
                                    org.w3c.dom.Element argTCElement)
                             throws com.ibm.commerce.exception.ECException
        Deletes the specified term and condition.
        Parameters:
        argTCId - The ID of the term and condition.
        argTCElement - The Element object of the term and condition.
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_TC_ACCESSBEAN_NOT_DEFINED if an access bean cannot be found for this term and condition. Raised with message _ERR_CLASS_NOT_FOUND if the AccessBean class cannot be found in the system. Raised with message _ERR_CREATE_EXCEPTION if a CreateException occurred. Raised with message _ERR_NAMING_EXCEPTION if a NamingException occurred. Raised with message _ERR_SQL_EXCEPTION if a SQLException occurred. Raised with message _ERR_REMOTE_EXCEPTION if a RemoteException occurred. Raised with message _ERR_ACCOUNT_TC_GENERIC_ERROR if any other type of errors occurred.
      • getTCAccessBeanClassName

        public static java.lang.String getTCAccessBeanClassName(org.w3c.dom.Element argTCElement)
                                                         throws javax.naming.NamingException,
                                                                java.rmi.RemoteException,
                                                                javax.ejb.CreateException,
                                                                java.sql.SQLException
        Gets the AccessBean class name of a term and condition based on the given term condition Element object.
        Parameters:
        argTCElement - The term and condition Element object which includes the term and condition information.
        Returns:
        The class name of the AccessBean
        Throws:
        javax.naming.NamingException
        java.rmi.RemoteException
        javax.ejb.CreateException
        java.sql.SQLException
      • getTCAccessBeanClassName

        public static java.lang.String getTCAccessBeanClassName(java.lang.String argTCSubType)
                                                         throws javax.naming.NamingException,
                                                                java.sql.SQLException
        Gets the AccessBean class name of a term and condition on the given term and condition sub-type.
        Parameters:
        argTCSubType - The term and condition sub-type
        Returns:
        The class name of the AccessBean
        Throws:
        javax.naming.NamingException
        java.sql.SQLException
      • getTCType

        public static java.lang.String getTCType(org.w3c.dom.Element aelmTC)
                                          throws com.ibm.commerce.exception.ECException
        Gets the type of the term and condition.
        Parameters:
        aelmTC - The Element object of the term and condition
        Returns:
        The type of term and condition
        Throws:
        com.ibm.commerce.exception.ECException
      • processTC

        public static void processTC(java.lang.Long argTradingId,
                                     org.w3c.dom.Element argTCElement,
                                     java.sql.Timestamp currentTime)
                              throws com.ibm.commerce.contract.helper.TermCondCreateException,
                                     com.ibm.commerce.exception.ECException,
                                     javax.ejb.RemoveException,
                                     java.sql.SQLException
        Creates or updates a term and condition.
        Parameters:
        argTCElement - The term and condition Element object
        argTradingId - The trading agreement ID to which the term and condition will be added
        currentTime - The Timestamp object for current time
        Throws:
        java.rmi.RemoteException.
        javax.naming.NamingException.
        javax.ejb.CreateException.
        javax.ejb.FinderException.
        javax.ejb.RemoveException.
        java.sql.SQLException.
        com.ibm.commerce.exception.ECException.
        com.ibm.commerce.contract.helper.TermCondCreateException
        com.ibm.commerce.exception.ECException
        javax.ejb.RemoveException
        java.sql.SQLException
        See Also:
        createNewTC(Long argTradingId, org.w3c.dom.Element argTCElement), updateTC(String argTCId, org.w3c.dom.Element argTCElement), deleteTC(String argTCId, org.w3c.dom.Element argTCElement), ContractCmdUtil.tcDescriptionSet(argTCElement, argTCId)
      • processTC

        public static java.lang.Long processTC(java.lang.Long argTradingId,
                                               org.w3c.dom.Element argTCElement,
                                               java.sql.Timestamp currentTime,
                                               boolean isCreate)
                                        throws javax.naming.NamingException,
                                               com.ibm.commerce.exception.ECException,
                                               javax.ejb.RemoveException,
                                               java.sql.SQLException
        Creates or updates a term and condition.
        Parameters:
        argTCElement - The term and condition Element object
        argTradingId - The trading agreement ID to which the term and condition will be added
        currentTime - The Timestamp object for current time
        isCreate - The flag to indicate the action. true - create, false - update
        Returns:
        The ID of the term and condition
        Throws:
        java.rmi.RemoteException.
        javax.naming.NamingException.
        javax.ejb.CreateException.
        javax.ejb.FinderException.
        javax.ejb.RemoveException.
        java.sql.SQLException.
        com.ibm.commerce.exception.ECException.
        javax.naming.NamingException
        com.ibm.commerce.exception.ECException
        javax.ejb.RemoveException
        java.sql.SQLException
        See Also:
        createNewTC(Long argTradingId, org.w3c.dom.Element argTCElement), updateTC(String argTCId, org.w3c.dom.Element argTCElement), deleteTC(String argTCId, org.w3c.dom.Element argTCElement), ContractCmdUtil.TermConditionDescriptionSet(tcDescElement, tcId, currentTime), ContractCmdUtil.addParticipants(tcParticipants, null, tcId, currentTime)
      • updateTC

        public static void updateTC(java.lang.String argTCId,
                                    org.w3c.dom.Element argTCElement)
                             throws com.ibm.commerce.exception.ECException
        Updates a term and condition.
        Parameters:
        argTCId - The ID of the term and condition
        argTCElement - The term and condition Element object
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_RETRIEVE_STORE_ID if the store ID cannot be retrieved from the information provided in the StoreRef element in one of the terms and conditions. Raised with message _ERR_RETRIEVE_POLICY_TYPE if the policy type cannot be retrieved based on information in the policy reference element. Raised with message _ERR_RETRIEVE_ORG_ID if an error occurred when retrieving the organization ID. Raised with message _ERR_RETRIEVE_USER_ID if an error occurred when retrieving the user ID. Raised with message _ERR_RETRIEVE_MEMBER_GROUP_ID if an error occurred when retrieving the member group ID. Raised with message _ERR_RETRIEVE_OPERATOR_ID if an error occurred when retrieving opeartor_id. The value of "operator" in "AttributeValue" element is incorrect. Raised with message _ERR_RETRIEVE_PATTRIBUTE_ID if an error occurred when retrieving pattribute_id. The value of "attributeName" in "AttributeDetail" element is incorrect. Raised with message _ERR_RETRIEVE_CATENTRY_ID if an error occurred when retrieving catentry_id. The information specified in "OrderTCOrderItemPAttribute" element is incorrect. Raised with message _ERR_RETRIEVE_POLICY_ID if an error occurred when retrieving policy_id. The information specified in the policy reference element is incorrect. Raised with message _ERR_RETRIEVE_FFMCENTER_ID if an error occurred when retrieving ffmcenter_id. The information specified in "FilfillmentCenterRef" element is incorrect. Raised with message _ERR_COLUMN_ACCESSBEANNAME_IN_PATTRIBUTE_NOT_POPULATED if an error occurred when retrieving personalization attribute value access bean. Column ACCESSBEANNAME in table PATTRIBUTE is not populated correctly. Raised with message _ERR_PATTRIBUTE_NOT_REGISTERED_IN_TABLE_PATTRPROD_FOR_CATENTRY if an error occurred when validating whether catentry has the corresponding personalization attribute registered in table PATTRPROD. catentry_id and pattribute_id retrieved from OrderTCOrderItemPAttribute element should be registered in table PATTRPROD. Raised with message _ERR_TOO_MANY_FULFILLMENT_TC if a contract has more than three fulfillment centers defined in a term and condition. Raised with message _ERR_SAVE_TC_ATTR if an error occurred when saving the attribute of the term and condition to TCATTR table. Raised with message _ERR_DUPLICATE_KEY_IN_PROCESSING_TC if a duplicate key error occurred when processing a term and condition. Raised with message _ERR_ACCOUNT_TC_GENERIC_ERROR if any other type errors occurred.