com.ibm.commerce.order.commands

Class CheckOrderAttributesCmdImpl

    • Field Detail

      • COPYRIGHT

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

      • CheckOrderAttributesCmdImpl

        public CheckOrderAttributesCmdImpl()
    • Method Detail

      • setOrderItems

        public void setOrderItems(java.util.Map orderItemIds)
        set order item id
        Parameters:
        orderItemIds -
      • getOrderItems

        public java.util.Map getOrderItems()
        Specified by:
        getOrderItems in interface CheckOrderAttributesCmd
        Returns:
        Map with below format The following sample code demonstrates how to resolve the result:
                Map result = checkOrderAttributes.getOrderItems();
                String[] orderItemIds = (String[]) result.get("orderItemIds");
                Map[]    attributes   = (Map[])    result.get("attributeNames");
          for (int i=0; i<orderItemIds.length; i++) {
                String orderItem=orderItemIds[i];
                Map attributesArray = attributes[i];
                if (attributesArray.containsKey("attributeName1")){
                        String attributeValue1 = (String) attributesArray.get("attributeName1");
                }
          }
         
      • getOrderAccessBean

        public OrderAccessBean getOrderAccessBean()
        get order access bean
        Returns:
        iOrderAB
      • getOrderItemAccessBean

        public OrderItemAccessBean[] getOrderItemAccessBean()
        get order item access bean
        Returns:
        iOrderItemAB
      • setAttributes

        public void setAttributes(java.lang.String[] attributeNames,
                                  java.lang.String[] attributeValues)
        set attributes you want to check. If attributeValues is null, return order items which contain any one of attribute names and attributes' values. If attributeValues is not null, return order items which contain attributeNames[i] and the attribute value equal to the value of attributeValues[i]. The following sample code demonstrates how to set attributes:
              String[] attributeNames  = new String[] ({"attributeName1",  "attributeName2" });
              String[] attributeValues = new String[] ({"attributeValue1", "attributeValue2"});
         
        attributeValues can be null.
        Specified by:
        setAttributes in interface CheckOrderAttributesCmd
        Parameters:
        attributeNames -
        attributeValues -
      • getAttributes

        public java.util.Map getAttributes()
        get attributes' names and values
        Returns:
        Map
      • performExecute

        public void performExecute()
                            throws ECException
        This is the default implementation of this task command. It checks the specified order. If caller did not specify attributes' values, this task command returns order items list which contains any of attribute name. If caller specified attributes' values, this task command return order items list which the order item contains any attributeNames[i] and the value equal to attributeValues[i].
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • reset

        public void reset()
        reset all parameters
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand