com.ibm.commerce.pvc.commands

Class PVCBufferUrlCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, PVCBufferUrlCmd, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class PVCBufferUrlCmdImpl
    extends ControllerCommandImpl
    implements PVCBufferUrlCmd
    Buffers parameters in the request and executes target command with buffered parameters. This command is provided for cellular phones which have limitation in length of HTTP request header. The command enables to input long value of parameters by buffering parameters in database.

    Behaviour

    1. Checks parameters and changes succeeding process
    2. If parameter b_new is specified:
      1. Creates a new record in PVCBUFFER table and redirects to specified URL
      2. Redirects to the URL specified by b_new
    3. If parameter b_update is specified:
      1. Checks expiration of buffered parameters
      2. Merge parameters in request with parameters in database and stores merged parameter to the database
      3. Redirects to the URL specified by b_update
    4. If parameter b_exec is specified:
      1. Checks expiration of buffered parameters
      2. Merge parameters in request with parameters in database and stores merged parameter to the database
      3. Add buffered parameters to the target command and executes target command.

    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String ERRTASK_NAME
        The viewname called when an error occurs.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PVCBufferUrlCmdImpl

        public PVCBufferUrlCmdImpl()
    • Method Detail

      • buildParameters

        public java.lang.String buildParameters(java.lang.String bufParams,
                                                java.lang.String inParams)
        Merges parameters stored in PVCBUFFER.PARAMETERS2K and parameters sent to the command. Parameters in inParams and not in bufParams will be appended. Parameters in bufParams will be over written with parameters in inParams.
        Parameters:
        bufParams - Buffered parameters in PVCBUFFER.PARAMETER2K
        inParams - Parameters sent to the command
        Returns:
        Merged parameter string.
      • changeReqPropToString

        public java.lang.String changeReqPropToString(TypedProperty reqProp)
        Convert name and value pairs in TypedProperty object to string format.
        Parameters:
        Name - and value pairs
        Returns:
        URL encoded parameter string
      • changeStringToReqProp

        public TypedProperty changeStringToReqProp(java.lang.String strParm)
        Convert parameter string to TypedProperty object.
        Parameters:
        strParam - URL encoded parameter string
        Returns:
        Name and value pairs in TypedProperty object.
      • checkTimeout

        public boolean checkTimeout(java.sql.Timestamp now,
                                    java.sql.Timestamp create)
        Check if data in buffer has expired.
        Parameters:
        now - Current timestamp
        create - Creation date of the record in PVCBUFFER table, value of PVCBUFFER.CREATED
        Returns:
        true: expired; false: not expired
      • getAdapter

        public PVCAdapter getAdapter()
        Get PVC adapter set in command context.
        Returns:
        PVC adapter used for current session.
      • getB_exec

        public java.lang.String getB_exec()
        Get the value of the b_exec parameter.
        Returns:
        The value of the b_exec parameter.
      • getB_new

        public java.lang.String getB_new()
        Get the value of the b_new parameter.
        Returns:
        The value of the b_new parameter.
      • getB_update

        public java.lang.String getB_update()
        Get the value of the b_update parameter.
        Returns:
        The value of the b_update parameter.
      • getErrUrl

        public java.lang.String getErrUrl()
        Get the redirect view name, if an error occurs while processing this command.
        Returns:
        The redirect view name.
      • getNo

        public java.lang.String getNo()
        Get the string of b_no parameter value.
        Returns:
        The string of b_no parameter value.
      • getNoArray

        public java.lang.String[] getNoArray()
        Get the string array of the b_no parameters string.
        Returns:
        The string array of the b_no parameters string.
      • getParameters

        public java.lang.String getParameters()
        Set the parameters string. This string is the parameters while processing this command.
        Returns:
        The parameters string.
      • getPostUrl

        public java.lang.String getPostUrl()
        Get the redirect URL of this command.
        Returns:
        The redirect URL of this command.
      • getTimeout

        public long getTimeout()
        Get the buffer timeout value.
        Returns:
        The buffer timeout value.
      • getUrl

        public java.lang.String getUrl()
        Get the URL of the target command.
        Returns:
        The URL of the target command.
      • isGeneric

        public boolean isGeneric()
        Check to see if this is a generic command. A generic command is a command that can be invoked by a generic user. The default is false for all controller commands and true for all view commands.
        Specified by:
        isGeneric in interface ControllerCommand
        Overrides:
        isGeneric in class ControllerCommandImpl
        Returns:
        Always false.
      • setAdapter

        public void setAdapter(PVCAdapter newAdapter)
        Set the PVC adapter object.
        Parameters:
        newAdapter - The PVC adapter object.
      • setB_exec

        public void setB_exec(java.lang.String newB_exec)
        Set the value of the b_exec parameter.
        Specified by:
        setB_exec in interface PVCBufferUrlCmd
        Parameters:
        newB_exec - The value of the b_exec parameter.
      • setB_new

        public void setB_new(java.lang.String newB_new)
        Set the value of the b_new parameter.
        Specified by:
        setB_new in interface PVCBufferUrlCmd
        Parameters:
        newB_new - The value of the b_new parameter.
      • setB_update

        public void setB_update(java.lang.String newB_update)
        Set the value of the b_update parameter.
        Specified by:
        setB_update in interface PVCBufferUrlCmd
        Parameters:
        newB_update - The value of the b_update parameter.
      • setErrUrl

        public void setErrUrl(java.lang.String newErrUrl)
        Set the redirect view name. if an error occurs while processing this command, redirect this URL.
        Specified by:
        setErrUrl in interface PVCBufferUrlCmd
        Parameters:
        newErrUrl - The redirect view name.
      • setNo

        public void setNo(java.lang.String newNo)
        Set the string of b_no parameter value.
        Parameters:
        newNo - The string of b_no parameter value.
      • setParameters

        public void setParameters(java.lang.String newParameters)
        Set the parameters string. This string is the parameters while processing this command.
        Specified by:
        setParameters in interface PVCBufferUrlCmd
        Parameters:
        newParameters - The parameters string.
      • setPostUrl

        public void setPostUrl(java.lang.String newPostUrl)
        Set the redirect URL of this command.
        Parameters:
        newPointUrl - The redirect URL of this command.
      • setTimeout

        public void setTimeout(long newTimeout)
        Set the buffer timeout value.
        Specified by:
        setTimeout in interface PVCBufferUrlCmd
        Parameters:
        newTimeout - The buffer timeout value.
      • setUrl

        public void setUrl(java.lang.String newUrl)
        Set the redirect URL of the targetale command.
        Specified by:
        setUrl in interface PVCBufferUrlCmd
        Parameters:
        newUrl - The target redirect URL.
      • setUserId

        public void setUserId(java.lang.Long newUserId)
        Set the user ID.
        Specified by:
        setUserId in interface PVCBufferUrlCmd
        Parameters:
        newUserId - The user ID.
      • validateParameters

        public void validateParameters()
                                throws ECException
        Check validity of parameters sent to this command. The WebController calls the validateParameters method before invoking the execute method in this command.

        This method does following checks. If an error occurs the method throws ECException.

        1. Check to exist the b_new, b_update or b_exec parameter
        2. If the b_new, check to exist the b_url and b_err parameter.
        3. If the b_update, check to exist the b_err parameter.
        4. If the b_exec, check to exist the b_err parameter.

        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECException - If an error occurs while processing this method