atg.commerce.order.processor
Class OrderRepositoryUtils

java.lang.Object
  extended by atg.commerce.order.processor.OrderRepositoryUtils

public class OrderRepositoryUtils
extends java.lang.Object

This class contains utility methods which the load and save processors use to access the OrderRepository.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
OrderRepositoryUtils()
           
 
Method Summary
static java.lang.Object getPropertyValue(Order pOrder, java.lang.Object pBean, java.lang.String pPropertyName)
          Introspects the given object for the property and returns its value.
static RepositoryItem getRepositoryItem(MutableRepository pMutRep, CommerceIdentifier pCommerceIdentifier, OrderTools pOrderTools)
          Returns a RepositoryItem reference which refers to the CommerceIdentifier object which is supplied in pCommerceIdentifier.
static java.util.List getRepositoryItems(MutableRepository pMutRep, java.util.List pCommerceIdentifierList, java.util.List pSaveList, OrderTools pOrderTools)
          Returns a List of RepositoryItem references which refer to the CommerceIdentifier objects which are supplied in pCommerceIdentifierList.
static java.util.Map getRepositoryItems(MutableRepository pMutRep, java.util.Map pCommerceIdentifierMap, java.util.Map pSaveMap, OrderTools pOrderTools)
          Returns a Map of RepositoryItem references which refer to the CommerceIdentifier objects which are supplied in pCommerceIdentifierList.
static java.lang.Object[] getRepositoryItems(MutableRepository pMutRep, java.lang.Object[] pCommerceIdentifierArray, OrderTools pOrderTools)
          Returns an array of RepositoryItem references which refer to the CommerceIdentifier objects which are supplied in pCommerceIdentifierArray.
static java.util.Set getRepositoryItems(MutableRepository pMutRep, java.util.Set pCommerceIdentifierSet, java.util.Set pSaveSet, OrderTools pOrderTools)
          Returns a Set of RepositoryItem references which refer to the CommerceIdentifier objects which are supplied in pCommerceIdentifierList.
static boolean hasProperty(Order pOrder, java.lang.Object pBean, java.lang.String pPropertyName)
          Introspects the given object for the property and returns true if the property exists and false otherwise.
static void saveRepositoryItem(MutableRepository pMutRep, MutableRepositoryItem pMutItem, java.lang.String pPropertyName, java.lang.Object pValue, OrderTools pOrderTools)
          Saves the given value to the given repository property.
static void setPropertyValue(Order pOrder, java.lang.Object pBean, java.lang.String pPropertyName, java.lang.Object pValue)
          Uses introspection on the given object to set the given property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

OrderRepositoryUtils

public OrderRepositoryUtils()
Method Detail

getRepositoryItems

public static java.util.List getRepositoryItems(MutableRepository pMutRep,
                                                java.util.List pCommerceIdentifierList,
                                                java.util.List pSaveList,
                                                OrderTools pOrderTools)
                                         throws java.beans.IntrospectionException,
                                                RepositoryException
Returns a List of RepositoryItem references which refer to the CommerceIdentifier objects which are supplied in pCommerceIdentifierList.

Parameters:
pMutRep - a reference to the repository which the given item exists in
pCommerceIdentifierList - the List of CommerceIdentifier objects which the RepositoryItems map to
pOrderTools - a reference to the OrderTools
Returns:
a List of MutableRepositoryItems
Throws:
java.beans.IntrospectionException - if an exception occurs while introspecting the item
RepositoryException - if an an exception occurs while accessing the Repository

getRepositoryItems

public static java.util.Map getRepositoryItems(MutableRepository pMutRep,
                                               java.util.Map pCommerceIdentifierMap,
                                               java.util.Map pSaveMap,
                                               OrderTools pOrderTools)
                                        throws java.beans.IntrospectionException,
                                               RepositoryException
Returns a Map of RepositoryItem references which refer to the CommerceIdentifier objects which are supplied in pCommerceIdentifierList.

Parameters:
pMutRep - a reference to the repository which the given item exists in
pCommerceIdentifierMap - the Map of CommerceIdentifier objects which the RepositoryItems map to
pOrderTools - a reference to the OrderTools
Returns:
a Map of MutableRepositoryItems
Throws:
java.beans.IntrospectionException - if an exception occurs while introspecting the item
RepositoryException - if an an exception occurs while accessing the Repository

getRepositoryItems

public static java.util.Set getRepositoryItems(MutableRepository pMutRep,
                                               java.util.Set pCommerceIdentifierSet,
                                               java.util.Set pSaveSet,
                                               OrderTools pOrderTools)
                                        throws java.beans.IntrospectionException,
                                               RepositoryException
Returns a Set of RepositoryItem references which refer to the CommerceIdentifier objects which are supplied in pCommerceIdentifierList.

