Class PVCChangeDeviceCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, PVCChangeDeviceCmd, Protectable,,,,,,

    public class PVCChangeDeviceCmdImpl
    extends ControllerCommandImpl
    implements PVCChangeDeviceCmd
    Cancel existing relationship between a user and a pervasive computing (PvC) device in the PVCBINDING table. This command is required when the registrationMode parameter in the XML configuration file is set to 2. If a user has a record in the PVCBINDING table, they cannot use any devices for logon other than those registered in the PVCBINDING table. To change a device used for Logon, the user needs to executes PVCCahngeDevice command.


    1. Makes sure that registrationMode is 2. If registrationMode is not 2 , the command does nothing.
    2. Checks logon status of the user.
    3. Checks mandatory parameters.
    4. Executes VerifyCredentials to make sure validity of user ID and password. If a user of specified ID and parameter is not registered throws an Exception.
    5. Checks if the device executing the command is not already registered in PVCBINDING. If already registered throws Exception.
    6. Changes STATUS of an old record in PVCBINDING to 'S'
    7. Creates a new record in PVCBINDING with STATUS 'A'.
    8. Registers a new PVC device to USERPVCDEV table
    9. Sends redirect instruction to specified URL
    See Also:
    Serialized Form
    • Field Detail


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

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

      • PVCChangeDeviceCmdImpl

        public PVCChangeDeviceCmdImpl()
    • Method Detail

      • getAddress1

        public java.lang.String getAddress1()
        Get the address 1.
        The address 1.
      • getAddress2

        public java.lang.String getAddress2()
        Get the address 2.
        The address 2.
      • getAddrType1

        public java.lang.String getAddrType1()
        Get the address type 1.
        The address type 1.
      • getAddrType2

        public java.lang.String getAddrType2()
        Get the address type 2.
        The address type 2.
      • getDeviceFmtId

        public java.lang.Integer getDeviceFmtId()
        Get the device format ID
        The device format ID.
      • getLogonId

        public java.lang.String getLogonId()
        Get the logon ID.
        The logon ID.
      • getPassword

        public java.lang.String getPassword()
        Get the password.
        The password.
      • getPreferredTimeout

        public java.lang.Integer getPreferredTimeout()
        Get the preferred timeout value.
        The preferred timeout value.
      • getProtect

        public java.lang.Integer getProtect()
        Get the protect.
        The protect.
      • getPvcRegMode

        public java.lang.String getPvcRegMode()
        Get the PvC registration mode.
        The PvC registration mode.
      • getPVCSessionId

        public java.lang.Long getPVCSessionId()
        Get the PVC session ID
        The PVC session ID.
      • getURL

        public java.lang.String getURL()
        Get the redirect URL for this command.
        The redirect URL.
      • isGeneric

        public boolean isGeneric()
        Checks 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
        isGeneric in class ControllerCommandImpl
        Always false.
      • setAddress1

        public void setAddress1(java.lang.String newAddress1)
        Sets the address 1.
        Specified by:
        setAddress1 in interface PVCChangeDeviceCmd
        newAddress1 - The address 1.
      • setAddress2

        public void setAddress2(java.lang.String newAddress2)
        Sets the address 2.
        Specified by:
        setAddress2 in interface PVCChangeDeviceCmd
        newAddress2 - The address 2.
      • setAddrType1

        public void setAddrType1(java.lang.String newAddrType1)
        Sets the address type 1.
        Specified by:
        setAddrType1 in interface PVCChangeDeviceCmd
        newAddrType1 - The address type 1.
      • setAddrType2

        public void setAddrType2(java.lang.String newAddrType2)
        Sets the address type 2.
        Specified by:
        setAddrType2 in interface PVCChangeDeviceCmd
        newAddrType2 - The address type 2.
      • setDeviceFmtId

        public void setDeviceFmtId(java.lang.Integer newDeviceFmtId)
        Sets the device format ID.
        newDeviceFmtId - The device format ID.
      • setLogonId

        public void setLogonId(java.lang.String newLogonId)
        Sets the logon ID.
        newLogonId - The logon ID.
      • setPassword

        public void setPassword(java.lang.String newPassword)
        Sets the password.
        Specified by:
        setPassword in interface PVCChangeDeviceCmd
        newPassword - The password.
      • setPreferredTimeout

        public void setPreferredTimeout(java.lang.Integer newPreferredTimeout)
        Sets the preferred timeout value.
        Specified by:
        setPreferredTimeout in interface PVCChangeDeviceCmd
        newPreferredTimeout - The preferred timeout value.
      • setProtect

        public void setProtect(java.lang.Integer newProtect)
        Sets the protect.
        Specified by:
        setProtect in interface PVCChangeDeviceCmd
        newProtect - The protect.
      • setPvcRegMode

        public void setPvcRegMode(java.lang.String newPvcRegMode)
        Sets the PvC registration mode.
        Specified by:
        setPvcRegMode in interface PVCChangeDeviceCmd
        newPvcRegMode - The PvC registration mode.
      • setPVCSessionId

        public void setPVCSessionId(java.lang.Long newPVCSessionId)
        Sets the PvC session ID.
        Specified by:
        setPVCSessionId in interface PVCChangeDeviceCmd
        newPVCSessionId - The PvC session ID.
      • setURL

        public void setURL(java.lang.String newURL)
        Sets the redirect URL for this command.
        Specified by:
        setURL in interface PVCChangeDeviceCmd
        newURL - The redirect URL.
      • setUserId

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

        public void validateParameters()
                                throws ECException
        Checks the parameters for this command. The WebController calls the validateParameters method before invoking the execute method in this command.

        This method checks the following in the list. If an error occured, throws exception.

        1. If registrationMode of the configuration XML is 0(browser) or 1(multi mode), do nothing.
        2. Check to exist logonId and password parameters.
        3. Check to exist devaddress1, devaddrtype1,devaddress2 and devaddrtype2.

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