com.ibm.commerce.rest.inventory.handler

Class InventoryHandler

    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • RESOURCE_NAME

        public static final java.lang.String RESOURCE_NAME
        The Constant RESOURCE_NAME.
        See Also:
        Constant Field Values
      • RESOURCE_MAPPING_KEY

        public static final java.lang.String RESOURCE_MAPPING_KEY
        The Constant RESOURCE_MAPPING_KEY.
        See Also:
        Constant Field Values
      • PARAMETER_ONLINE_STORE_ID

        public static final java.lang.String PARAMETER_ONLINE_STORE_ID
        online store identifier
        See Also:
        Constant Field Values
      • PARAMETER_ONLINE_STORE_NAME_IDENTIFIER

        public static final java.lang.String PARAMETER_ONLINE_STORE_NAME_IDENTIFIER
        online store DIRECTORY
        See Also:
        Constant Field Values
      • PARAMETER_PHYSICAL_STORE_IDENTIFIER

        public static final java.lang.String PARAMETER_PHYSICAL_STORE_IDENTIFIER
        physical store external identifier
        See Also:
        Constant Field Values
      • PARAMETER_ONLINE_STORE_ID_DESCRIPTION

        public static final java.lang.String PARAMETER_ONLINE_STORE_ID_DESCRIPTION
        online store identifier description
        See Also:
        Constant Field Values
      • PARAMETER_ONLINE_STORE_NAME_DESCRIPTION

        public static final java.lang.String PARAMETER_ONLINE_STORE_NAME_DESCRIPTION
        online store name description
        See Also:
        Constant Field Values
      • PARAMETER_PHYSICAL_STORE_IDS

        public static final java.lang.String PARAMETER_PHYSICAL_STORE_IDS
        physical store identifier
        See Also:
        Constant Field Values
      • PARAMETER_PHYSICAL_STORE_IDS_DESCRIPTION

        public static final java.lang.String PARAMETER_PHYSICAL_STORE_IDS_DESCRIPTION
        physical store identifier description
        See Also:
        Constant Field Values
      • PARAMETER_PHYSICAL_STORE_NAME_DESCRIPTION

        public static final java.lang.String PARAMETER_PHYSICAL_STORE_NAME_DESCRIPTION
        physical store name description
        See Also:
        Constant Field Values
      • PARAMETER_PRODUCT_IDS

        public static final java.lang.String PARAMETER_PRODUCT_IDS
        product identifier
        See Also:
        Constant Field Values
      • PARAMETER_PARTNUMBERS

        public static final java.lang.String PARAMETER_PARTNUMBERS
        See Also:
        Constant Field Values
      • PARAMETER_ORDER_ID

        public static final java.lang.String PARAMETER_ORDER_ID
        order identifier
        See Also:
        Constant Field Values
      • PARAMETER_PRODUCT_IDS_DESCRIPTION

        public static final java.lang.String PARAMETER_PRODUCT_IDS_DESCRIPTION
        product identifier description
        See Also:
        Constant Field Values
      • PARAMETER_PRODUCT_PARTNUMBER_DESCRIPTION

        public static final java.lang.String PARAMETER_PRODUCT_PARTNUMBER_DESCRIPTION
        See Also:
        Constant Field Values
      • PARAMETER_ORDER_ID_DESCRIPTION

        public static final java.lang.String PARAMETER_ORDER_ID_DESCRIPTION
        order identifier description
        See Also:
        Constant Field Values
      • RESOURCE_KEY

        public static final java.lang.String RESOURCE_KEY
        The Constant RESOURCE_KEY.
        See Also:
        Constant Field Values
      • FORMAT_GROUP_NAME

        public static final java.lang.String FORMAT_GROUP_NAME
        The constant FORMAT_GROUP_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • InventoryHandler

        public InventoryHandler()
    • Method Detail

      • getResourceName

        public java.lang.String getResourceName()
        Description copied from interface: IResourceHandler
        This method returns the name of the resource used primarily to determine the representation of the resource. This class can be overridden to change the name of the resource and therefore the representation, while keeping all the methods in this class.
        Returns:
        the resource name
      • getHelper

        public InventoryHelper getHelper()
        Returns the BOD helper associated with the inventory resource. This method can be override to use the extended InventoryHelper for customization.
        Returns:
        InventoryHelper
      • getInventoryAvailabilityByProductId

        @GET
         @Path(value="{productIds}")
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response getInventoryAvailabilityByProductId(@PathParam(value="storeId")
                                                                                                                                                                                                                       java.lang.String storeId,
                                                                                                                                                                                                                       @PathParam(value="productIds")
                                                                                                                                                                                                                       java.lang.String productIds,
                                                                                                                                                                                                                       @QueryParam(value="responseFormat")
                                                                                                                                                                                                                       java.lang.String responseFormat,
                                                                                                                                                                                                                       @QueryParam(value="onlineStoreId")
                                                                                                                                                                                                                       java.lang.String onlineStoreId,
                                                                                                                                                                                                                       @QueryParam(value="physicalStoreId")
                                                                                                                                                                                                                       java.lang.String physicalStoreId)
        This method returns the inventory details for the specified product by it's identifier (Catalog Entry Id). Multiple product Ids can be passed to the URI separated by comma ','.
        Parameters:
        storeId - the store identifier, this is mandatory parameter and cann't be null or empty.
        productIds - the product identifier, this is mandatory parameter and cann't be null or empty.
        responseFormat - the response format (xml, json, or atom).
        onlineStoreId - the online store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        physicalStoreId - the physical store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        Returns:
        The array of inventory details in the specified format.
      • getInventoryAvailabilityByPartNumber

        @GET
         @Path(value="byPartNumber/{partNumbers}")
         @Produces(value={"application/atom+xml","application/json","application/xhtml+xml","application/xml"})
        public javax.ws.rs.core.Response getInventoryAvailabilityByPartNumber(@PathParam(value="storeId")
                                                                                                                                                                                                                                      java.lang.String storeId,
                                                                                                                                                                                                                                      @PathParam(value="partNumbers")
                                                                                                                                                                                                                                      java.lang.String partNumbers,
                                                                                                                                                                                                                                      @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                      java.lang.String responseFormat,
                                                                                                                                                                                                                                      @QueryParam(value="onlineStoreName")
                                                                                                                                                                                                                                      java.lang.String onlineStoreName,
                                                                                                                                                                                                                                      @QueryParam(value="physicalStoreName")
                                                                                                                                                                                                                                      java.lang.String physicalStoreName)
        This method returns the inventory details for the specified product by it's identifier (PartNumber). Multiple PartNumber can be passed to the URI separated by comma ','.
        Parameters:
        storeId - the store identifier, this is mandatory parameter and cann't be null or empty.
        partNumber - the product identifier, this is mandatory parameter and cann't be null or empty.
        responseFormat - the response format (xml, json, or atom).
        onlineStoreName - the online store identifier, this is mandatory parameter and cann't be null or empty.
        physicalStoreName - the physical store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        Returns:
        The array of inventory details in the specified format.
      • renderInventoryAvAilability

        public java.util.Map<java.lang.String,java.lang.Object> renderInventoryAvAilability(java.lang.String productId,
                                                                                            java.lang.String responseFormat,
                                                                                            java.lang.String onlineStoreId,
                                                                                            java.lang.String physicalStoreId,
                                                                                            BusinessContextType businessContext)
        This method builds the response in appropriate format.
        Parameters:
        productId - the product identifier, this is mandatory parameter and cann't be null or empty.
        responseFormat - the response format (xml, json, or atom).
        onlineStoreId - the online store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        physicalStoreId - the physical store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        businessContext - the business context for the user.
        Returns:
        The array of inventory details in the specified format.
      • renderInventoryAvAilabilityByPartNumber

        public java.util.Map<java.lang.String,java.lang.Object> renderInventoryAvAilabilityByPartNumber(java.lang.String partNumber,
                                                                                                        java.lang.String responseFormat,
                                                                                                        java.lang.String onlineStoreName,
                                                                                                        java.lang.String physicalStoreName,
                                                                                                        java.lang.String storeId,
                                                                                                        BusinessContextType businessContext)
        This method builds the response in appropriate format.
        Parameters:
        partNumber - the product identifier, this is mandatory parameter and cann't be null or empty.
        responseFormat - the response format (xml, json, or atom).
        onlineStoreName - the online store name, this is mandatory parameter and cann't be null or empty.
        physicalStoreName - the physical store name, this is optional parameter and store identifier will be used in case this is null or empty.
        businessContext - the business context for the user.
        Returns:
        The array of inventory details in the specified format.
      • postProcess

        public void postProcess(java.util.Map<java.lang.String,java.lang.Object> responseMap)
        Method to provide post process in out of box JSON/XML entity providers after each DataObject has been converted to a Map and before constructing the REST response. By default, it does nothing. Overwrite this method in your resource handler class to perform any post process, for example, merge maps from multiple DataObjects into a single Map.
        Specified by:
        postProcess in interface IResourceHandler
        Overrides:
        postProcess in class AbstractBaseResourceHandler
        Parameters:
        responseMap - The response Map after each DataObject has been converted to a Map.
      • createIntermediary

        public java.util.Map<java.lang.String,java.lang.Object> createIntermediary(commonj.sdo.DataObject dataArea,
                                                                                   java.lang.Exception exception,
                                                                                   java.lang.String resourceType,
                                                                                   java.lang.String urlParamGrpName)
        This method populated the map from the OAGIS BOD.
        Parameters:
        dataArea - the data area
        exception - exception
        resourceType - the resource type
        urlParamGrpName - the url param grp name
        Returns:
        the map
      • getInventoryOverallAvailabilityByOrderId

        @GET
         @Path(value="byOrderId/{orderId}")
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response getInventoryOverallAvailabilityByOrderId(@PathParam(value="storeId")
                                                                                                                                                                                                                                   java.lang.String storeId,
                                                                                                                                                                                                                                   @PathParam(value="orderId")
                                                                                                                                                                                                                                   java.lang.String orderId,
                                                                                                                                                                                                                                   @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                   java.lang.String responseFormat,
                                                                                                                                                                                                                                   @QueryParam(value="onlineStoreId")
                                                                                                                                                                                                                                   java.lang.String onlineStoreId,
                                                                                                                                                                                                                                   @QueryParam(value="physicalStoreId")
                                                                                                                                                                                                                                   java.lang.String physicalStoreId)
        This method returns the inventory details for the specified order by it's identifier (Order Id).
        Parameters:
        storeId - the store identifier, this is mandatory parameter and cann't be null or empty.
        orderId - the order identifier, this is mandatory parameter and cann't be null or empty.
        responseFormat - the response format (xml, json, or atom).
        onlineStoreId - the online store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        physicalStoreId - the physical store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        Returns:
        The array of inventory details in the specified format.
      • mergeMapsForOverallInventoryAvailbility

        public java.util.Map<java.lang.String,java.lang.Object> mergeMapsForOverallInventoryAvailbility(java.util.Map<java.lang.String,java.lang.Object> map1,
                                                                                                        java.util.Map<java.lang.String,java.lang.Object> map2)
        Merge map1 and map2 for providers.
        Parameters:
        map1 - first map
        map2 - second map
        Returns:
        merged map of map1 and map2.
      • renderInventoryOverallAilability

        public java.util.Map<java.lang.String,java.lang.Object> renderInventoryOverallAilability(java.lang.String storeId,
                                                                                                 java.lang.String orderId,
                                                                                                 java.lang.String responseFormat,
                                                                                                 java.lang.String onlineStoreId,
                                                                                                 java.lang.String physicalStoreId,
                                                                                                 BusinessContextType businessContext)
        This method builds the response in appropriate format.
        Parameters:
        orderId - the order identifier, this is mandatory parameter and cann't be null or empty.
        responseFormat - the response format (xml, json, or atom).
        onlineStoreId - the online store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        physicalStoreId - the physical store identifier, this is optional parameter and store identifier will be used in case this is null or empty.
        businessContext - the business context for the user.
        Returns:
        The array of inventory details in the specified format.