Skip to main content

Overview of Customer Data Interface

What is Customer Data Interface

The Customer Data Interface in the CICS Bank Sample Application (CBSA) is represented by the Crecust class. This class is responsible for handling customer data within the application. It includes fields for various customer attributes such as name, address, date of birth, and credit score.

The Crecust class uses a CobolDatatypeFactory to manage COBOL data types and handle the byte buffer that stores the customer data. This allows for efficient storage and retrieval of customer information.


Usage of Crecust in CreditScoreCICS540

The Crecust class is instantiated and the customer address is set using the setCommAddress method.

				CRECUST myCRECUST = new CRECUST();
myCRECUST.setCommAddress(customer.getCustomerAddress());

Main Functions

The Crecust class provides several main functions to interact with customer data. These include getCommName, setCommName, getCommAddress, and setCommAddress. Each function is designed to retrieve or set specific customer attributes within the byte buffer.


getCommName

The getCommName function retrieves the customer's name from the byte buffer. If the name is not already cached, it extracts the name from the buffer and caches it for future use.

	public String getCommName() {
if (commName == null) {
commName = COMM_NAME.getString(byteBuffer);
}
return commName;
}


setCommName

The setCommName function sets the customer's name in the byte buffer. It first checks if the new name is different from the current cached name. If it is, it updates the byte buffer and caches the new name.

	public void setCommName(String commName) {
if (COMM_NAME.equals(this.commName, commName)) {
return;
}
COMM_NAME.putString(commName, byteBuffer);
this.commName = commName;
}


getCommAddress

The getCommAddress function retrieves the customer's address from the byte buffer. Similar to getCommName, it caches the address if it is not already cached.

	public String getCommAddress() {
if (commAddress == null) {
commAddress = COMM_ADDRESS.getString(byteBuffer);
}
return commAddress;
}


setCommAddress

The setCommAddress function sets the customer's address in the byte buffer. It updates the byte buffer and caches the new address if it is different from the current cached address.

	public void setCommAddress(String commAddress) {
if (COMM_ADDRESS.equals(this.commAddress, commAddress)) {
return;
}
COMM_ADDRESS.putString(commAddress, byteBuffer);
this.commAddress = commAddress;
}

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human