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 structurestruct 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 };
-
-
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 structuresint
getAuthenticationType()
Get authentication type.java.lang.String
getCspPassword()
Get the password used in authenticationjava.lang.String
getCspUserId()
Get the user ID used in authenticationint
getCurrentVersion()
java.lang.String
getInitialKey()
Get the initial key for the password protection systemint
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 structurestatic int
getSize(com.ibm.mq.jmqi.JmqiEnvironment env, int version, int ptrSize)
The byte size of the fixed part of the structurestatic int
getSizeV1(int ptrSize)
Get the size of version of MQCSPstatic int
getSizeV2(int ptrSize)
Get field size of version 2 of MQCSPstatic int
getSizeV3(int ptrSize)
Get the size of version 3 of MQCSPjava.lang.String
getToken()
Get the authentication token that is used for authentication with the queue managerint
getVersion()
Get the version of MQCSPint
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 authenticationvoid
setCspUserId(java.lang.String cspUserId)
Set the user ID to be used in authenticationvoid
setInitialKey(java.lang.String initialKey)
Set the initial key for the password protection systemvoid
setToken(java.lang.String token)
Set the authentication token that is used for authentication with the queue managervoid
setVersion(int version)
Set MQCSP versionvoid
validate()
Validates the contents of MQCSPint
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)
-
-
-
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 interfacecom.ibm.mq.jmqi.internal.MqiStructure
- Overrides:
getCurrentVersion
in classcom.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 interfacecom.ibm.mq.jmqi.internal.MqiStructure
- Overrides:
getSize
in classcom.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 classversion
- 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 interfacecom.ibm.mq.jmqi.internal.MqiStructure
- Parameters:
ptrSize
- The number of bytes to write for each pointer in the structurecp
- 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 classjava.lang.Object
- Returns:
- A copy of the MQCSP object
- Throws:
java.lang.CloneNotSupportedException
- exception
-
hashCode
public int hashCode()
Generate a hashcode.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashcode for this instance.
-
equals
public boolean equals(java.lang.Object object)
Compare two MQCSP structures- Overrides:
equals
in classjava.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 interfacecom.ibm.mq.jmqi.internal.MqiStructure
- Overrides:
getVersion
in classcom.ibm.mq.jmqi.internal.AbstractMqiStructure
- Returns:
- version of MQCSP
-
setVersion
public void setVersion(int version)
Set MQCSP version- Specified by:
setVersion
in interfacecom.ibm.mq.jmqi.internal.MqiStructure
- Overrides:
setVersion
in classcom.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 interfacecom.ibm.mq.jmqi.internal.MqiStructure
- Overrides:
writeToTraceBuffer
in classcom.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 interfacecom.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 interfacecom.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 interfacecom.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.
-
-