com.ibm.commerce.location.facade.client

Class LocationFacadeClientExtended

    • Field Detail

      • CREATE_ACTION_CODE

        public static final java.lang.String CREATE_ACTION_CODE
        The create action code.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LocationFacadeClientExtended

        public LocationFacadeClientExtended()
        Creates an instance of the client to communicate with the Location facade.
      • LocationFacadeClientExtended

        public LocationFacadeClientExtended(BusinessContextType businessContext,
                                            javax.security.auth.callback.CallbackHandler callbackHandler)
        Creates an instance of the client to communicate with the Location facade.
        Parameters:
        businessContext - The default business context to associate with the messages when making requests.
        callbackHandler - Used for authentication purposes so the controller can give the authentication information to the transport when required.
    • Method Detail

      • getPointsOfInterestByProximity

        public ShowPointOfInterestDataAreaType getPointsOfInterestByProximity(java.lang.String storeId,
                                                                              java.lang.String poiType,
                                                                              double latitude,
                                                                              double longitude,
                                                                              double radius,
                                                                              java.lang.String dataLanguageIds,
                                                                              java.lang.String accessProfile)
                                                                       throws PointOfInterestException
        This method returns a list of all PointOfInterestType data objects which are associated with a given store ID and have a give type ("poiType"), which are within a given radius of a given reference point, expressed as (latitude,longitude) pair.

        This form of the method returns a ShowPointOfInterestDataAreaType data object -- callers can retrieve the matching PointOfInterestType nouns by calling the getPointOfInterest() method to extract a list containing the matching PointOfInterestType data objects.

        Parameters:
        storeId - Identifier of the store across which all points of interest are searched.

        poiType - Type ("poiType") of the points of interest to be returned, e.g. "store" -- if this value is null, points of interest of any type are considered.

        latitude - The latitude of the reference point, expressed in degrees.

        longitude - The longitude of the reference point, expressed in degrees.

        radius - The radius within which PointOfInterestType nouns should be searched, expressed in meters (e.g. "within 5000 m") -- if this value is zero or less, the nearest point of interest is returned, regardless of its distance to the reference point.

        dataLanguageIds - Comma seperated list of language IDs indicating the language(s) for which the PointOfInterestDescriptionType children of the Description member of each returned PointOfInterestType data object are to be populated.

        accessProfile - The access profile (e.g. "IBM_All")
        Returns:
        A ShowPointOfInterestDataAreaType data object -- callers may invoke the getPointOfInterest() method to extract a list containing the matching PointOfInterestType data objects.

        Throws:
        PointOfInterestException - The PointOfInterestException is thrown if error information is found in the specified ShowPointOfInterestDataArea -- this will represent that there was a problem when performing the operation.

      • getPointsOfInterestByProximity

        public java.util.List getPointsOfInterestByProximity(java.util.Map<java.lang.String,java.lang.String[]> parameters)
                                                      throws PointOfInterestException
        Convenience method for retrieving PointOfInterest nouns given a parameter map.
        Parameters:
        parameters - Map of parameters. The following parameters are valid:
        • storeId (required)
        • poiType (required)
        • latitude (required)
        • longitude (required)
        • radius
        • dataLanguageIds
        • accessProfile
        Note that although all parameters are passed in as Strings, latitude, longitude, and radius will be converted to Doubles (or an exception will be thrown if they cannot be converted).
        Returns:
        A ShowPointOfInterestDataAreaType data object -- callers may invoke the getPointOfInterest() method to extract a list containing the matching PointOfInterestType data objects.

        Throws:
        PointOfInterestException - The PointOfInterestException is thrown if error information is found in the specified ShowPointOfInterestDataArea. This will represent that there was a problem when performing the operation.
      • buildExpressionWithGeolocation

        public ExpressionType buildExpressionWithGeolocation(java.util.Map parameters)
        This method creates a SelectionCriteriaHelper object with the provided XPath expression and access profile. This method can be overridden to add additional control parameters to the expression.
        Parameters:
        parameters - A map contains the parameter to build the expression. The following sample code demonstrates how to use the API:
                    Map parameters = new HashMap();
                    parameters.put("storeId", new String[] { "10101" });
                    parameters.put("poiType", new String[] { "Store" });
                    parameters.put("latitude", new String[] { "43.67300"});
              parameters.put("longitude", new String[] { "-79.55400"});
              parameters.put("radius", new String[] { "8000"});
         
        Returns:
        the ExpressionType with the provided XPath expression and access profile.
      • createClientLocation

        public java.util.Map createClientLocation(java.util.Map parameters)
                                           throws ClientLocationException
        Creates a client location based on the input parameters
        Parameters:
        parameters - The map of String [] corresponding to the input parameters. By default there are no input parameters.
        Returns:
        A map of String [] that contains the following response parameters: clientLocationId
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("programId", new String[] { "test" });
                        parameters.put("status", new String[] { "shopping");
                        parameters.put("clientType", new String[] { "user" });
                        parameters.put("clientId", new String[] { "10001" });
              parameters.put("personalizationId", new String[] { "1234567890-1" });
                        parameters.put("sourceType", new String[] { "RFID_sensor");
                        parameters.put("regionId", new String[] { "Canada" });
                        parameters.put("zoneId", new String[] { "Safeway.1951" });
                        parameters.put("latitude", new String[] { "43.67300"});
              parameters.put("longitude", new String[] { "-79.55400"});
         
                    Map response = client.createClientLocation(parameters);
                        String[] clientLocationId = (String[]) response.get("clientLocationId");
         
        Throws:
        ClientLocationException