Parameters:
pMutRep - a reference to the repository which the given item exists in
pCommerceIdentifierSet - the Set of CommerceIdentifier objects which the RepositoryItems map to
pOrderTools - a reference to the OrderTools
Returns:
a Set of MutableRepositoryItems
Throws:
java.beans.IntrospectionException - if an exception occurs while introspecting the item
RepositoryException - if an an exception occurs while accessing the Repository

getRepositoryItems

public static java.lang.Object[] getRepositoryItems(MutableRepository pMutRep,
                                                    java.lang.Object[] pCommerceIdentifierArray,
                                                    OrderTools pOrderTools)
                                             throws java.beans.IntrospectionException,
                                                    RepositoryException
Returns an array of RepositoryItem references which refer to the CommerceIdentifier objects which are supplied in pCommerceIdentifierArray.

Parameters:
pMutRep - a reference to the repository which the given item exists in
pCommerceIdentifierArray - the Array of CommerceIdentifier objects which the RepositoryItems map to
pOrderTools - a reference to the OrderTools
Returns:
an Array of MutableRepositoryItems
Throws:
java.beans.IntrospectionException - if an exception occurs while introspecting the item
RepositoryException - if an an exception occurs while accessing the Repository

getRepositoryItem

public static RepositoryItem getRepositoryItem(MutableRepository pMutRep,
                                               CommerceIdentifier pCommerceIdentifier,
                                               OrderTools pOrderTools)
                                        throws java.beans.IntrospectionException,
                                               RepositoryException
Returns a RepositoryItem reference which refers to the CommerceIdentifier object which is supplied in pCommerceIdentifier.

Parameters:
pMutRep - a reference to the repository which the given item exists in
pCommerceIdentifier - the CommerceIdentifier object which the RepositoryItem maps to
pOrderTools - a reference to the OrderTools
Returns:
a MutableRepositoryItem
Throws:
java.beans.IntrospectionException - if an exception occurs while introspecting the item
RepositoryException - if an an exception occurs while accessing the Repository

saveRepositoryItem

public static void saveRepositoryItem(MutableRepository pMutRep,
                                      MutableRepositoryItem pMutItem,
                                      java.lang.String pPropertyName,
                                      java.lang.Object pValue,
                                      OrderTools pOrderTools)
                               throws java.beans.IntrospectionException,
                                      RepositoryException
Saves the given value to the given repository property.

Parameters:
pMutRep - the repository that contains the item to be saved
pMutItem - the repository item to be saved
pPropertyName - the repository item name that the item is saved to
pValue - the value of the property to save
pOrderTools - the OrderTools Nucleus component
Throws:
RepositoryException - if an exception occurs while accessing the Repository
java.beans.IntrospectionException - if an exception occurs while introspecting the item to be saved

getPropertyValue

public static java.lang.Object getPropertyValue(Order pOrder,
                                                java.lang.Object pBean,
                                                java.lang.String pPropertyName)
                                         throws PropertyNotFoundException
Introspects the given object for the property and returns its value. If the given property is not local to the given object, then it is parsed, the object found and the value returned. The keyword "this" refers to the current order. If a property name is of the form this.prop.prop2 then the property value is prop2 in the bean named prop in the order. If a property is of the form prop.prop2 them the property value is prop2 in the bean named prop in the current item which is passed in as pBean.

Parameters:
pOrder - the current order context
pBean - the object which the property is found in
pPropertyName - the name of the property
Throws:
PropertyNotFoundException - if the the property is not found in the bean

setPropertyValue

public static void setPropertyValue(Order pOrder,
                                    java.lang.Object pBean,
                                    java.lang.String pPropertyName,
                                    java.lang.Object pValue)
                             throws PropertyNotFoundException,
                                    java.beans.IntrospectionException
Uses introspection on the given object to set the given property value. If the given property is not local to the given object, then it is parsed, the object found and the value set. The keyword "this" refers to the current order. If a property name is of the form this.prop.prop2 then the property value is prop2 in the bean named prop in the order. If a property is of the form prop.prop2 them the property value is prop2 in the bean named prop in the current item which is passed in as pBean.

Parameters:
pOrder - the current order context
pBean - the object which the property is in
pPropertyName - the name of the property
pValue - the value to set
Throws:
java.beans.IntrospectionException - if an exception occurs while introspecting the item to be saved
PropertyNotFoundException - if the the property is not found in the bean

hasProperty

public static boolean hasProperty(Order pOrder,
                                  java.lang.Object pBean,
                                  java.lang.String pPropertyName)
                           throws java.beans.IntrospectionException
Introspects the given object for the property and returns true if the property exists and false otherwise. If the given property is not local to the given object, then it is parsed, the object found and the value returned. The keyword "this" refers to the current order. If a property name is of the form this.prop.prop2 then the property value is prop2 in the bean named prop in the order. If a property is of the form prop.prop2 them the property value is prop2 in the bean named prop in the current item which is passed in as pBean.

Parameters:
pOrder - the current order context
pBean - the object which the property is found in
pPropertyName - the name of the property
Throws:
java.beans.IntrospectionException - if an exception occurs while introspecting the item to be saved