com.ibm.commerce.rest.member.handler

Class UserContextHandler

    • 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
      • FORMAT_GROUP_NAME

        public static final java.lang.String FORMAT_GROUP_NAME
        Deprecated. Replaced by UserContextHandler.
        The constant FORMAT_GROUP_NAME. Replaced by UserContextHandler.getFormattingGroupName()
        See Also:
        Constant Field Values
      • GLOBALIZATION_CONTEXT

        public static final java.lang.String GLOBALIZATION_CONTEXT
        See Also:
        Constant Field Values
      • CONTENT_SPLIT_TOKEN

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

      • UserContextHandler

        public UserContextHandler()
    • 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
      • getPersonalizationID

        @GET
         @Path(value="personalizationId")
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response getPersonalizationID(@PathParam(value="storeId")
                                                                                                                                                                                                             java.lang.String storeId,
                                                                                                                                                                                                             @QueryParam(value="responseFormat")
                                                                                                                                                                                                             java.lang.String responseFormat)
        This method returns personalization id. If WCToken is passed in HTTP header, it returns personalization ID based on WCToken. Otherwise, it returns a personalization ID for a generic user.
        Parameters:
        storeId - the store id
        responseFormat - the response format
        Returns:
        the personalization id
      • getContextData

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="@self/contextdata")
        public javax.ws.rs.core.Response getContextData(@PathParam(value="storeId")
                                                                                                                                                                                                       java.lang.String storeId,
                                                                                                                                                                                                       @QueryParam(value="responseFormat")
                                                                                                                                                                                                       java.lang.String responseFormat)
        This method returns the context data for a user from the tokens and cookies sent with the request.
        Parameters:
        storeId - the store id
        responseFormat - the response format
        Returns:
        the context data map for the current user
      • getContextDataMap

        public java.util.Map getContextDataMap(java.lang.String storeId,
                                               java.lang.Long userId)
                                        throws QueryServiceApplicationException,
                                               java.sql.SQLException,
                                               java.lang.NumberFormatException,
                                               BusinessContextServiceException,
                                               java.io.IOException,
                                               javax.security.auth.callback.UnsupportedCallbackException
        Gets the context data from the tokens and cookies for this request.
        Parameters:
        storeId - The current store Id
        userId - The user Id obtained from the cookies and tokens
        Returns:
        The context data map associated with the tokens and cookies for this request.
        Throws:
        QueryServiceApplicationException - If a query fails.
        java.sql.SQLException - If a database query fails.
        java.lang.NumberFormatException - If parsing fails.
        BusinessContextServiceException - If the request fails.
        java.io.IOException - If reading the activity token fails.
        javax.security.auth.callback.UnsupportedCallbackException - If reading the activity token fails.