com.ibm.mq.exits

Class MQCSP

  • java.lang.Object
    • com.ibm.mq.jmqi.JmqiObject
      • com.ibm.mq.jmqi.internal.AbstractMqiStructure
        • com.ibm.mq.exits.MQCSP
  • All Implemented Interfaces:
    com.ibm.mq.jmqi.internal.MqiStructure, java.lang.Cloneable


    public class MQCSP
    extends com.ibm.mq.jmqi.internal.AbstractMqiStructure
    implements java.lang.Cloneable
    MQCSP structure struct tagMQCSP { MQCHAR4 StrucId; MQLONG Version; MQLONG AuthenticationType; MQBYTE4 Reserved1; MQPTR CSPUserIdPtr; MQLONG CSPUserIdOffset; MQLONG CSPUserIdLength; MQBYTE8 Reserved2; MQPTR CSPPasswordPtr; MQLONG CSPPasswordOffset; MQLONG CSPPasswordLength; MQBYTE8 Reserved3; MQPTR InitialKeyPtr MQLONG InitialKeyOffset MQLONG InitialKeyLength MQBYTE8 Reserved4; MQPTR TokenPtr MQLONG TokenOffset MQLONG TokenLength };
    • Field Summary

      • Fields inherited from class com.ibm.mq.jmqi.JmqiObject

        COMP_JM, COMP_JN, COMP_JO
      • Fields inherited from interface com.ibm.mq.jmqi.internal.MqiStructure

        sccsid
    • Constructor Summary

      Constructors 
      Constructor and Description
      MQCSP(com.ibm.mq.jmqi.JmqiEnvironment env)
      Make a new MQCSP object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addFieldsToFormatter(com.ibm.mq.jmqi.internal.JmqiStructureFormatter fmt)
      Template method to populate a structure formatter with field definitions.
      java.lang.Object clone()
      Clone this MQCSP.
      boolean equals(java.lang.Object object)
      Compare two MQCSP structures
      int getAuthenticationType()
      Get authentication type.
      java.lang.String getCspPassword()
      Get the password used in authentication
      java.lang.String getCspUserId()
      Get the user ID used in authentication
      int getCurrentVersion() 
      java.lang.String getInitialKey()
      Get the initial key for the password protection system
      int getRequiredBufferSize(int ptrSize, com.ibm.mq.jmqi.system.JmqiCodepage cp)
      Get the required buffer size for the data in this structure.
      int getSize(int ptrSize)
      The byte size of the structure
      static int getSize(com.ibm.mq.jmqi.JmqiEnvironment env, int version, int ptrSize)
      The byte size of the fixed part of the structure
      static int getSizeV1(int ptrSize)
      Get the size of version of MQCSP
      static int getSizeV2(int ptrSize)
      Get field size of version 2 of MQCSP
      static int getSizeV3(int ptrSize)
      Get the size of version 3 of MQCSP
      java.lang.String getToken()
      Get the authentication token that is used for authentication with the queue manager
      int getVersion()
      Get the version of MQCSP
      int hashCode()
      Generate a hashcode.
      int readFromBuffer(byte[] buffer, int offset, int ptrSize, boolean swap, com.ibm.mq.jmqi.system.JmqiCodepage cp, com.ibm.mq.jmqi.system.JmqiTls tls) 
      void setAuthenticationType(int authenticationType)
      Set authentication type.
      void setCspPassword(java.lang.String cspPassword)
      Set password to be used in authentication
      void setCspUserId(java.lang.String cspUserId)
      Set the user ID to be used in authentication
      void setInitialKey(java.lang.String initialKey)
      Set the initial key for the password protection system
      void setToken(java.lang.String token)
      Set the authentication token that is used for authentication with the queue manager
      void setVersion(int version)
      Set MQCSP version
      void validate()
      Validates the contents of MQCSP
      int writeToBuffer(byte[] buffer, int offset, int ptrSize, boolean swap, com.ibm.mq.jmqi.system.JmqiCodepage cp, com.ibm.mq.jmqi.system.JmqiTls tls) 
      int writeToTraceBuffer(byte[] buffer, int pos, int ptrSize, boolean swap, com.ibm.mq.jmqi.system.JmqiCodepage cp, com.ibm.mq.jmqi.system.JmqiTls tls) 
      • Methods inherited from class com.ibm.mq.jmqi.internal.AbstractMqiStructure

        getFirstVersion, getMaximumRequiredBufferSize, getRequiredInputBufferSize, readFromBuffer, setupForTest, toString, toStringMultiLine, toTraceString, writeToBuffer
      • Methods inherited from class com.ibm.mq.jmqi.JmqiObject

        getJmqiEnvironment
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MQCSP

        public MQCSP(com.ibm.mq.jmqi.JmqiEnvironment env)
        Make a new MQCSP object
        Parameters:
        env - An instance of JmqiEnvironment class
    • Method Detail

      • getCurrentVersion

        public int getCurrentVersion()
        Specified by:
        getCurrentVersion in interface com.ibm.mq.jmqi.internal.MqiStructure
        Overrides:
        getCurrentVersion in class com.ibm.mq.jmqi.internal.AbstractMqiStructure
        Returns:
        the current version of MQCSP
      • getSizeV1

        public static int getSizeV1(int ptrSize)
        Get the size of version of MQCSP
        Parameters:
        ptrSize - The number of bytes to write for each pointer in the structure
        Returns:
        The size of the Version 1 fields, including the end-of-structure alignment
      • getSizeV2

        public static int getSizeV2(int ptrSize)
        Get field size of version 2 of MQCSP
        Parameters:
        ptrSize - The number of bytes to write for each pointer in the structure
        Returns:
        The size of the Version 2 fields, including the end-of-structure alignment
      • getSizeV3

        public static int getSizeV3(int ptrSize)
        Get the size of version 3 of MQCSP
        Parameters:
        ptrSize - The number of bytes to write for each pointer in the structure
        Returns:
        The size of the Version 3 fields, including the end-of-structure alignment
      • getSize

        public int getSize(int ptrSize)
                    throws JmqiException
        The byte size of the structure
        Specified by:
        getSize in interface com.ibm.mq.jmqi.internal.MqiStructure
        Overrides:
        getSize in class com.ibm.mq.jmqi.internal.AbstractMqiStructure
        Parameters:
        ptrSize - The number of bytes to write for each pointer in the structure
        Returns:
        The byte size of the MQCSP structure
        Throws:
        JmqiException - in case of any error
      • getSize

        public static int getSize(com.ibm.mq.jmqi.JmqiEnvironment env,
                                  int version,
                                  int ptrSize)
                           throws JmqiException
        The byte size of the fixed part of the structure
        Parameters:
        env - An instance of JmqiEnvironment class
        version - of MQCSP.
        ptrSize - The number of bytes to write for each pointer in the structure
        Returns:
        The byte size of the structure in the specified environment
        Throws:
        JmqiException - in case of any error
      • getRequiredBufferSize

        public int getRequiredBufferSize(int ptrSize,
                                         com.ibm.mq.jmqi.system.JmqiCodepage cp)
                                  throws JmqiException
        Get the required buffer size for the data in this structure.
        Specified by:
        getRequiredBufferSize in interface com.ibm.mq.jmqi.internal.MqiStructure
        Parameters:
        ptrSize - The number of bytes to write for each pointer in the structure
        cp - JmqiCodepage
        Returns:
        required buffer size
        Throws:
        JmqiException - in case of any error
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Clone this MQCSP.
        Overrides:
        clone in class java.lang.Object
        Returns:
        A copy of the MQCSP object
        Throws:
        java.lang.CloneNotSupportedException - exception
      • hashCode

        public int hashCode()
        Generate a hashcode.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashcode for this instance.
      • equals

        public boolean equals(java.lang.Object object)
        Compare two MQCSP structures
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - of type MQCSP
        Returns:
        'true' if the object are equal
      • getVersion

        public int getVersion()
        Get the version of MQCSP
        Specified by:
        getVersion in interface com.ibm.mq.jmqi.internal.MqiStructure
        Overrides:
        getVersion in class com.ibm.mq.jmqi.internal.AbstractMqiStructure
        Returns:
        version of MQCSP
      • setVersion

        public void setVersion(int version)
        Set MQCSP version
        Specified by:
        setVersion in interface com.ibm.mq.jmqi.internal.MqiStructure
        Overrides:
        setVersion in class com.ibm.mq.jmqi.internal.AbstractMqiStructure
        Parameters:
        version - of MQCSP
      • getAuthenticationType

        public int getAuthenticationType()
        Get authentication type. Defines type of authentication to perform Valid values are MQCSP_AUTH_NONE, MQCSP_AUTH_USER_ID_AND_PWD and MQCSP_AUTH_ID_TOKEN
        Returns:
        authenticationType set in MQCSP
      • setAuthenticationType

        public void setAuthenticationType(int authenticationType)
        Set authentication type. Defines type of authentication to perform Valid values are MQCSP_AUTH_NONE, MQCSP_AUTH_USER_ID_AND_PWD and MQCSP_AUTH_ID_TOKEN
        Parameters:
        authenticationType - for MQCSP
      • getCspUserId

        public java.lang.String getCspUserId()
        Get the user ID used in authentication
        Returns:
        the cspUserId
      • setCspUserId

        public void setCspUserId(java.lang.String cspUserId)
        Set the user ID to be used in authentication
        Parameters:
        cspUserId - to MQCSP instance
      • getCspPassword

        public java.lang.String getCspPassword()
        Get the password used in authentication
        Returns:
        the cspPassword
      • setCspPassword

        public void setCspPassword(java.lang.String cspPassword)
        Set password to be used in authentication
        Parameters:
        cspPassword - password for authentication
      • getInitialKey

        public java.lang.String getInitialKey()
        Get the initial key for the password protection system
        Returns:
        the initialKey
      • setInitialKey

        public void setInitialKey(java.lang.String initialKey)
        Set the initial key for the password protection system
        Parameters:
        initialKey - for password protection
      • getToken

        public java.lang.String getToken()
        Get the authentication token that is used for authentication with the queue manager
        Returns:
        the token
      • setToken

        public void setToken(java.lang.String token)
        Set the authentication token that is used for authentication with the queue manager
        Parameters:
        token - for authentication
      • writeToTraceBuffer

        public int writeToTraceBuffer(byte[] buffer,
                                      int pos,
                                      int ptrSize,
                                      boolean swap,
                                      com.ibm.mq.jmqi.system.JmqiCodepage cp,
                                      com.ibm.mq.jmqi.system.JmqiTls tls)
                               throws JmqiException
        Specified by:
        writeToTraceBuffer in interface com.ibm.mq.jmqi.internal.MqiStructure
        Overrides:
        writeToTraceBuffer in class com.ibm.mq.jmqi.internal.AbstractMqiStructure
        Throws:
        JmqiException
        See Also:
        MqiStructure.writeToTraceBuffer(byte[], int, int, boolean, JmqiCodepage, JmqiTls)
      • writeToBuffer

        public int writeToBuffer(byte[] buffer,
                                 int offset,
                                 int ptrSize,
                                 boolean swap,
                                 com.ibm.mq.jmqi.system.JmqiCodepage cp,
                                 com.ibm.mq.jmqi.system.JmqiTls tls)
                          throws JmqiException
        Specified by:
        writeToBuffer in interface com.ibm.mq.jmqi.internal.MqiStructure
        Throws:
        JmqiException
        See Also:
        MqiStructure.writeToBuffer(byte[], int, int, boolean, JmqiCodepage, JmqiTls)
      • readFromBuffer

        public int readFromBuffer(byte[] buffer,
                                  int offset,
                                  int ptrSize,
                                  boolean swap,
                                  com.ibm.mq.jmqi.system.JmqiCodepage cp,
                                  com.ibm.mq.jmqi.system.JmqiTls tls)
                           throws JmqiException
        Specified by:
        readFromBuffer in interface com.ibm.mq.jmqi.internal.MqiStructure
        Throws:
        JmqiException
        See Also:
        MqiStructure.readFromBuffer(byte[], int, int, boolean, JmqiCodepage, JmqiTls)
      • addFieldsToFormatter

        public void addFieldsToFormatter(com.ibm.mq.jmqi.internal.JmqiStructureFormatter fmt)
        Template method to populate a structure formatter with field definitions. This method is used in the "toString()" method
        Specified by:
        addFieldsToFormatter in interface com.ibm.mq.jmqi.internal.MqiStructure
        Parameters:
        fmt - The structure formatter
      • validate

        public void validate()
                      throws JmqiException
        Validates the contents of MQCSP
        Throws:
        JmqiException - if validation fails.
(c) Copyright IBM Corp. 2008, 2016. All Rights Reserved.