0% found this document useful (0 votes)
37 views85 pages

FIDS Documentation

Uploaded by

vasavi punnam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views85 pages

FIDS Documentation

Uploaded by

vasavi punnam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

FIDS APIs

Document
for Supply, Install, Configure, Testing and
Commissioning of Digital Platform and
Application Including Comprehensive
Maintenance for Malaysia Airports (Sepang)
Sdn. Bhd.
Document version: 1.0
Version date: 6th August 2021

Jaringan Nadi Teknologi Sdn. Bhd. (1039914-X )


C-1-10, Seri Gembira Avenue,
Jalan Senang Ria, 58200, Kuala Lumpur,
Wilayah Persekutuan Kuala Lumpur.
FIDS APIs Document

Digital Platform and Application

Table of Contents

Contents
Table of Contents ........................................................................................................ 2

Defination, Acronyms & Abbreviations ..................................................................... 4


1. FIDS ActiveFlights: .......................................................................................................................... 5

2. Get APIs........................................................................................................................................ 57

3. POM.XML of FIDS ......................................................................................................................... 73

4. FIDS Message Code Details ........................................................................................................... 77

5. Error & Exceptions ........................................................................................................................ 82

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 2


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 3


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

Definition, Acronyms and Abbreviations

Acronym Definition

3D 3 Dimensional

MAHB Malaysia Airports (Sepang) Sdn. Bhd.

FIDS Flight information display system

B2C Business-to-Consumer

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 4


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1. FIDS ActiveFlight

This section defines a Java package com.mahb.fids.controller to organize classes and provides
necessary imports. The class ActiveFlightController is a Spring RestController responsible for
handling HTTP requests related to active flights. The annotations @Slf4j, @RestController,
@CrossOrigin, and @RequestMapping are used for logging, marking the class as a controller,
allowing cross-origin requests, and specifying the base URL for this controller, respectively.

Here, an instance of the IFIDMessageProcessor interface is autowired (injected) using Spring's


dependency injection mechanism. This indicates that the controller relies on the functionality
provided by the IFIDMessageProcessor.

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 5


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

This @PostMapping annotation specifies that this method will handle HTTP POST requests to the
endpoint defined by the @RequestMapping annotation. The addFlightPlan method takes a JSON
request body (message) and processes it.

Inside the method, it logs the incoming message using Java's Logger with the name "fidsMessage".
Then, it attempts to process the message using the fidMessageProcessor instance that was
injected earlier. If an exception occurs during message processing, it sets the hasException flag to
true and logs the error.

After processing the message (or encountering an exception), the method constructs a response
using a HashMap. It includes two key-value pairs: "success" (set to true) and "exception" (set to
the value of the hasException flag). This response is then returned to the client.

Overall, the ActiveFlightController class serves as an entry point for handling incoming HTTP POST
requests related to active flight messages. It logs the received message, processes it using the
IFIDMessageProcessor service, handles exceptions, and responds with a success flag and
exception status. The architecture follows the Spring framework's MVC (Model-View-Controller)
pattern, where the controller handles incoming requests and delegates business logic to the
injected service (IFIDMessageProcessor).

The given code is a Java method that processes incoming messages. Let's break down the code
and explain it step by step, along with a simplified flowchart to help you understand the process:

1.1 Code Explanation:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 6


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1) The method is named processMessage and takes a single argument fidMessage of type String.
It throws an exception of type Exception.

2) The method begins by calling the getDocument method with the fidMessage to obtain a
Document object. If the doc is null, the method returns false, indicating that the message
processing failed.

3) The method then extracts the msgCode from the doc. If the msgCode is empty, it returns false.

4) The code now checks the value of msgCode and follows different branches based on its value.
There are three possible cases: MSG_CODE_FIDAFS, MSG_CODE_MASBAFS, and other cases.

5) Case MSG_CODE_FIDAFS: If the msgCode is equal to "FIDAFS", it means the message is of type
FIDAFS. It proceeds to convert the fidMessage XML into a FIDAFSMessage object. It then
iterates over each payload in the message.

6) Inside the payload loop, a new TransactionTemplate is created with a new transaction scope.
The updateOrInsertSchedule method is executed within this transaction scope, which handles
updating or inserting schedules based on the payload and message code.

7) If an error occurs during the process, an error status is set, and the exception details are
logged.

8) After processing each payload, a list of process statuses is collected. These statuses indicate
the success or failure of each payload processing.

9) After processing all payloads, the rawMessageProcessor is used to save the raw message and
process statuses. The method then returns true.

10) Case MSG_CODE_MASBAFS: This case is similar to the previous one but for the message code
"MASBAFS". It processes payloads of type MASBAFSPayload using the
updateOrInsertScheduleMASBAFSFlights method.

11) Default Case: If the msgCode does not match any of the above cases, the code enters a loop.
Within this loop, it identifies the specific message type based on the msgCode and executes
the corresponding update method using a TransactionTemplate.

12) If a LockAcquisitionException or ObjectOptimisticLockingFailureException occurs during the


process, the code attempts to retry the operation up to three times after a delay.

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 7


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

13) If any other exception occurs, it is caught, and an error status is set. The details of the
exception are logged.

14) Once the processing is complete, the rawMessageProcessor is used to save the raw message
and process status.

15) The method returns true at the end.

Flowchart

Start

[getDocument]

[Check doc == null]

/ \

[Return false] [Continue]

[Extract msgCode]

[Check msgCode is empty]

/ \

[Return false] [Continue]

[Check msgCode cases]

/ | \

[MSG_CODE_FIDAFS] [MSG_CODE_MASBAFS] [Other cases]

| | |

[Convert to FIDAFSMessage] [Convert to MASBAFSMessage] |

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 8


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

| | |

[Process payloads using Transaction Template] [Process payloads using TransactionTemplate] |

| | |

[Save process statuses] [Save process statuses] |

| | |

[Return true] [Return true] [Return true]

| | |

End

1.2 MSG_CODE_MASBAFS:

The provided code is a Java program that appears to handle the processing of XML messages
related to flight information. It involves parsing XML messages, extracting data, and updating or
inserting flight information into a database. Here's a detailed explanation of the code along with
a simplified flowchart:

1.2.1. Parsing Incoming Message:

• The code starts by checking if the incoming message has a specific message code
("MASBAFS").

• If the message code matches, it proceeds to process the message.

1.2.2. XML Parsing and Data Extraction:

• The incoming XML message is parsed into a Java object using JAXB (Java Architecture for
XML Binding).

• The parsed object represents a MASBAFSMessage, containing a header and a list of


payloads.

• Each payload represents flight-related information.

1.2.3. Payload Processing Loop:

• The code iterates through the list of payloads within the MASBAFSMessage.

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 9


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• For each payload, a new transaction is initiated using the TransactionTemplate.

• The method updateOrInsertScheduleMASBAFSFlights is executed within the transaction,


passing the payload and message code as parameters.

• If an exception occurs during the execution of the method, an error status is set for the
payload.

1.2.4. Method updateOrInsertScheduleMASBAFSFlights:

• This method updates or inserts flight information based on the payload data.

• It retrieves an ActiveFlight object from a database using the payload's AFSkey (flight
identifier).

• If the flight doesn't exist, a new ActiveFlight object is created.

• The method fillFromAFSPayloadMASBAFSlights is called to populate the ActiveFlight object


with payload data.

• After populating the ActiveFlight object, it is saved to the database.

• A PayloadProcessStatus object is created to track the processing status, and if successful,


it is marked as a success.

1.2.5. Method fillFromAFSPayloadMASBAFSlights:

• This method populates an ActiveFlight object with data from the payload.

• If the flight already exists in the database, various attributes of the ActiveFlight object are
updated with payload data.

• If the flight is new, attributes like afsKey, flightNumber, and others are populated.

• The method handles data formatting, such as converting date/time values.

Flowchart Overview: This flowchart gives an overview of the code's logic and how the different
methods and data processing steps are connected.

In summary, the code processes XML messages containing flight-related information, extracts
data, updates or inserts flight records in a database, and tracks the processing status for each

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 10


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

payload. It utilizes a structured approach to handle transactions, error handling, and data
population, ensuring accurate and consistent flight information management.

1.3 MSG_CODE_FIDAFS:

The code is focused on processing XML messages related to flight information. It follows a series
of steps to parse incoming messages, extract relevant data, update or insert flight details into a
database, and handle error scenarios. Here's a high-level overview of the process:

1.3.1. Incoming Message Processing:

• The code begins with an ‘if’ condition that checks if the incoming message's code matches
a specific value (MSG_CODE_FIDAFS). If the condition is met, the processing of the
message begins.

1.3.2. Message Conversion:

• The incoming XML message is converted into a ‘FIDAFSMessage’ object using JAXB (Java
Architecture for XML Binding). This class represents the structure of the XML message and
holds information about the flight header and payloads.

1.3.3. Payload Processing:

• The code iterates through each payload within the incoming message.

• For each payload, a transaction is initiated (using TransactionTemplate) for updating or


inserting schedule information into a database.

• If the transaction is successful, a PayloadProcessStatus object is created to indicate


successful processing. If an error occurs, an error status is set along with an error message.

1.3.4. Database Update:

• After processing all payloads, the code saves the processed data, including the header, raw
message, and processing statuses, into a database using
rawMessageProcessor.saveFIDSRawMessage().

1.3.5. Method fillFromAFSPayload:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 11


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1. FIDASM1Payload payload = asm1Message.getPayload();

This line retrieves the payload from an asm1Message object. It seems like asm1Message is an
instance of a class that contains some kind of message, possibly related to flight data.

2. Long afs = Long.valueOf(payload.getAFSkey().trim());

This line retrieves a property named AFSkey from the payload and converts it to a Long data type
after trimming any leading and trailing spaces. It's assuming that the value in AFSkey is a string
representation of a Long.

3. ActiveFlight activeFlight = activeFlightRepository.findById(afs).orElse(null);

This line attempts to retrieve an ActiveFlight object from a repository using the afs value obtained
from the previous step. If no object is found with the specified ID, it assigns null to activeFlight.

4. if (activeFlight == null) activeFlight = new ActiveFlight();

If the activeFlight object was not found in the repository (i.e., activeFlight is null), a new instance
of ActiveFlight is created.

5. fillFromAFSPayload(activeFlight, payload, asm1Message.getHeader().getMsgCode());

This line seems to invoke a method named fillFromAFSPayload with three arguments: the
activeFlight object, the payload, and a code obtained from the message header. This method
appears to populate the activeFlight object with data from the payload.

6. activeFlightRepository.save(activeFlight);

This line saves the activeFlight object (either newly created or updated) back to the repository,
presumably persisting it in a database.

7. PayloadProcessStatus processStatus = new PayloadProcessStatus();

A new instance of PayloadProcessStatus is created. This class likely represents some kind of status
or result related to the processing of the payload.

8. setPayloadSuccessStatus(processStatus, activeFlight);

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 12


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

It seems like this line invokes a method named setPayloadSuccessStatus with two arguments: the
processStatus object and the activeFlight object. This method likely sets some success status or
metadata in the processStatus object based on the processing outcome.

9. return processStatus;

The processStatus object is returned, possibly to indicate the outcome of the payload processing.

1.3.6. Conversion and Return:

• The method returns true to indicate successful processing of the message.

Key Classes and Concepts:

FIDAFSMessage: Represents the structure of the XML message containing flight header and
payloads. It is annotated using JAXB annotations for XML mapping.

FIDAFSPayload: Represents the payload data within the XML message. It holds various flight-
related details.

PayloadProcessStatus: Represents the status of payload processing, including success/failure and


error messages.

ActiveFlight: Represents flight-related information and is used for updating or inserting data into
the database.

CheckInCounter: Represents information about check-in counters for flights.

TransactionTemplate: Provides a programmatic approach for managing transactions.

Flowchart:

Given the complexity of the code and the number of interconnected components, creating a
concise flowchart might be challenging. However, I can provide you with a textual representation
of the flow:

1. Start

2. Check if the incoming message code matches MSG_CODE_FIDAFS

Yes: Continue processing, else end

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 13


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

3. Convert XML message to FIDAFSMessage object

4. Iterate through each payload in the message

Start transaction (TransactionTemplate)

Update or insert flight data into the database

On success, create a PayloadProcessStatus for success

On error, create a PayloadProcessStatus for failure and set error message

End transaction

5. Save processed data into the database (header, message, statuses)

6. Return true to indicate successful processing

7. End

This flowchart represents the main logic of the provided code, focusing on processing incoming
XML messages related to flight data and updating the database accordingly.

Please note that the actual implementation might involve further complexities, interactions with
database repositories, and potentially additional error handling that is not explicitly detailed in
the provided code snippet. It's recommended to thoroughly review and test the code in a
development environment before deployment.

1.4. MSG_CODE_MASBDLT:

The code appears to be a Java program that processes XML messages related to flight information
using the JAXB library for XML binding. It handles messages of different types, specifically focusing
on the "MASBDLT" message type. This code involves parsing incoming XML messages, extracting
relevant information, and processing the payload data.

Here's a detailed explanation of the code along with a textual representation of the flowchart:

1.4.1. Parsing and Processing MASBDLT Messages:

The code is part of a larger program that processes different types of XML messages. It focuses on
the "MASBDLT" message type and performs the following steps:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 14


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

a. An XML message is received, which contains information about a flight (MASBDLTMessage).

b. The XML message is parsed using JAXB, and an instance of MASBDLTMessage is created from
the XML data.

c. The header and payload data are extracted from the MASBDLTMessage.

1.4.2. MASBDLTMessage Class:

• The MASBDLTMessage class is a Java representation of the XML structure for a "MASBDLT"
message. It uses JAXB annotations to map XML elements to Java fields.

1.4.3. PayloadProcessStatus Class:

• This nested class, PayloadProcessStatus, represents the status of payload processing. It


contains fields such as flightNumber, afsKey, status, errMsg, and STAD (Scheduled Time of
Arrival or Departure).

1.4.4. Main Method:

• The main method is a test scenario. It creates an example XML message, parses it into a
MASBDLTMessage object, and then prints the value of the AFSkey. It also demonstrates the
conversion of the message object back to XML.

1.4.5. deleteFlightForMasb Method:

• This method processes a "MASBDLT" message payload. It takes a MASBDLTMessage object


as input, extracts payload data (such as AFS key and flight number), looks up the
corresponding flight in a repository, and then deletes the flight entry. After deleting the
flight, it sets the payload processing status to success and populates relevant details.

1.4.6. setPayloadSuccessStatus Method:

This method is responsible for setting the payload processing status to success and populating
details from the ActiveFlight object.

Flowchart:

a. The program starts.

b. An XML message is received.

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 15


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

c. The program parses the XML message into a MASBDLTMessage object.

d. The payload data is extracted from the MASBDLTMessage object.

e. The deleteFlightForMasb method is called with the payload data.

f. In the deleteFlightForMasb method, the AFS key is used to find and delete the corresponding
flight.

g. The payload processing status is set to success and populated with relevant details. h. The

program ends.

This explanation provides an overview of how the code processes "MASBDLT" messages, extracts
payload data, and deletes corresponding flights. It is advisable to provide additional context and
explanations if this code snippet is part of a larger application.

1.5 MSG_CODE_FIDASM1:

The code appears to be part of a Java application that deals with processing and updating flight
schedule information. The code is related to handling XML messages containing flight schedule
data and updating the corresponding database records. I'll break down the code and provide an
overview along with a simplified flowchart for better understanding.

1.5.1. Message Processing:

• The code starts with a conditional block that checks if the received message code is equal
to "FIDASM1".

• If it is, the program proceeds to process the incoming XML message.

1.5.2. XML Parsing:

• The XML message is parsed using the XMLUtils.convertToObject method, which converts
the XML content into a Java object of the FIDASM1Message class. This class has a structure
that matches the XML message's structure.

1.5.3. Update Flight Schedule:

• The updateFlightSchedule method is called, passing in the parsed FIDASM1Message.

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 16


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• This method processes the payload of the message and updates flight schedule
information in the database.

1.5.4. Active Flight Entity:

• The flight schedule data is stored in the ActiveFlight entity, which represents a record in
the database table tb_activeflight.

1.5.5. Database Operations:

The updateFlightSchedule method performs the following tasks:

• Retrieves an existing ActiveFlight record based on the AFS key (flight key). If the record
doesn't exist, a new one is created.

• Populates the ActiveFlight object with data from the XML payload, updating various
properties such as flight number, departure time, station codes, and more.

• Saves the updated or new ActiveFlight object back to the database using the
activeFlightRepository.

1.5.6. Payload Process Status:

• A PayloadProcessStatus object is created to represent the status of payload processing.


This status object is updated with information related to the flight, such as status,
departure time, and flight number.

1.5.7. Return Process Status:

• The PayloadProcessStatus object is returned to indicate the outcome of the payload


processing.

1.5.8. Main Method:

The main method demonstrates the usage of the code by creating an example XML message,
converting it into a FIDASM1Message object, and printing out the message code.

Flowchart:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 17


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

Here's a simplified flowchart depicting the main steps of the provided

code: a. The program starts.

b. An XML message is received.

c. Parse XML into FIDASM1Message object using XMLUtils.

d. Update Flight Schedule (updateFlightSchedule method).

e. Update ActiveFlight Entity (database operations).

f. Create PayloadProcessStatus

g. Return PayloadProcessStatus

h. End

1.6 MSG_CODE_FIDASM2:

The provided code seems to be a part of a Java application that deals with processing and updating
flight-related information using XML messages.

1.6.1. Message Processing:

• The code processes XML messages related to flight information. It appears to handle
messages with a specific message code (FIDASM2).

• When such a message is received, the program extracts the header and payload from the
XML message and processes the payload to update flight cancellation schedules.

1.6.2. FIDASM2Message Class:

• This represents the main structure of the incoming XML message.

• It consists of a header and a payload, both of which have specific attributes like msgCode,
msgSubtype, etc. The getHeader() and getPayload() methods provide access to these
attributes.

1.6.3. FIDASM2Payload Class:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 18


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• This class represents the payload of the XML message. It contains various attributes related
to flight details, such as actionCode, AFSkey, flightNo, etc.

• These attributes are annotated with @XmlElement to specify their XML element names.

1.6.4. PayloadProcessStatus Class:

• This inner class represents the status of the payload processing. It holds attributes like
flightNumber, afsKey, status, errMsg, and STAD (flight start date).

1.6.5. ActiveFlight Class:

• This class appears to be an entity class used for persisting flight-related information in a
database.

• It contains a wide range of attributes, including flight details, timings, codes, and flags.

1.6.6. updateFlightCancelSchedule Method:

• This method is responsible for updating flight cancellation schedules.

• It takes a FIDASM2Message object as a parameter, extracts relevant payload information,


and updates corresponding records in the database using the ActiveFlightRepository.

1.6.7. syncSecondaryFlight Method:

• This method updates secondary flight details in the ActiveFlight entity.

1.6.8. setPayloadSuccessStatus Method:

• This method sets success status and payload attributes in the PayloadProcessStatus object.

1.6.9. Main Method:

• The main method simulates the processing of an XML message. It creates a sample XML
message, converts it into a FIDASM2Message object, and prints out the actionCode from
the payload.

Overall Flow:

The program starts by receiving an XML message. It checks if the message code is valid. If valid, it
extracts the payload, updates flight schedules, and sets success status. The program includes

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 19


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

entity classes to represent flight data and methods to update and handle various aspects of flight
details.

1.7 MSG_CODE_FIDADMRAD:

The code is a Java program that appears to handle processing and updating of flight-related data
in a database.

1.7.1 Message Processing and Update:

• The program seems to be processing messages related to flight data. It looks for specific
message codes and performs corresponding actions.

• The main processing block involves updating the disposition of an aircraft based on the
message received.

1.7.2. Message Parsing:

• The program receives XML messages. It uses JAXB annotations (@XmlElement) to map
XML elements to Java objects.

• There are two primary classes involved: FIDADMRADMessage and FIDAFSPayload. The
FIDADMRADMessage contains a header (RTMessageHeader) and payload
(FIDAFSPayload).
The XML messages are parsed into instances of these classes.

1.7.3. Header and Payload Extraction:

• The program extracts information from the parsed XML, such as message codes, flight
details, and timestamps.

1.7.4. Update Aircraft Disposition:

• The core of the program involves updating the disposition of an active flight. T

• his includes setting various attributes of the ActiveFlight object based on the payload data.

1.7.5. Date Parsing:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 20


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• The program includes a utility method getUTCDateValue that parses date values from the
payload using a specified format. The method handles UTC time and converts it into a Java
Date object.

1.7.6. Database Update:

• The updated ActiveFlight object is saved to a database using a JPA repository


(activeFlightRepository).

• This represents the storage of flight-related information.

1.7.7. Payload Process Status:

The PayloadProcessStatus class is used to encapsulate the processing status of a payload. It holds
information about the flight, status, error message, and timestamps.

Flowchart:

1. Parse XML Message

2. Extract Header and Update Aircraft

3. Parse and Set Date Values

4. Update Database (JPA)

5. Set Payload Process Status

6. Return Status

1.8 MSG_CODE_FIDCHKALC

The provided code appears to be part of a Java application that handles messages related to
Check-In Counter Allocation/Reallocation in the aviation industry. The code processes XML
messages, extracts relevant information, interacts with a database, and performs various actions
based on the message contents. Below is a detailed explanation of the code along with a simplified
flowchart for better understanding:

1.8.1. XML Message Processing:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 21


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The application starts by receiving an XML message containing information about Check-In
Counter Allocation/Reallocation. The XML structure consists of a header and payload section.

1.8.2. Header and Message Code:

The header section of the XML message contains metadata about the message. The msgCode field
within the header indicates the type of message, and it is compared to the constant
MSG_CODE_FIDCHKALC to identify the message type.

1.8.3. Payload Extraction:

If the message code matches MSG_CODE_FIDCHKALC, the application proceeds to extract the
payload information from the XML message. The payload includes details about the action to be
performed, flight number, departure time, counter code, scheduled counter open time, and
scheduled counter close time.

1.8.4. Conversion to Object:

The extracted payload data is converted into a Java object of the FIDCHKALCMessage class using
the XMLUtils.convertToObject method.

1.8.5. Data Retrieval and Processing:

Once the payload data is converted to an object, the application proceeds to process the data and
perform actions based on the extracted information. The updateCheckInCounter method is called,
which updates the check-in counter based on the provided information.

1.8.6. Data Retrieval and Database Interaction:

The updateCheckInCounter method first retrieves the departure date, and then queries the
database to retrieve information about the active flight associated with the provided flight
number and departure date. If the active flight is found, the method further queries the database
to retrieve information about the check-in counter associated with the active flight and counter
code.

1.8.7. Action Handling:

Depending on the actionCode extracted from the payload, different actions are taken:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 22


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• If the action code is "A" (Add), a new check-in counter is created or updated with the
provided open and close times.

• If the action code is "U" (Update), the existing check-in counter is updated with the
provided times.

• If the action code is "D" (Delete), the existing check-in counter is deleted from the
database.

1.8.8. Payload Process Status:

After performing the necessary actions, a PayloadProcessStatus object is created to indicate the
processing status. The setPayloadSuccessStatus method updates the status with information from
the active flight.

1.8.9. Database Queries:

The code includes two custom queries, getByFlightAndStad and getByAFSAndCounter, to retrieve
active flight and check-in counter information from the database.

1.8.10. Date Parsing:

The getUTCDateValue method is responsible for parsing date values from the payload using a
specified date format.

1.8.11. Flowchart:

Here's a simplified flowchart illustrating the process:

1. Start

2. XML Input

3. Parse XML

4. Identify Message

5. Extract Payload

6. Convert to object

7. Retrieve Data

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 23


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

8. Database Queries

9. Perform Action

10. Update Status

11. Output Status

1.9 MSG_CODE_FIDDLTFLT

Certainly! The code is a Java application that handles XML messages related to flight data. It
processes a specific type of XML message, namely the FIDDLTFLTMessage.

1.9.1. Processing XML Messages:

• The code appears to be a part of a larger system where XML messages are being processed
based on different message codes.

• The MSG_CODE_FIDDLTFLT is being checked against the incoming message's code using
the equalsIgnoreCase method. If it matches, the code proceeds to process the message.

• The incoming XML message is converted into a Java object of type FIDDLTFLTMessage using
the XMLUtils.convertToObject method.

• The header of the incoming message is extracted from the FIDDLTFLTMessage.

1.9.2. FIDDLTFLTMessage Class:

• The FIDDLTFLTMessage class is a representation of the XML structure for the specific
message type.

• It has two main attributes: header and payload, which correspond to the header and
payload of the XML message, respectively.

• The class uses JAXB annotations like @XmlElement to map the XML elements to Java
attributes.

• The main method demonstrates how an XML message string is parsed into a
FIDDLTFLTMessage object using the XMLUtils.convertToObject method.

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 24


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• The payload's attributes are accessible using getter methods.

1.9.3. deleteFlightSchedule Method:

• This method is responsible for processing the payload of the incoming message and
performing specific actions.

• The payload is extracted from the FIDDLTFLTMessage.

• The AFSkey from the payload is used to identify a flight in the system.

• The activeFlightRepository is used to retrieve an ActiveFlight object based on the AFSkey.

• If the flight is found, it is deleted from the repository. Additionally, based on the
flightMode, the flight might be deleted or updated.

• A PayloadProcessStatus object is created to indicate the processing status, and success


attributes

are set based on the processed data.

1.9.4. FIDUNDOFLTPayload Class:

• This class represents the payload part of the XML message.

• It defines attributes like AFSkey, flightNo, leg, STAD, and officialFlightDate.

• JAXB annotations are used to map XML elements to Java attributes.

1.9.5. setPayloadSuccessStatus Method:

• This method is used to set success attributes in the PayloadProcessStatus object based on
the processed flight data.

1.9.6. Flowchart:

Here's a simplified flowchart representing the logic of the code:

1. Start

2. Process Incoming XML Message

3. Check Message Code: MSG_CODE_FIDDLTFLT

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 25


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

4. Convert XML to FIDDLTFLTMessage Object

5. Extract Header from FIDDLTFLTMessage

6. Execute deleteFlightSchedule

7. Extract Payload from FIDDLTFLTMessage

8. Retrieve ActiveFlight by AFSkey

9. Flight Found? If yes

10. Delete Flight or Update based on flightMode

11. Create PayloadProcessStatus Object

12. Set Success Attributes in PayloadProcessStatus

13. Return PayloadProcessStatus to Caller

1.10 MSG_CODE_FIDDLYDET

The code is a Java program that handle XML messages related to flight delay information. It
involves processing XML messages, extracting data from them, and performing certain actions
based on the extracted information.

1.10.1. Main Flow:

The main flow of the code seems to be focused on handling XML messages with a specific
msgCode called "FIDDLYDET". Let's go through the main components of the code.

1.10.2. XML Processing:

The code starts by processing XML messages. It uses a utility called XMLUtils.convertToObject to
convert an XML message into a Java object of type FIDDLYDETMessage. This class contains the
header information (RTMessageHeader) and payload data (FIDDLYDETPayload) of the XML
message.

1.10.3. Message Processing:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 26


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

After extracting the header and payload from the XML message, the code checks if the msgCode
matches "FIDDLYDET". If the condition is met, it proceeds to process the message further.

1.10.4. Processing Method:

The updateFlightDelaySchedule method is responsible for processing the payload data and
updating flight delay information in a data repository. It retrieves relevant information from the
payload, searches for a corresponding flight in a repository, and updates its delay status and other
attributes.

1.10.5. Date Parsing:

The code includes a method called getUTCDateValue that is used to parse date values from the
payload.
It uses a specific date format and handles time zone conversion to UTC.

1.10.6. Data Retrieval:

There's a method called getByFlightAndStadAndLeg that queries a data repository to retrieve flight
information based on flight number, scheduled time, and leg.

1.10.7. Payload Process Status:

The code defines a class called PayloadProcessStatus to store the processing status of the payload.
This class holds details about the flight number, status, error messages, and more.

1.10.8. Success Status Setting:

The code also includes a method called setPayloadSuccessStatus that sets the success status of
the payload processing. It populates the PayloadProcessStatus object with relevant details.

1.10.9. XML Classes:

The code defines two main classes for representing the XML structure:

FIDDLYDETMessage: Contains header and payload information. It includes methods for retrieving
and setting header and payload data.

FIDDLYDETPayload: Represents the payload data. It includes methods for retrieving and setting
various payload attributes.

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 27


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1.10.10. Main Method:

The code includes a main method to demonstrate how the XML message parsing and processing
work. It creates an example XML message, converts it to a FIDDLYDETMessage object, and prints
out the action code from the payload.

1.10.11. Flowchart:

1. XML message is received.

2. XML message is converted into a FIDDLYDETMessage object.

3. If the msgCode is "FIDDLYDET":

4. The payload is extracted from the FIDDLYDETMessage object.

3.1. The flight details are retrieved from the payload and used to search for a flight in the data
repository.

3.2. If the flight is found:

5. Flight delay and remark code are updated.

3.2.1. If the flight mode is specific, a secondary update is triggered.

3.2.2. A PayloadProcessStatus object is created and populated with success details.

3.3. The PayloadProcessStatus is returned.

This is a high-level overview of the code's flow. It demonstrates how XML messages are processed,
payload data is extracted and used to update flight information, and a status object is created to
represent the processing result.

1.11 MSG_CODE_FIDDSPFLG

The code is a Java program that handles the processing of XML messages related to flight display
flags. The code defines classes and methods to parse and manipulate XML messages, update flight
information, and manage process status.

1.11.1. Parsing XML Message:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 28


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The program starts by parsing an XML message using JAXB (Java Architecture for XML Binding).
The XML message structure consists of a header and a payload, where the payload contains
information about the flight display flag.

1.11.2. Conditional Message Processing:

The code contains a series of conditional checks using if and else if statements to determine the
type of message based on the msgCode attribute in the XML header. In this case, the code snippet
handles messages with the MSG_CODE_FIDDSPFLG value.

1.11.3. Conversion and Processing:

If the message code matches, the program converts the XML message into Java objects using the
XMLUtils.convertToObject method. The header and payload of the message are extracted for
further processing.

1.11.4. Updating Flight Display Flag:

The method updateFlightDisplayFlag is called with the extracted payload. Inside this method:

• The program retrieves information from the payload, such as the flight's AFS key, departure
time (STAD), and display flag status.

• It searches for an active flight record based on the AFS key.

• If the active flight is not found, an exception is thrown.

• If the existing flight mode is either 3 or 6, the flight display flag is updated in the database
using a custom query.

1.11.5. Updating ActiveFlight Object:

After updating the flight display flag in the database, the program updates the corresponding
ActiveFlight object with the new display flag, update time, and update user ID.

1.11.6. Saving ActiveFlight Object:

The modified ActiveFlight object is then saved back to the database using the
activeFlightRepository.save method.

1.11.7. Payload Process Status:

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 29


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

A PayloadProcessStatus object is created to represent the status of the payload processing. The
status, error message (if any), flight information, and other relevant data are set in this object.

1.11.8. Final Process Status:

The payload processing status is returned at the end of the updateFlightDisplayFlag method.

1.11.9. Main Method:

The provided main method demonstrates the conversion of an XML message into Java objects,
extraction of payload data, and printing the display flag status.

FIDS APIs Document Jaringan Nadi Teknologi Sdn. Page 30


Bhd.

Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1.12 MSG_CODE_FIDFCCHK

The code is part of a Java program that handles XML message processing related to flight
information, specifically focusing on check-in counter open/close activities. The code consists of
several classes and methods that work together to parse and process XML messages containing
flight-related data.

1.12.1 Main Logic (Control Flow):

• The code seems to be part of a larger system where different XML messages are processed
based on their message codes.

• The else if condition checks if the received message code is FIDFCCHK.

• If the condition is met, it processes the message using the


updateCheckInCounterOpenClose method.

1.12.2. XML Message Handling:

• The FIDFCCHKMessage class represents the structure of the XML message. It has a header
and a payload, where the header contains metadata, and the payload contains detailed
information about the check-in counter open/close activity.

• The FIDFCCHKPayload class represents the payload of the XML message, containing
various attributes related to the check-in counter activity.

1.12.3. XML Parsing and Object Conversion:

• The code uses XMLUtils.convertToObject to convert the received XML message into a Java
object of type FIDFCCHKMessage.

1.12.4. Payload Processing (updateCheckInCounterOpenClose):

• This method takes a FIDFCCHKMessage object as input and processes the payload to
update the status of check-in counters based on the action code.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 31


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• It retrieves various attributes from the payload such as flight number, arrival/departure
time, and action code.

• It performs database operations to update the status of check-in counters based on the

action code. • Depending on the actionCode, the counter status is updated to "Open" or

"Close."

• Additionally, it updates flight remark codes based on certain conditions and triggers
secondary updates.

1.12.5. Database Operations:

The code includes database update queries to modify the status and timestamps of check-
in counters in the CheckInCounter table.

1.12.6. Annotations:

Annotations like @Data, @XmlRootElement, @XmlElement, @Query, @Transactional, and


@Modifying provide metadata and behavior instructions to the Java compiler and runtime.

1.12.7. Simplified Flowchart:

1. Start Processing

2. Parse XML

3. Extract Header

4. Extract Payload

5. Update Counter Status

6. Update Remark

7. Secondary Update

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 32


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

8. Return Process Status

9. Finish Processing

1.13 MSG_CODE_FIDFCLNG1

The code seems is of a Java application that deals with processing XML messages related to lounge
open/close activities for flights. The application involves parsing XML messages, updating flight
information in a database, and performing some additional operations.

1.13.1. Message Processing Logic:

• The code appears to be part of a larger system where different types of messages are being
processed. It focuses on messages with a specific message code, FIDFCLNG1, which
indicates lounge open/close activities.

1.13.2. Message Parsing:

• The FIDFCLNG1Message class represents the structure of the XML message. It includes a
header and a payload section. The FIDFCCHKPayload class represents the payload content.
The payload contains information about flight details, lounge codes, action codes, and
other relevant data.

1.13.3. Main Method:

The main method in the FIDFCLNG1Message class demonstrates how to parse a sample
XML message into a Java object. It creates an instance of FIDFCLNG1Message using the
provided XML and prints out the remarkCode from the payload.

1.13.4. Updating Flight Information:

• The updateLoungeOpenClose method is used to update the flight information in the


database based on the payload data. The method takes an FIDFCLNG1Message object as

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 33


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

a parameter, extracts the relevant information, and performs database operations


accordingly.

• It checks the actionCode in the payload to determine whether to open or close the lounge.
If the action is to open the lounge (O), it updates various properties of the activeFlight
object and saves it to the database. If the action is to close the lounge (C), similar updates
are performed.

1.13.5. Secondary Flight Synchronization:

• The method syncSecondaryFlight is called after specific updates to the activeFlight object.
It appears to trigger a synchronization process for secondary flight data.

• It updates various properties of the activeFlight object and performs an update operation
in the database using the updateSecondaryFlights method.

1.13.6. Database Operations:

• The code makes use of database queries through JPA annotations. It retrieves an
activeFlight object based on flight details (flight number, STAD, category) using the
getByFlightAndStadAndCategory method.

• It also includes a custom database update query, updateSecondaryFlights, which updates


multiple properties of the activeFlight object in the database.

1.14 MSG_CODE_FIDFCLNG2

The code is part of a Java program that processes XML messages related to facility activities in an
airport. The XML messages contain information about lounge boarding and final call activities for
flights. The code handles the parsing of these XML messages, updates flight status in a database,
and provides status information. Here's an explanation of the code along with a simplified
flowchart:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 34


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1.14.1 Message Processing Logic:

• The code begins with an if-else block that checks the msgCode attribute of the incoming
XML message.

• If the msgCode matches "FIDFCLNG2", the message is processed further.

1.14.2. XML Message Parsing:

The incoming XML message is converted into a Java object called FIDFCLNG2Message
using
XML deserialization. This class represents the structure of the XML message and contains
a

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 35


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

header (of type RTMessageHeader) and a payload (of type FIDFCCHKPayload).

1.14.3. FIDFCLNG2Message Class:

• The FIDFCLNG2Message class represents the parsed XML structure. It includes getters and
setters for header and payload.

• The class also has a main method that demonstrates how to parse a sample XML message
using the XMLUtils class.

1.14.4. updateBoardingFinalCall Method:

This method processes the parsed FIDFCLNG2Message and updates the flight status based
on the message payload. It performs the following steps:

a. Extracts necessary information from the payload.

b. Retrieves the active flight information from a repository based on flight number, scheduled
departure time (STAD), and category code.

c. Depending on the actionCode in the payload, updates various attributes of the activeFlight
object. The attributes updated include remarks, gate and lounge codes, boarding times, and
more.

d. If the existing flight mode is 3 or 6, triggers a secondary flight update using the
syncSecondaryFlight method.

e. Prepares a PayloadProcessStatus object that stores the processing status, flight information,
and any error message.

1.14.5. syncSecondaryFlight Method:

• This method updates secondary flight attributes based on the active flight's information.

• It involves updating various attributes of the activeFlight object using a repository method.

1.14.6. PayloadProcessStatus Class:

• This nested static class represents the status of the payload processing. It contains
attributes such as flight number, status, error message, and more.

1.14.7. setPayloadSuccessStatus Method:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 36


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• This method sets the payload processing status as successful and populates relevant
attributes in the PayloadProcessStatus object.

1.14.8. Flowchart:

1. Facility Activity XML Message

2. Parse XML and Convert to FIDFCLNG2Message Object

3. Check msgCode and Process Based on Action Code

4. Extract Payload Data and Retrieve Active Flight Information

5. Update Active Flight Attributes Based on Payload Action Code and Values

6. Check Existing Flight Mode and Trigger Secondary Flight Update

7. Prepare PayloadProcessStatus Object and Set Processing Status and Information 8.

Return PayloadProcessStatus Object

1.15 MSG_CODE_FIDFCRCM1

The code is a Java program that seems to be handling the processing of XML messages related to
facility activities for a certain airline system.

1.15.1. Message Processing Conditions:

The code begins with an if-else if condition that checks the type of incoming message using a
msgCode.
In this case, it's looking for a specific msgCode called "FIDFCRCM1".

1.15.2. XML Message Deserialization:

When the condition is met, the incoming XML message is converted to a Java object using the
XMLUtils.convertToObject method. The resulting object is an instance of the FIDFCRCM1Message
class.

1.15.3. Accessing Header and Processing:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 37


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The header of the incoming message is extracted from the FIDFCRCM1Message object. Then, a
process is initiated using the template.execute method, where a method called
updateReclaimClose is executed with the incoming message object as an argument.

1.15.4. FIDFCRCM1Message Class:

The FIDFCRCM1Message class is defined. It represents the structure of the XML message. It
includes a header and a payload.

1.15.5. Header and Payload Accessors:

The getHeader() and getPayload() methods are defined within the FIDFCRCM1Message class to
access the header and payload data respectively.

1.15.6. Main Method for Testing:

The main method contains a sample XML message as a string. It demonstrates how to deserialize
the XML into a FIDFCRCM1Message object and access the payload's RemarkCode.

1.15.7. Payload Processing Method:

The method updateReclaimClose processes the payload of the message. It extracts various
attributes from the payload and uses them to query and update data in a repository for active
flights. It also handles setting various attributes and properties of the activeFlight object.

1.15.8. Database Query and Update:

The method queries the database to find an active flight that matches the flight number,
scheduled arrival/departure time (STAD), and category code. If no match is found, an exception
is thrown.
Otherwise, the relevant attributes of the activeFlight object are updated with payload data.

1.15.9. Secondary Flight Sync:

If the existing flight mode is 3 or 6, a secondary update (syncSecondaryFlight) is triggered, where


some attributes of activeFlight are updated based on its specific attributes.

1.15.10. PayloadProcessStatus Class:

The PayloadProcessStatus class defines a simple data structure to hold processing status
information.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 38


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1.15.11. Setting Payload Success Status:

The method setPayloadSuccessStatus is used to set the success status of the payload processing.
It updates the processStatus object with relevant data.

1.15.12. Flowchart Explanation:

Here's a simplified flowchart representing the logic of the provided code:

1. Start Processing

2. Check msgCode

3. Deserialize XML

4. Process Header

5. updateReclaimClose

6. Query Active Flight Database

7. Update Attributes

8. Sync Secondary flight

9. Update Process status

10. End Processing

1.16 MSG_CODE_FIDFCRCM2

The code appears to be a Java program that processes XML messages related to flight information
and updates a database with the processed information.

1.16.1. Parsing XML Messages:

• The code starts by processing incoming XML messages. It appears that different types of
messages are being handled based on their message codes.

• In this case, if the message code is "FIDFCRCM2", the program extracts relevant
information from the XML and performs further processing.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 39


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1.16.2. Message Processing:

• The FIDFCRCM2Message class is a Java representation of the XML structure. It has fields
to store the message header and payload data.

• The FIDFCRCM2Message class contains methods to get and set these fields.

1.16.3. Main Function:

• The main function simulates parsing an example XML message and converting it into an
instance of the FIDFCRCM2Message class using the XMLUtils.convertToObject method.

• It then retrieves and prints the remarkCode from the payload of the message.

1.16.4. Updating Database:

• The method updateReclaimOpen is responsible for processing the payload of the XML
message and updating a database with the relevant flight information.

• Depending on the actionCode in the payload, different fields of the ActiveFlight entity are
updated.

1.16.5. PayloadProcessStatus:

• PayloadProcessStatus is a data class that holds information about the processing status of
the payload. It contains fields like flight number, status, error message, etc.

1.16.4. Additional Helper Classes:

• There are classes like FIDFCCHKPayload that represent specific parts of the XML payload.
These classes have methods to get and set the attributes of the payload.

1.16.5. Database Operations:

• The code includes methods with annotations such as @Query, @Transactional, and
@Modifying for database operations. These methods update and retrieve data from the
database.

1.16.5. Flowchart:

Here's a simplified flowchart illustrating the process:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 40


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1. Parse XML Message

2. Check Code → if yes → Update Database

3. Process Data

4. Update ActiveFlight

5. Update Secondary Flight Data

6. Update Status and Return Process Status

7. Return Process Status

1.17 MSG_CODE_FIDTMAIRL

The code is a Java program that appears to be part of a system for processing and updating flight
information messages.

1.17.1. Handling a Specific Message Code:

• The code begins with an else if block that checks whether a given msgCode is equal to a
predefined constant MSG_CODE_FIDTMAIRL.

• If the condition is met, it processes the incoming message.

1.17.2. FIDTMAIRLMessage Class:

• This class represents a structured format for the incoming message. It contains the header
and payload of the message.

• The class is annotated with JAXB annotations to facilitate XML serialization and
deserialization.

1.17.3. FIDTMAIRLMessage Header:

• The RTMessageHeader class represents the header of the incoming message. It contains
various attributes like message code, version, time sent, etc.

1.17.4. FIDTMAIRLMessage Payload:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 41


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• The FIDTMAIRLPayload class represents the payload of the incoming message. It contains
attributes related to flight details, such as flight number, operation time, station codes,
etc.

1.17.5. Main Method for Testing:

• The main method in the FIDTMAIRLMessage class demonstrates how to create an example
XML message, deserialize it into a FIDTMAIRLMessage object, and access its payload
attributes for testing purposes.

1.17.6. updateFlightETAETDByAirline Method:

• This method updates flight information based on the incoming FIDTMAIRLMessage.

• It retrieves the payload, processes the flight details, and updates an ActiveFlight object in
the repository.

• It also triggers a secondary update under specific conditions.

1.17.7. FIDTMAIRLPayload Class:

• This class represents the payload structure of the message. It defines various attributes
that hold flight-related information.

1.17.8. getUTCDateValue Method:

• This utility method converts a UTC-formatted string to a Date object. It uses a


SimpleDateFormat with a UTC time zone.

1.17.9. PayloadProcessStatus Class:

• This inner class defines a data structure to hold the processing status of the payload. It
includes attributes like flight number, status, error message, etc.

1.17.10. setPayloadSuccessStatus Method:

• This method sets the payload processing status to indicate success. It populates the
PayloadProcessStatus object with relevant information from the ActiveFlight object.

1.17.11. syncSecondaryFlight Method:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 42


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• This method updates secondary flight information based on the ActiveFlight object and
payload.
It involves updating various attributes related to gate times, delays, codes, etc.

1.17.12. Code Flow:

1. The code starts by checking the incoming message code.

2. If the message code matches, it deserializes the XML message into a FIDTMAIRLMessage
object.

3. The updateFlightETAETDByAirline method processes the payload and updates flight


information.

4. If certain conditions are met, the method triggers a secondary flight update using the
syncSecondaryFlight method.

5. The method returns a PayloadProcessStatus object indicating the processing status.

1.18 MSG_CODE_FIDTMATMS

The code is a Java program that appears to be part of a larger software system. It involves handling
and processing messages related to flight information.

1.18.1. Package and Imports:

• The code is organized into a package called com.mahb.fids.vo.datapower. It includes


necessary import statements to access required classes and utilities.

1.18.2. FIDTMATMSMessage Class:

This class represents a message related to flight


information. It is annotated with @XmlRootElement(name="XML"), indicating
that it can be marshaled and unmarshaled to/from XML format. It contains the following
components:

• RTMessageHeader header: An instance of the RTMessageHeader class representing the


message header.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 43


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• FIDTMAIRLPayload payload: An instance of the FIDTMAIRLPayload class representing the


message payload.

The class includes getter and setter methods for both header and payload.

1.18.3. FIDTMAIRLPayload Class:

• This class represents the payload of the flight information message. It contains fields that
correspond to various attributes of the flight information.

• The fields include things like action code, flight number, departure/arrival times, station
codes, and more. It is also annotated with XML element names to facilitate XML parsing
and generation.

1.18.4. PayloadProcessStatus Class:

• This is a nested static class within the FIDTMATMSMessage class. It represents the status
of the payload processing. It includes fields like flight number, AFS key, status, error
message, and STAD (Scheduled Time of Arrival/Departure).

1.18.5. updateFlightETAETDByATM Method:

• This method processes the incoming FIDTMATMSMessage object to update flight ETA
(Estimated Time of Arrival) and ETD (Estimated Time of Departure) based on the payload.

• It does so by extracting information from the payload and using it to update the relevant
flight details in a database.

• The method checks the action code to determine whether to update ETA/ETD or ATA/ATD.

• The method also handles cases where the flight mode is either 3 or 6, which triggers a
secondary update using the syncSecondaryFlight method.

1.18.6. syncSecondaryFlight Method:

• This method is responsible for updating secondary flight information based on the active
flight's data and payload data. It updates various attributes related to gate times, delays,
etc., in the active flight repository.

1.18.7. setPayloadSuccessStatus Method:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 44


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• This method sets the payload process status to indicate a successful processing outcome.
It updates the status, STAD, flight number, and AFS key in the PayloadProcessStatus object.

1.18.8. Main Method:

• The main method is a test section of the code. It creates a sample XML message, converts
it into a FIDTMATMSMessage object using the XMLUtils.convertToObject method, and
prints out the action code from the payload.

The code implements a process for updating flight information based on incoming messages. It
handles different action codes, updates flight details, and maintains process status. The code
seems to be part of a larger system that interacts with flight data.

1.19 MSG_CODE_FIDUNDOFLT

The provided code seems to be a Java application that processes XML messages related to flight
data.

1.19.1. XML Message Handling:

The code starts with an if-else if block that checks whether the message code (msgCode) is equal
to "FIDUNDOFLT" or "ODBOOBFLT" ignoring the case. If either condition is met, it performs the
following actions:

1.19.2. XML to Java Object Conversion:

It converts the incoming XML message (in the fidMessage variable) into a Java object of type
FIDUNDOFLTMessage. The FIDUNDOFLTMessage class is annotated with JAXB
(@XmlRootElement) annotations to specify how XML elements are mapped to Java object
properties.

1.19.3. Message Header Extraction:

The code retrieves the header from the FIDUNDOFLTMessage object and stores it in the header
variable.

1.19.4. Payload Processing:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 45


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The code calls the removeFlightRemarkCOde method and passes the FIDUNDOFLTMessage object
to it for further processing.

1.19.5. FIDUNDOFLTMessage Class:

This class defines the structure of the XML message. It has a header (RTMessageHeader) and a
payload (FIDUNDOFLTPayload). The main method shows an example of how an XML message can
be converted into a FIDUNDOFLTMessage object.

1.19.6. FIDUNDOFLTPayload Class:

This class represents the payload data structure of the XML message. It includes fields like AFSkey,
flightNo, leg, STAD, and officialFlightDate.

1.19.7. removeFlightRemarkCOde Method:

This method processes the payload of the XML message. It retrieves information from the
payload, such as AFSkey, STAD, and flightNo. It then performs various operations on the
activeFlight entity based on conditions and updates its attributes.

1.19.8. ActiveFlight Entity:

The code interacts with an entity called ActiveFlight. It seems to update certain attributes of this
entity based on conditions specified in the removeFlightRemarkCOde method.

1.19.9. Flowchart:

1. The XML message is received.

2. If the msgCode is "FIDUNDOFLT" or "ODBOOBFLT", the XML is converted to a


FIDUNDOFLTMessage object.

3. The header is extracted from the FIDUNDOFLTMessage.

4. The payload is processed using the removeFlightRemarkCOde method.

5. In removeFlightRemarkCOde, the AFSkey is extracted, and an activeFlight entity is


retrieved based on this key.

6. If the entity is found, various updates are made to its attributes based on conditions.

7. Finally, the activeFlight entity is saved with the updated attributes.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 46


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

8. Remember that this is a high-level explanation and the actual behavior could be
influenced by the details of the ActiveFlightRepository interface and its underlying
implementation, as well as any potential interactions with external systems.

1.20 MSG_CODE_FIDOOBFLT & MSG_CODE_ODBOOBFLT

The code is a Java program that seems to handle the processing of XML messages related to flight
data.

1.20.1. Import Statements and Class Definitions:

• The code begins with several import statements that bring in necessary classes from
different packages.

• It defines three main classes: FIDOOBFLTMessage,


FIDOOBFLTPayload, and
PayloadProcessStatus.

1.20.2. FIDOOBFLTMessage Class:

• This class represents the overall XML message structure for flight data.

• It has two main fields:

1. header: An instance of RTMessageHeader that stores header information.

2. payload: An instance of FIDOOBFLTPayload that stores payload information.

1.20.3. FIDOOBFLTPayload Class:

• This class represents the payload part of the XML message.

• It contains various fields that correspond to different attributes of flight data, such as flight
number, station codes, timestamps, etc.

• Each field has a corresponding getter and setter method annotated with @XmlElement.

1.20.4. main Method:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 47


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• The main method demonstrates the usage of these classes by creating an XML message
string, parsing it, and printing the value of a specific field (STAD) from the payload.

1.20.5. updateFlightChock Method:

• This method processes the payload data related to flight chock information.

• It extracts relevant data from the payload, updates an ActiveFlight object, and saves it to
a repository.

• Depending on the value of the chockIndicator field, it sets different attributes of the
ActiveFlight object.

• It constructs and returns a PayloadProcessStatus object indicating the processing status.

1.20.6. Date Conversion Methods:

• The code includes a getUTCDateValue method that converts a date string in a specific
format to a Date object in UTC timezone.

• This method handles parsing errors and logs any issues encountered during the parsing
process.

1.20.7. PayloadProcessStatus Class:

• This is a nested class within the main class, used to encapsulate the status of the payload
processing.

• It has fields to store flight-related information, status, error messages, and a timestamp
(STAD).

1.20.8. setPayloadSuccessStatus Method:

• This method populates a PayloadProcessStatus object with success-related information


such as flight number, status, and timestamp.

1.20.9. Flowchart:

Main Flow:

1. The program starts in the main method.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 48


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

2. It creates an XML message string and parses it into a FIDOOBFLTMessage object.

3. It then prints the STAD field from the payload.

4. Payload Processing Flow (updateFlightChock Method):

5. The program enters the updateFlightChock method with a FIDOOBFLTMessage object.

6. It extracts payload data and identifies the flight number, timestamp, and chock indicator.

7. It searches for an ActiveFlight object using flight number and timestamp.

8. Depending on the chock indicator, it updates the on-block or off-block time for the flight.

9. The ActiveFlight object is updated and saved to a repository.

10. A PayloadProcessStatus object is created, populated with success-related information,


and returned.

1.21 MSG_CODE_GASSNDALC

The code seems to be a part of a Java application that processes XML messages related to flight
information.

1.21.1. Conditions for Message Processing:

• The code begins with an "else if" condition that checks if


the value of MSG_CODE_GASSNDALC (which should be defined somewhere else in
the code) is equal to a message code retrieved from the incoming message.

• If the condition is true, it indicates that a specific type of message with the code
"GASSNDALC" is being processed.

1.21.2. FIDGASSNDALCMessage Class:

• The FIDGASSNDALCMessage class is a Java object representation of an XML message. It


contains a header (RTMessageHeader) and a payload (FIDGASSNDALCPayload).

1.21.3. RTMessageHeader Class:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 49


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• The RTMessageHeader class represents the header section of the message. It contains
various attributes such as msgCode, msgSubtype, msgVersion, and so on.

1.21.4. FIDGASSNDALCPayload Class:

• The FIDGASSNDALCPayload class represents the payload section of the message. It


contains attributes related to flight information such as flightNo, leg, STAD, and others.

1.21.5. updateStandAllocationSchedule Method:

This method processes the incoming FIDGASSNDALCMessage by extracting information from its
payload and performing some database-related operations.

1. It extracts information from the payload such as flightNo and STAD.

2. Retrieves an ActiveFlight object from the database based on the extracted flight
information.

3. Updates the STANDCODE and potentially the GATELOUNGECODE of the active flight.

4. Saves the updated active flight information back to the database.

5. Checks the existing flight mode and triggers a secondary update under certain conditions.

6. Returns a PayloadProcessStatus object to indicate the status of the payload processing.

1.21.6. syncSecondaryFlight Method:

• This method performs an update on a SecondaryFlight object based on information from


the ActiveFlight object. It updates various attributes such as ACTGATEOPENTIME,
ACTGATECLOSETIME, and more.

1.21.7. Main Method:

• The main method demonstrates how to create an XML message, convert it into a
FIDGASSNDALCMessage object, and access attributes from the payload for testing
purposes.

Overall, this code appears to be a part of a larger system that handles messages related to flight
information, processes them, and updates relevant database records. To create a flowchart, you

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 50


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

would need to visually represent the flow of operations, branching conditions, and data
interactions between different components and methods in the code.

1.22 MSG_CODE_FIDTICTY

The code is a Java application that processes XML messages related to city information.

1.22.1. Import Statements and Package Declarations:

• The code starts with import statements, which bring in classes from different packages.

• It also includes package declarations indicating the package structure of the code.

1.22.2. Conditional Processing based on Message Code:

• The code snippet begins with an if-else if block, which appears to be part of a larger logic
structure.

• It checks if a message code, likely represented as MSG_CODE_FIDTICTY, is equal to a


specific value. If the condition is met, the code proceeds to process the corresponding
XML message.

1.22.3. FIDTICTYMessage Class:

• FIDTICTYMessage is a class that appears to represent an XML message with a header and
payload. It is annotated with @XmlRootElement and includes methods to set and retrieve
the header and payload.

• RTMessageHeader and FIDTICTYPayload are classes that seem to represent the header
and payload sections of the message. They are not provided in the code snippet, but they
likely follow similar patterns to the FIDTICTYMessage class.

• getDescription() is a private method that returns a description related to the message.

1.22.4. Main Method for Testing:

• The main method demonstrates the testing of the XML message parsing and processing.
It constructs an XML message string, converts it into a FIDTICTYMessage object, and then
prints the short name from the payload.

1.22.5. updateCity Method:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 51


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

This method takes a FIDTICTYMessage object and updates city information based on the payload
data.

• It retrieves the city code from the payload and attempts to find a city in the repository.

• If the city is not found, a new city is created and initialized with the city code.

• Short and long names are retrieved from the payload and trimmed if they're not empty.

• The city's short and long names are set, and the city is saved in the repository.

• A PayloadProcessStatus object is created, its status is set to success, and it's returned as
the result of the method.

1.22.6. FIDTICTYPayload Class:

This class seems to represent the payload structure of the FIDTICTY message. It includes methods
to set and retrieve IATA city code, short name, and long name.

1.22.7. PayloadProcessStatus Class:

This class represents the status of payload processing. It includes fields such as flight number, AFS
key, status, error message, and a date field. This class is annotated with @Data, which likely
generates getter, setter, equals, and hash code methods.

1. Conditional Processing:

• Check if the MSG_CODE_FIDTICTY equals a certain message code.

• If the condition is met, proceed to process the corresponding XML message.

2. XML Message Parsing:

• Convert the XML message string into a FIDTICTYMessage object.

• Extract the header and payload from the message.

3. City Information Update:

• Extract city information from the payload.

• Retrieve the city from the repository or create a new city if not found.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 52


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• Update the city's short and long names based on payload data.

• Save the city in the repository.

4. Payload Processing Status:

• Create a PayloadProcessStatus object.

• Set the status to success.

5. Return Status:

• Return the PayloadProcessStatus object as the result of the updateCity method.

Please note that the actual implementation and flow might differ based on the missing parts of
the code and the details of the RTMessageHeader, CityRepository, and other classes.

1.23 MSG_CODE_FIDTIAPT

The code is a Java implementation that handles XML messages related to airport information. It
includes classes to represent and process these messages, as well as methods to update airport
data in a repository.

1.23.1. Message Processing Logic:

The code seems to process XML messages with different msgCode values. Specifically, it focuses
on messages with the MSG_CODE_FIDTIAPT code.

1.23.2. Main Processing Logic (else if Block):

If the msgCode matches MSG_CODE_FIDTIAPT, the code performs the following steps:

• It converts the incoming XML message into a Java object of type FIDTIAPTMessage.

• Extracts the header from the incoming message.

• Calls the updateAirport method to process the payload information of the


message.

• The processStatus variable holds the result of the updateAirport method.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 53


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1.23.3. FIDTIAPTMessage Class:

• Represents the main structure of the incoming XML message.

• Contains a header field of type RTMessageHeader and a payload field of type


FIDTIAPTPayload.

• Provides getter and setter methods for both fields.

• Also includes a getDescription method and a main method for testing.

1.23.4. FIDTIAPTPayload Class:

• Represents the payload section of the XML message.

• Contains fields like IATAAirportCode, IATACityCode, shortName, and longName.

• Provides getter and setter methods for these fields.

• It is used within the FIDTIAPTMessage class as the payload content.

1.23.5. PayloadProcessStatus Class:

• Represents the status of the payload processing.

• Contains fields like flightNumber, afsKey, status, errMsg, and STAD.

• It is used as a return value for the updateAirport method.

1.23.6. updateAirport Method:

• Updates airport information based on the payload data.

• Receives an instance of FIDTIAPTMessage as an argument.

• Extracts data from the payload, such as IATAAirportCode, IATACityCode, shortName, and
longName.

• Uses an airportRepository to interact with the airport data store.

• Creates or updates an Airport object and saves it in the repository.

• Returns a PayloadProcessStatus object indicating the processing status.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 54


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1.23.7. Flowchart Overview:

a) Start

b) XML Message Processing

c) Convert XML to FIDTIAPTMessage

d) Extract Header

e) Call updateAirport

f) Process Payload

g) Update Repository

h) Return ProcessStatus

i) End Processing

1.24 MSG_CODE_FIDTIAIR

The code appears to be a Java program that processes XML messages related to airline
information.

1.24.1. Flow Overview:

The program processes incoming XML messages, specifically FIDTIAIR messages, which seem to
contain airline information. The main process involves parsing the XML, extracting relevant
information, and updating the airline data.

1.24.2. Code Explanation:

• The code starts with an if-else if statement that checks if a certain message code
(MSG_CODE_FIDTIAIR) is equal, ignoring the case. If the condition is met, it processes the
FIDTIAIR message.

• The FIDTIAIRMessage class represents the XML structure for FIDTIAIR messages. It has a
header and a payload, both of which are objects of other classes.

• FIDTIAIRMessage class has a method getDescription() that returns a description string.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 55


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• The main method in FIDTIAIRMessage class demonstrates the parsing of an example XML
message using the XMLUtils.convertToObject() method. It extracts and prints the airline
name from the message.

• The updateAirline method takes a FIDTIAIRMessage object as input and processes its
payload. If an exception occurs during processing, it sets the status to error and records
the error message.

• The PayloadProcessStatus class holds information about the processing status, including
flight number, status, error message, and more.

• Constants STATUS_SUCCESS and STATUS_ERROR are used to define success and error
status strings.

1.24.4. Flowchart:

1) Start

2) Main Processing

3) Parse Incoming XML Message Convert XML to FIDTIAIRMessage

4) Extract Header and Payload Data Update Payload Data Using updateAirline()

5) Set Process Status and Check If Processed Successfully or with an Error 6) Print Processed

Airline Name

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 56


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

2. Get APIs
2.1 Get-Flights

API Endpoint: @GetMapping("/get-flights")

The API is mapped to the URL path "/get-flights" and accepts only GET requests.

Request Parameters:

code: (Optional) A string parameter that can be either "ARR" (for arrivals), "DEP" (for departures),
or empty. It filters flights based on their arrival or departure status.

flightNumber: (Optional) A string parameter representing the flight number to filter the results.

afskey: (Optional) A long parameter representing an AFS key used as a unique identifier for a
specific flight.

aircraftOperatorCode: (Optional) A string parameter representing the code of the aircraft


operator.

originCityCode: (Optional) A string parameter representing the code of the origin city of the flight.

destinationCityCode: (Optional) A string parameter representing the code of the destination city
of the flight.

skip: (Optional) An integer parameter representing the number of items to skip in the results.
Default value is 0.

take: (Optional) An integer parameter representing the number of items to take (retrieve) in the
results. Default value is 1000.

longerWindow: (Optional) A boolean parameter to determine whether to use a longer time


window for the flight status. Default value is false.

fromArrivals: (Optional) An integer parameter representing the lower bound of flight arrivals
duration in minutes. Default value is the constant
FlightDurationRange.DEFAULT_FROM_ARRIAVALS_STR which is -75 mins.

toArrivals: (Optional) An integer parameter representing the upper bound of flight arrivals
duration in minutes. Default value is the constant

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 57


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

FlightDurationRange.DEFAULT_TO_ARRIVALS_STR which is 540 mins.

fromDepartures: (Optional) An integer parameter representing the lower bound of flight


departures duration in minutes. Default value is the constant
FlightDurationRange.DEFAULT_FROM_DEPARTURES_STR which is -10 mins.

toDepartures: (Optional) An integer parameter representing the upper bound of flight departures
duration in minutes. Default value is the constant
FlightDurationRange.DEFAULT_TO_DEPARTURES_STR which is 2160 mins.

Response: The API returns a ResponseEntity<FlightStatusResponse> object containing flight


status information.

getFlights Method: This method is the handler for the "/get-flights" API endpoint. It fetches flight
status information based on the provided parameters.

getFlights Service Method: This method is called by the API handler and retrieves flight status
data from the repository or cache.

getFlightsWithLocalCache Method: This method uses local caching to improve performance and
avoid redundant database calls. It checks if flight data is available in the cache based on a key
generated from the provided parameters. If the data is present in the cache, it returns the cached
data; otherwise, it fetches the data from the database, caches it, and returns it.

getFlightsPrivate Method: This method filters and groups the fetched flight data based on airline
operators and other criteria. It returns a list of FlightStatus objects containing the flight status
information.

makeFlightStatus Method: This method converts ActiveFlight objects into FlightStatus objects,
adding relevant information such as terminal, airport name, flight type, status, etc.

FlightStatus Class: This class represents the flight status information with various attributes like
flight number, category, origin, destination, terminal, airline name, etc.

Overall, the API provides a flexible way to retrieve flight status information based on different
parameters and uses caching to improve performance. It converts the raw data into a structured
response containing flight status information, making it easier for clients to consume the data.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 58


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

2.2 Get-Flights-Cache

This API is designed to retrieve flight statuses from a cache based on various parameters. It allows
clients to query for flights using specific filters like flight code, aircraft operator code,
origin/destination city codes, and time intervals.

The API is an HTTP GET endpoint with the URL path "/get-flights-cache". It accepts several query
parameters, each denoted by the @RequestParam annotation in the method signature. The
parameters include:

"code": A filter for flight arrival or departure status.

"flightNumber": The flight number for a specific flight.

"afskey": The AFS ey, a unique identifier for a flight.

"aircraftOperatorCode": The code of the aircraft operator for filtering.

"originCityCode" and "destinationCityCode": The codes of the origin and destination cities
respectively.

"skip" and "take": Parameters for pagination, allowing the client to skip a number of results and
take a specified number of results.

"longerWindow": A boolean parameter to determine if the time window should be extended.

"fromArrivals", "toArrivals", "fromDepartures", and "toDepartures": Parameters to set time


intervals for arrivals and departures.

The method "getFlightsCache" handles the request and delegates the actual filtering logic to the
"getFlightsWithLocalCache" and "filterFlightsAndCreateResponse" methods. These methods
perform the actual filtering and build the response.

The "getFlightsWithLocalCache" method is responsible for fetching flights from a local cache
based on the provided parameters. It uses the arrival and departure time intervals, along with the
"code" parameter, to filter flights accordingly. It first checks if the desired flights are already
present in the cache and returns them. If not, it queries the database to retrieve the flights, caches
them locally, and then returns the filtered flights.

The "filterFlightsAndCreateResponse" method takes the retrieved flights from the local cache
and applies additional filters based on other query parameters. It filters the flights based on

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 59


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

"code", "flightNumber", "afskey", "aircraftOperatorCode", "originCityCode", and


"destinationCityCode". Additionally, it applies pagination using "skip" and "take" to return a
subset of flights.

Finally, the API builds a response of type "FlightStatusResponse" and includes information about
the server, version, count of returned flights, and a list of "FlightStatus" objects. The "FlightStatus"
class represents the details of each flight, including its terminal, flight number, origin, destination,
status, and more.

In summary, this API provides a flexible way to retrieve flight statuses based on various filters, and
it optimizes the response time by caching the flight data locally to avoid repeated database
queries. The response is structured and includes all relevant flight information for the client's
consumption.

2.3 Get-Flight

The code represents a RESTful API endpoint that retrieves flight status information based on the
provided flight number and an optional "afskey" parameter. The "afskey" is a BigDecimal value
used to identify the flight. The API returns a response in JSON format containing the flight status
details.

1. @GetMapping("/get-flight"): This annotation maps the method to the URL path "/get-flight"
for handling HTTP GET requests.

2. The method getFlight is the main API endpoint. It takes two parameters: flightNumber (String):
The flight number for which the status is requested.

3. afskey (BigDecimal, optional): An optional parameter used to uniquely identify the flight.

4. The method attempts to get the flight status based on the provided parameters using the
flightService object.

5. If the flight status is found, the API builds a response (FlightStatusResponse) with the necessary
details like server version, count (number of flights found), and a list of flight statuses. If no
flight status is found, it returns a response with count 0 and no flight statuses.

6. If any exception occurs during the process, it logs the error and returns an HTTP 500 Internal
Server Error response.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 60


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

7. The FlightStatusResponse class is a data transfer object (DTO) representing the response
structure. It contains fields like "server" (hostname of the server), "version" (API version),
"count" (number of flights found), and "flightStatuses" (list of FlightStatus objects).

8. The FlightStatus class represents individual flight status information and contains various
details like flight number, airport, terminal, gate information, and more. It uses nested classes
to represent complex objects like "Destination," "Belt," "Gate," etc.

9. The getFlightsWithLocalCache method is a helper method responsible for caching and fetching
flight data from the database based on the provided parameters.

10. The getFlightsPrivate method processes the raw data received from the database and
creates a list of FlightStatus objects, filtering and sorting the data based on specific criteria.

11. The makeFlightStatus method is responsible for creating a single FlightStatus object from
the provided data.

12. The code uses constants like "ARRIVAL_CODE," "DEPARTURE_CODE," "KLIA2," and
"EMPTY_CHAR_SPACE" for better readability and maintainability.

13. The code also maintains separate lists of "klia1Terminals" and "klia2Terminals" to
distinguish terminals at different airports.

Overall, this code represents a well-structured and organized API endpoint to fetch flight status
information based on flight numbers with optional parameters for more specific searches.

2.4 Get-Flight-Meta

1. Endpoint Definition:

• The code defines a Spring Boot controller with a single endpoint mapped to the URL "/get-
flight-meta" and accepts HTTP GET requests.

2. Method Signature:

• The method "getFlightMeta" handles the incoming requests for the defined endpoint. It
takes several optional query parameters as inputs.

3. Query Parameters:

The method accepts the following query parameters, all of which are optional:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 61


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• "checksum": A string value representing a checksum. It is used to check if the flight


metadata is already cached.

• "fromArrivals": An integer representing the minimum arrival duration (in minutes) for
filtering flights.

• "toArrivals": An integer representing the maximum arrival duration (in minutes) for
filtering flights.

• "fromDepartures": An integer representing the minimum departure duration (in minutes)


for filtering flights.

• "toDepartures": An integer representing the maximum departure duration (in minutes)


for filtering flights.

4. ResponseEntity:

• The method returns a ResponseEntity object, which is used to send the response back to
the client. The response body is of type "BaseResponse," which can be a success or an
error response.

5. Exception Handling:

• The method handles exceptions thrown during its execution. If a DataValidationException


occurs, it creates an error response with the appropriate error message and status code.

• If any other exception occurs, it returns an HTTP 500 (Internal Server Error) response.

6. Default Values:

• The code defines default values for the optional query parameters. If any of these
parameters are not provided in the request, the default values will be used.

7. FlightMeta Class:

• The code defines a nested class named "FlightMeta" with


three inner classes: "FlightMetaAirportOperator," "FlightMetaAirportCode," and
"FlightMetaFlight." These classes are used to represent flight metadata in a structured
way.

8. getFlightMetaFromDB Method:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 62


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• This method is used to fetch flight metadata from the database based on the provided
filtering criteria (fromArrivals, toArrivals, fromDepartures, toDepartures).

• It uses JPA Query annotations to retrieve relevant ActiveFlight entities from the database.

9. createFlightMetaFlight, createFlightMetaAirportCode, and


createFlightMetaAirportOperatorObj Methods:

• These methods are used to convert the retrieved ActiveFlight entities into
FlightMetaFlight, FlightMetaAirportCode, and FlightMetaAirportOperator objects,
respectively.

• They extract relevant information from ActiveFlight and create the corresponding
FlightMeta objects.

Overall, the endpoint fetches flight metadata from the database based on optional filtering
criteria and returns the data in a structured format using the FlightMeta class. If there are any
errors or exceptions during the process, appropriate error responses are returned to the client.

2.5 Get-Flight-Departures

1. Controller Method - getDepartureFlights:

• This method is annotated with @GetMapping and maps to the URL path "/get-flight-
departures".

• It handles HTTP GET requests and returns a list of departure flight statuses.

• It accepts various query parameters that are used to filter and paginate the results.

• Query Parameters:

2. The method accepts several query parameters:

• code: A string parameter representing the type of flights (Arrivals or Departures).

• terminal: An optional string parameter to filter flights by a specific terminal.

• category: An optional string parameter to filter flights by category.

• skip: An optional integer parameter indicating the number of items to skip from the result
(for pagination).

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 63


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• take: An optional integer parameter indicating the maximum number of items to take in
the result

(for pagination).

• fromArrivals, toArrivals, fromDepartures, toDepartures: Optional integer parameters


representing time durations used for filtering flights based on arrivals and departures.

3. Service Method - getArrivalOrDepartureFlights:

• This method is called by the controller method to fetch the flight statuses based on the
query parameters.

• It filters and sorts the flights based on the provided parameters.

• It calculates the date ranges for arrivals and departures based on the default values or
provided values.

• It retrieves the flights from a local cache (if available) or fetches them from the database
if not present in the cache.

• It also filters the flights based on the provided category and sorts them by flight time and
airline name.

4. FlightStatus Class:

• This class represents the structure of a flight status, including various attributes such as
flight number, terminal, airport name, category, status, etc.

• It contains inner classes to represent nested objects like Destination, Belt, Gate, CheckIn,
CodeShareFlight, and Airline.

5. Local Cache Mechanism:

• The getFlightsWithLocalCache method uses a local cache to store and retrieve flight data
based on specific time ranges and codes (Arrivals or Departures).

• If the requested flights are already present in the cache, it returns the cached data;
otherwise, it fetches the flights from the database, stores them in the cache, and returns
the result.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 64


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

6. Other Utility Methods:

• There are several utility methods like makeFlightStatus, createOriginObj,


createDestinationObj, etc., that are used to create and initialize various nested objects in
the FlightStatus class.

7. FlightStatusResponse:

• This class represents the response structure for flight statuses.

• It includes the server version, a list of flight statuses, and the count of flight statuses in the
response.

8. getFlightResponse:

• This method constructs the final FlightStatusResponse with the appropriate flight statuses
based on the provided skip, take, and terminal parameters.

Overall, this code snippet represents a RESTful API endpoint for fetching departure flight statuses.
It accepts various query parameters for filtering and pagination and uses a local cache mechanism
to optimize database queries. The response includes a list of flight statuses along with relevant
details about the flights.

2.6 Get-Flight-Departures-Cache:

Certainly! The provided code is a Java implementation for a RESTful API endpoint and related
supporting classes to retrieve flight departure information from a cache. Let's break down the
code step by step:

1. Controller:

This part of the code defines a Spring @RestController class that handles HTTP GET requests to
the "/get-flight-departures-cache" endpoint. It takes several optional query parameters (terminal,
skip, take, category) to customize the response.

• The getFlightDepartureCache method uses these parameters to


call the flightService.getFlightDeparturesCache method and returns a ResponseEntity
with the flight departure information.

2. Service:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 65


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The service layer contains the getFlightDeparturesCache method, which is responsible for
processing the request and preparing the flight departure data.

• The method initializes various date ranges (fromArrival, toArrival, fromDeparture,


toDeparture) and then fetches flight statuses using the getFlightsWithLocalCache method
based on these date ranges and other parameters.

• It optionally filters the flight statuses by a specified category.

• The flight statuses are sorted based on flight time and airline name.

• Finally, it constructs a FlightStatusResponse object containing the filtered and sorted flight
statuses, along with metadata like the cache level.

3. ViewModel:

The FlightStatus class represents flight status information. It contains various fields and nested
classes for different aspects of a flight status, such as destination, belt, gate, check-in, code-share
flights, and airline information.

4. Response Model:

The FlightStatusResponse class is a response model containing information about the flight
statuses returned by the API. It includes fields for the server, version, count of flight statuses, and
a list of FlightStatus objects.

5. Utility Methods:

• The getFlightResponse method filters and paginates the list of flight statuses based on the
given terminal, skip, and take parameters. It creates a FlightStatusResponse object with
the filtered flight statuses and related information.

• The getFlightsWithLocalCache method uses a local cache to store and retrieve flight
statuses based on specific criteria. It checks if the flight statuses are already cached and
retrieves them, or fetches them from a data repository and then caches them.

• The findActiveFlights and findActiveFlightsDepartures methods define database queries


to retrieve active flights based on specific date ranges.

6. Flight Status Generation:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 66


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The getFlightsPrivate method generates flight status objects from a list of active flights. It filters
and processes the active flights, grouping them by certain criteria and creating corresponding
FlightStatus objects.

7. Flight Status Creation:

The makeFlightStatus method creates a FlightStatus object based on the information extracted
from an ActiveFlight object. It sets various properties such as terminal, airport name, flight
number, category, origin, destination, flight type, status, flight time, and more.

8. Explanation:

This code defines a REST API endpoint that retrieves flight departure information, processes the
data, and prepares a response with relevant flight details. It incorporates various classes and
methods for caching, data retrieval, filtering, sorting, and constructing response models.

2.7 Get-Flight-Arrivals:

1. Endpoint Definition:

The code defines an HTTP GET endpoint with the mapping "/get-flight-arrivals". It receives several
query parameters that control the filtering and pagination of flight arrivals data.

• code: An optional parameter to filter flights by type (arrival or departure), defaulting to


"A" (arrival).

• terminal: An optional parameter to filter flights by terminal.

• skip: An optional parameter for pagination, indicating how many records to skip,
defaulting to 0.

• take: An optional parameter for pagination, indicating how many records to take,
defaulting to 10.

• category: An optional parameter to filter flights by category.

• fromArrivals, toArrivals, fromDepartures, toDepartures: Parameters to define time ranges


for filtering flights based on arrival and departure times.

2. Controller Method:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 67


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The getArrivalsFlights method in the controller handles the HTTP GET request. It delegates the
request to the flightService to retrieve flight data based on the provided parameters. If
successful, it returns an HTTP 200 response with the flight data. If an error occurs, it logs the
error and returns an HTTP 500 response.

3. Service Method:

The getArrivalOrDepartureFlights method in the service layer processes the flight data retrieval.
It calculates time ranges for arrivals and departures based on the provided parameters. Then, it
retrieves a list of flights using the getFlightsWithLocalCache method. It filters the flights based
on the specified category and sorts them by flight time and airline name. Finally, it constructs a
FlightStatusResponse object with the paginated flight data.

4. Flight Data Retrieval:

The getFlightsWithLocalCache method handles caching of flight data based on a generated key. If
the data is already in the cache, it returns it; otherwise, it queries the database to fetch the data,
stores it in the cache, and returns it.

5. Flight Data Processing:

The getFlightsPrivate method takes a list of ActiveFlight objects and processes them to create a
list of FlightStatus objects. It filters the flights based on a list of carriers and terminal, groups
flights by code share and official flight date, and then creates flight status objects for each group.

6. Flight Status Creation:

The makeFlightStatus method constructs a FlightStatus object based on an ActiveFlightGroup and


flight code. It sets various attributes of the flight status, including terminal, origin, destination,
flight type, status, flight time, and more. It also handles the creation of code share flight
information.

7. Database Queries:

The code includes several database queries using Spring Data JPA's @Query annotations to fetch
active flight data based on different criteria, such as time ranges for arrivals and departures.

8. Additional Methods:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 68


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The code also includes various utility methods to handle data transformation, formatting, and
filtering.

2.8 Get-Flight-Arrivals-Cache:

The provided code appears to be a Java-based web service that retrieves flight arrival data from
a cache. It seems to be part of a larger flight information system.

1. Controller Layer (@GetMapping)

The code starts with a controller method that handles GET requests to retrieve flight arrival data
from a cache. The method accepts optional query parameters such as terminal, skip, take, and
category. It tries to retrieve flight arrival data from a service and returns it as a JSON response.

2. Service Layer (FlightService)

The service layer contains a method named getFlightArrivalsCache which retrieves flight arrival
data based on the provided parameters. It calculates time ranges for flight arrivals and
departures, filters and sorts the flight statuses, and constructs a response object.

3. Response Objects (FlightStatusResponse, FlightStatus, etc.)

The response objects are used to structure the data returned by the web service. They contain
various attributes representing flight information, such as flight number, terminal, airport name,
status, gate information, etc. The FlightStatus class is particularly detailed, containing nested
classes to represent various aspects of flight data, such as destinations, belts, gates, etc.

4. Cache Management

The code utilizes a local cache (localFlightsCache) to store flight status data based on specific key
values derived from time ranges and flight types (arrival or departure). If the requested data is
found in the cache, it's directly returned; otherwise, the service fetches the data from a repository
(presumably a database), processes it, and stores it in the cache for future use.

5. Database Access (ActiveFlightRepository)

The code includes repository methods (findActiveFlightsArrivals, findActiveFlightsDepartures,


and findActiveFlights) that query a database to retrieve active flight data based on different
criteria (arrival, departure, or both). These methods use JPA queries with various conditions.

6. Business Logic

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 69


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

The getFlightsPrivate method performs various data processing tasks to generate a list of
FlightStatus objects. It involves filtering, grouping, and transforming data from ActiveFlight
objects to populate the flight status information.

7. Utility Functions

Several utility functions are used throughout the code for tasks like date formatting, string
manipulation, and calculating time differences.

8. Exception Handling

The code includes error handling logic to catch and log exceptions that might occur during the
data retrieval process. If an exception occurs, the web service returns an HTTP 500 Internal
Server Error response.

9. Configuration

Some constants are defined for default values such as time ranges for flight arrivals and
departures.

Architecture Overview:

The code follows a layered architecture pattern, with clear separation between the controller,
service, repository, and utility functions. It interacts with a database (presumably using JPA) to
retrieve flight data. The data retrieval process involves fetching data from the database,
processing it to construct flight status information, and caching the results for improved
performance. The response objects are used to structure and present the flight information to
the client.

2.9 Search-Flight

The given code snippet appears to be part of a Java Spring Boot application, specifically focusing
on handling flight status search and retrieval. It involves web APIs for searching flight details based
on various parameters such as flight code, key, value, terminal, and category. The code to follow
a structured design, separating concerns into different methods and classes.

Architecture and Key Components

1. Controller Layer (@GetMapping("/search-flights")):

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 70


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• This section defines a Spring @RestController which exposes an endpoint for flight
searches.

• The searchFlight method handles incoming requests and invokes the appropriate service
methods based on the provided parameters.

2. Service Layer (searchFlight Method in flightService):

• The searchFlight service method performs the actual flight search and response
generation.

• It handles validation of input parameters and delegates the search operation to


flightService.searchFlight.

3. Data Validation:

• Data validation is performed for the input parameters (code, key, value, terminal,
category).

• If invalid data is provided, a DataValidationException is thrown, which can provide an error


message and HTTP status code.

4. Flight Search and Response Generation (searchFlight Method in flightService):

• This method searches for flight status based on various criteria using the provided
parameters.

• The search involves querying a repository for active flight information.

• Flight data is transformed into a list of FlightStatus objects, which represent flight details.

5. Caching (getFlightsWithLocalCache Method):

• This method performs flight data retrieval, either from a cache (localFlightsCache) or from
the repository.

• It generates a cache key based on the provided criteria and fetches flight data accordingly.

• If data is fetched from the repository, it is stored in the cache for future use.

6. Flight Data Transformation (getFlightsPrivate and makeFlightStatus Methods):

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 71


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

• These methods handle the transformation of raw flight data into FlightStatus objects.

• They map relevant data fields from the fetched flight information.

• Additional data manipulation is performed, such as determining the terminal and airport
names.

7. Flight Search and Filtering (searchFlightAndSendResponse Method):

• This method filters the list of FlightStatus objects based on various search criteria (e.g.,
city, flight, airline).

• The filtered results are sorted by flight time and airline name.

8. Response Generation:

• The final response is constructed as a FlightStatusResponse object, containing the list of


filtered flight status details.

• The response is prepared for the controller to return to the client.

Conclusion

In summary, the provided code demonstrates a structured approach to handling flight status
searches using Spring Boot. It follows a layered architecture, separating concerns into controller,
service, and data transformation layers. The code efficiently retrieves flight data, applies filtering
and sorting, and generates a well-structured response for clients querying flight information
based on various parameters. The use of caching enhances performance by reducing database
queries for repetitive requests.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 72


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

3. POM.XML of Fids
3.1

<?xml version="1.0" encoding="UTF-8"?>

This specifies the XML version and encoding used in the file.

3.2

<project xmlns="http://maven.apache.org/POM/4.0.0”

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

The project element is the root element of the Maven POM (Project Object Model) file. It defines
the project's configuration and dependencies. The XML namespace is specified, and
xsi:schemaLocation points to the XSD (XML Schema Definition) file for the Maven POM.

3.3

<parent>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-parent</artifactId>

<version>2.5.2</version>

<relativePath /> <!-- lookup parent from repository -->

</parent>

The parent element specifies the parent project's information. In this case, the project inherits its
configuration from the Spring Boot Starter Parent project with version 2.5.2.

3.4

<modelVersion>4.0.0</modelVersion>

This element defines the version of the POM model being used. In this case, it is version 4.0.0.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 73


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

3.5

<groupId>com.mahb.api</groupId>

<artifactId>fids_api</artifactId>

<version>1.0.61</version>

These elements specify the coordinates of the current project. The groupId represents the group
or organization that owns the project, the artifactId is the name of the project, and the version is
the current version of the project.

3.6 All dependencies

The dependencies section contains a list of all the project's dependencies. Each <dependency>
element specifies a dependency artifact with its groupId, artifactId, and version.

The provided pom.xml file includes the following dependencies:

1. Spring Boot Starter Web: Provides basic web support for Spring Boot applications.

2. Spring Boot DevTools: Provides additional development tools to improve the development
experience.

3. Spring Boot Starter Data JPA: Provides support for Spring Data JPA, making it easy to interact
with databases.

4. Spring Boot Starter Security: Provides security features for Spring Boot applications.

5. JJWT (JSON Web Token): A library for working with JSON Web Tokens.

6. Google API Client: Google APIs client library.

7. Google OAuth Client (Jetty): A client library for Google OAuth using Jetty.

8. Google API Services Sheets: Google Sheets API client library.

9. Spring Boot Starter Actuator: Provides production-ready features to monitor and manage the
application.

10. SLF4J API: Simple Logging Facade for Java, a logging framework.

11. Spring Boot Starter Cache: Provides support for caching in Spring Boot applications.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 74


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

12. OpenCSV: A library to read and write CSV files in Java.

13. Lombok: A library to reduce boilerplate code in Java classes.

14. Spring Boot Starter JDBC: Provides support for JDBC-based data access.

15. Tomcat JDBC: A JDBC connection pool implementation for Tomcat.

16. Microsoft SQL Server JDBC Driver: JDBC driver for Microsoft SQL Server.

17. Apache Commons Lang3: A library of utility classes for common programming tasks.

18. MySQL Connector/J: JDBC driver for MySQL.

19. Mockito JUnit Jupiter: Integration between Mockito and JUnit Jupiter (used with scope test).

20. Spring Boot Starter Test: Provides support for testing Spring Boot applications.

21. JUnit Jupiter API: The JUnit 5 Jupiter API for testing.

22. JUnit 4: JUnit 4 testing framework (used with scope test).

23. Mockito Core: A mocking framework for unit tests.

24. JUnit Jupiter Engine: The JUnit 5 Jupiter test engine (used with scope test).

3.7

<properties>

<java.version>17</java.version>

</properties>

The properties section allows you to define property values that can be referenced throughout
the POM. In this case, it sets the java.version property to 17, indicating that the project should be
compiled using Java 17.

3.8 Build & Plugins

The build section contains configurations for the build process. Here, it lists a couple of Maven
plugins:

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 75


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

1. Spring Boot Maven Plugin: A plugin that provides various features for building and packaging
Spring Boot applications.

2. Maven Surefire Plugin: A plugin used for running tests during the build process.

The pom.xml file provided represents a Maven project for a Spring Boot application with various
dependencies for web development, security, data access, and testing. It also includes external
libraries for Google API integration, logging, CSV processing, and database connections. The
project is set to use Java 17 as the target version for compilation.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 76


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

4. FIDS Message Code Details

Sl Message Message Expected result Actual result


no code Count(Pa
yload)

1 FIDAFS 1 1. Inserted payload


1. Insert the payload data like details(AFSKEY, FLIGHT NO..)in
(AFSKEY,FLIGHTNO,LEG,STAD,OFFICIALFLIGHTDATE,AIRCRAFTTYPECODE, to "TB_ACTIVEFLIGHT" Table.
SERVICECLASS,AIRCRAFTOPERATORCODE,IATASERVICETYPECODE,CODES 2. Header details inserted in
HAREFLIGHT,TRAFFICRIGHT,FLIGHTMODE,MODESEQUENCE,CATEGORYC the "tb_fids_message" Table.
ODE,STATION1,STATION2,STATION3,STATION4,STATION5,STATION6,STD1 3. Payload details inserted in
,STD2,STD3,STD4,STD5,STA2,STA3,STA4,STA5,STA6,SPECIALFLIGHTIND,S the
CHCOUNTEROPENTIME,SCHCOUNTERCLOSETIME,SCHGATEOPENTIME,S "tb_fids_message_payload"
CHGATECLOSETIME,SCHGATEBOARDINGTIME,SCHGATEFINALCALLTIME, Table.
STANDCODE,GATELOUNGECODE,TAILNO,MEMO,ATMSETAD,SITAETAD,DI
SPETAD,LASTUPDTIME,LASTUPDUSERID) in to "TB_ACTIVEFLIGHT"
Table.
2. Header details will be insert in the "tb_fids_message" Table.
3. Payload details will insert in the "tb_fids_message_payload" Table.

6 FIDASM1 1 These columns should get updated FLIGHTNO , Leg, Stad, updated FLIGHTNO , Leg,
and OFFICIALFLIGHTDATE Stad, OFFICIALFLIGHTDATE
Flightmode against afskey
=6

7 FIDASM1 1 These columns should get updated FLIGHTNO , Leg, Stad, These columns should get
and OFFICIALFLIGHTDATE updated FLIGHTNO , Leg,
Flightmode Stad, OFFICIALFLIGHTDATE
=1 to 5

8 FIDASM1 1(As per 1. It should Insert 1 payload details(AFSKEY, FLIGHT NO..)in to 1. Inserted 1 payload
ICD it will "TB_ACTIVEFLIGHT" Table. details(AFSKEY, FLIGHT NO..)in
acceptt 1 2. Header details should insert in the "tb_fids_message" Table. to "TB_ACTIVEFLIGHT" Table.
Payload) 3. 1 Payload details should insert in the "tb_fids_message_payload" 2. Header details inserted in
Table. the "tb_fids_message" Table.
3. 1 Payload details inserted in
the
"tb_fids_message_payload"
Table.

9 FIDASM2 1 1. It should update 1 Updated


REMARKCODEFLIGHT,LASTUPDTIME,LASTUPDUSERID in REMARKCODEFLIGHT=
"TB_ACTIVEFLIGHT" Table against AFSKEY "FCL",LASTUPDTIME="GETDAT
E()",LASTUPDUSERID =
"MSGCODE" in
"TB_ACTIVEFLIGHT" Table
against AFSKEY

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 77


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

10 FIDADMRA 1 As per payload information (flightno, etc)columns should get updated These columns should get
D updated FLIGHTNO , Leg,
Stad, OFFICIALFLIGHTDATE

12 FIDCHKALC 1 Insert row in the tb_Counter table based on the flight number Inserted row in the
tb_Counter table based on
the flight number

15 FIDDLTFLT 1 Delete from tb_activeflight against afskey provided payload Deleted from tb_activeflight
FIDD+C16: against afskey provided
H16LTFLT payload
and
FlightMode
=3

16 FIDDLTFLT 1 Delete from tb_activeflight against afskey provided payload Deleted from tb_activeflight
FIDD+C16: against afskey provided
H16LTFLT payload
and
FlightMode
=6

17 FIDDSPFLG 1 As per payload information ( DISPFLAG )column should get updated in updated the column DISPFLAG
and table tb_activeflight in the tb_activeflight table
FlightMode
=3

18 FIDDSPFLG 1 As per payload information ( DISPFLAG )column should get updated in updated the column DISPFLAG
and table tb_activeflight in the tb_activeflight table
FlightMode
=6

19 FIDTMAIRL 1 As per payload information DISPETAD , REMARKCODEFLIGHT , Updated DISPETAD =


FLIGHTPLANID,LASTUPDTIME,LASTUPDUSERID columns should get @CL_OPERATIONTIME,
updated in table REMARKCODEFLIGHT ,
tb_activeflight FLIGHTPLANID,LASTUPDTIME,
LASTUPDUSERID
columns should get updated
in table tb_activeflight

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 78


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

20 FIDTMATM 1 As per payload information ATMSETAD, REMARKCODEFLIGHT Updated ATMSETAD,


S and ,FLIGHTPLANID,LASTUPDTIME,LASTUPDUSERID columns should get REMARKCODEFLIGHT
ACTIONCO updated in table ,FLIGHTPLANID,
DE='ETA' tb_activeflight LASTUPDTIME,LASTUPDUSERI
D columns should get updated
in table
tb_activeflight

21 FIDTMATM 1 As per payload information ATMSETAD, REMARKCODEFLIGHT Updated ATMSETAD,


S and ,FLIGHTPLANID,LASTUPDTIME,LASTUPDUSERID columns should get REMARKCODEFLIGHT
ACTIONCO updated in table ,FLIGHTPLANID,
DE='ETD' tb_activeflight LASTUPDTIME,LASTUPDUSERI
D columns should get updated
in table
tb_activeflight

22 FIDTMATM 1 As per payload information ATMSETAD, REMARKCODEFLIGHT Updated ATAD,


S and ,FLIGHTPLANID,LASTUPDTIME,LASTUPDUSERID columns should get REMARKCODEFLIGHT
ACTIONCO updated in table ,FLIGHTPLANID,
DE='ATA' tb_activeflight LASTUPDTIME,LASTUPDUSERI
D columns should get updated
in table
tb_activeflight

23 FIDTMATM 1 As per payload information ATAD, REMARKCODEFLIGHT Updated ATAD,


S and ,FLIGHTPLANID,LASTUPDTIME,LASTUPDUSERID columns should get REMARKCODEFLIGHT
ACTIONCO updated in table ,FLIGHTPLANID,
DE='ATD' tb_activeflight LASTUPDTIME,LASTUPDUSERI
D columns should get updated
in table
tb_activeflight

24 FIDUNDOFL 1 As per payload information ATAD, REMARKCODEFLIGHT columns should Updated ATAD,
T and get updated in table REMARKCODEFLIGHT columns
FlightMode tb_activeflight and will be set to Null in table tb_activeflight
=3

25 FIDUNDOFL 1 As per payload information ATAD, REMARKCODEFLIGHT columns should Updated ATAD,
T and get updated in table REMARKCODEFLIGHT columns
FlightMode tb_activeflight and will be set to Null in table tb_activeflight
=6

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 79


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

26 FIDDLYDET 1 As per payload informationFLIGHTDELAYCODE, REMARKCODEFLIGHT Did not update


,LASTUPDTIME,LASTUPDUSERID columns should get updated in table FLIGHTDELAYCODE,
tb_activeflight and will be set to Null REMARKCODEFLIGHT
,LASTUPDTIME,LASTUPDUSERI
D columns should get updated
in table
tb_activeflight and will be set
to Null

27 FIDFCRCM1 1 As per payload information REMARKCODEFLIGHT, Did not update


REMARKCODECAROUSEL, CAROUSELCODE, REMARKCODEFLIGHT,
ACTCAROUSELCLOSETIME,LASTUPDTIME,LASTUPDUSERID columns REMARKCODECAROUSEL,
should get updated in table CAROUSELCODE,
tb_activeflight ACTCAROUSELCLOSETIME,LAS
TUPDTIME,LASTUPDUSERID
columns should get updated
in table
tb_activeflight

28 FIDOOBFLT 1 As per payload information STANDONCHOCKTIME column should get Did not update
and updated in table STANDONCHOCKTIME column
ChockIndic tb_activeflight should get updated in table
ator = 1 tb_activeflight

29 FIDOOBFLT 1 As per payload information STANDONCHOCKTIME column should get Did not update
and updated in table STANDONCHOCKTIME column
ChockIndic tb_activeflight should get updated in table
ator = 1 tb_activeflight

30 GASSNDAL 1 As per payload information STANDCODE = Did not update STANDCODE =


C ,LASTUPDTIME,LASTUPDUSERID columns should get updated in table ,LASTUPDTIME,LASTUPDUSERI
tb_activeflight and will be set to Null D columns should get updated
in table tb_activeflight and
will be set to Null

31 FIDFCLNG1 1 As per Payload information REMARKCODEFLIGHT, REMARKCODEGATE, As per Payload information


Action code GATELOUNGECODE, ACTGATEOPENTIME, LASTUPDTIME, REMARKCODEFLIGHT,
O LASTUPDUSERID, LASTUPDMSGCODE REMARKCODEGATE,
GATELOUNGECODE,
ACTGATEOPENTIME,
LASTUPDTIME,
LASTUPDUSERID,
LASTUPDMSGCODE

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 80


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

32 FIDFCLNG1 1 As per Payload information REMARKCODEFLIGHT, REMARKCODEGATE, As per Payload information


Action code GATELOUNGECODE, ACTGATECLOSETIME, LASTUPDTIME, REMARKCODEFLIGHT,
C LASTUPDUSERID, LASTUPDMSGCODE REMARKCODEGATE,
GATELOUNGECODE,
ACTGATECLOSETIME,
LASTUPDTIME,
LASTUPDUSERID,
LASTUPDMSGCODE

33 FIDFCLNG2 1 As per Payload information REMARKCODEFLIGHT, REMARKCODEGATE, As per Payload information


Action code GATELOUNGECODE, ACTGATEBOARDINGTIME, LASTUPDTIME, REMARKCODEFLIGHT,
B LASTUPDUSERID, LASTUPDMSGCODE REMARKCODEGATE,
GATELOUNGECODE,
ACTGATEBOARDINGTIME,
LASTUPDTIME,
LASTUPDUSERID,
LASTUPDMSGCODE

34 FIDFCLNG2 1 As per Payload information REMARKCODEFLIGHT, GATELOUNGECODE, As per Payload information


Action code REMARKCODEGATE, ACTGATEFINALCALLTIME, LASTUPDTIME, REMARKCODEFLIGHT,
FC LASTUPDUSERID, LASTUPDMSGCODE REMARKCODEGATE,
GATELOUNGECODE,
ACTGATEFINALCALLTIME,
LASTUPDTIME,
LASTUPDUSERID,
LASTUPDMSGCODE

35 FIDFCCHK 1 Updates CheckInCounter based on status='Open', Updates CheckInCounter


Action counterOpenTime=:oprTime, LASTUPDTIME=NOW() based on status='Open',
Code O counterOpenTime=:oprTime,
LASTUPDTIME=NOW()

36 FIDFCCHK 1 Updates CheckInCounter based on status='Close', Updates CheckInCounter


Action code counterCloseTime=:oprTime, LASTUPDTIME=NOW() based on status='Close',
C counterCloseTime=:oprTime,
LASTUPDTIME=NOW()

37 ODBOOBFL 1 To Remove FLIGHTREMARDCODE, updates ATAD, LASTUPDATETIME, To Remove


T LASTUPDUSERID, LASTUPDMSGCODE FLIGHTREMARDCODE,
updates ATAD,
LASTUPDATETIME,
LASTUPDUSERID,
LASTUPDMSGCODE

38 FIDTICTY 1 Updates city. IATACityCode,city shortName and city long name Updates city.
IATACityCode,city shortName
and city long name

39 FIDTIAPT 1 Updates airport. IATAAirportCode, IATACityCode,airport shortName and Updates airport.


airport long name IATAAirportCode,
IATACityCode,airport
shortName and airport long
name

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 81


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

40 FIDTIAIR 1 As of now no operation is being performed when we recieve this As of now no operation is
message code (carry forward from previous 1.0 logic being performed when we
recieve this message code
(carry forward from previous
1.0 logic

41 MASBAFS 1
(add new 1. Insert the payload data like
flight) (AFSKEY,FLIGHTNO,LEG,STAD,OFFICIALFLIGHTDATE,AIRCRAFTTYPECODE,
SERVICECLASS,AIRCRAFTOPERATORCODE,IATASERVICETYPECODE,CODES
HAREFLIGHT,TRAFFICRIGHT,FLIGHTMODE,MODESEQUENCE,CATEGORYC
ODE,STATION1,STATION2,STATION3,STATION4,STATION5,STATION6,SCHC
OUNTEROPENTIME,SCHCOUNTERCLOSETIME,SCHGATEOPENTIME,SCHG
ATECLOSETIME,SCHGATEBOARDINGTIME,SCHGATEFINALCALLTIME,STAN
DCODE,GATELOUNGECODE,TAILNO,ATMSETAD,SITAETAD,DISPETAD,LAST
UPDTIME,LASTUPDUSERID,SeasonId,IrregularIndicator, Homestation) in
to "TB_ACTIVEFLIGHT" Table.
2. Header details will be insert in the "tb_fids_message" Table.
3. Payload details will insert in the "tb_fids_message_payload" Table.

42 MASBAFS 1
(update 1. Update the payload data like
exsisting (OFFICIALFLIGHTDATE,AIRCRAFTTYPECODE,SERVICECLASS,AIRCRAFTOP
flight ERATORCODE,IATASERVICETYPECODE,CODESHAREFLIGHT,TRAFFICRIGHT,
details) FLIGHTMODE,MODESEQUENCE,CATEGORYCODE,STATION1,STATION2,ST
ATION3,STATION4,STATION5,STATION6,SCHCOUNTEROPENTIME,SCHCO
UNTERCLOSETIME,SCHGATEOPENTIME,SCHGATECLOSETIME,SCHGATEB
OARDINGTIME,SCHGATEFINALCALLTIME,STANDCODE,GATELOUNGECOD
E,TAILNO,ATMSETAD,SITAETAD,DISPETAD,LASTUPDTIME,LASTUPDUSERI
D,SeasonId,IrregularIndicator, Homestation) in to "TB_ACTIVEFLIGHT"
Table.
2. Header details will be insert in the "tb_fids_message" Table.
3. Payload details will insert in the "tb_fids_message_payload" Table.

43 MASBDLT 1 1. Delete the exsisting flight based on the AFSKEY that is received
(delete through the payload
exsisting
flight)

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 82


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

5. ERROR & EXCEPTIONS

Error handling is typically involving handling exceptions that can occur during the application's
runtime. Spring Boot provides various mechanisms and annotations to help you handle errors
and exceptions effectively. Below, I'll provide an explanation of commonly used error handling
mechanisms in Spring Boot.

5.1. @ControllerAdvice and @ExceptionHandler:

@ControllerAdvice is an annotation that allows you to define global exception handling for your
application.
@ExceptionHandler is used within a @ControllerAdvice class to define methods that handle
specific exceptions.

5.2. Custom Exception Classes:

You can create custom exception classes by extending RuntimeException or other exception
classes provided by Java.
Example:
public class ResourceNotFoundException extends RuntimeException {
public ResourceNotFoundException(String message) {
super(message);
}
}

5.3. @ResponseStatus:

Use the @ResponseStatus annotation to specify the HTTP status code to return when an
exception is thrown.

5.4. ErrorController:
You can implement a custom ErrorController to handle uncaught exceptions globally. This is a
fallback mechanism when no specific exception handler is available.

5.5. ResponseEntityExceptionHandler:
This is a built-in class in Spring Boot that you can extend to create a custom exception handler. It
provides various methods to handle exceptions and return ResponseEntity objects.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 83


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

5.6. Global Exception Handling Configuration:


You can configure global exception handling in the application.properties or application.yml file
using properties like server.error.path, server.error.include-exception, and server.error.include-
stacktrace.

5.7. Return Values:


Error codes can be used as return values from methods to indicate success or failure. For example,
a method can return 0 for success and a non-zero value for various error conditions.

5.8. Logging and Monitoring:


It's essential to log exceptions for debugging and monitoring purposes. Spring Boot provides
integration with various logging frameworks like Logback and Log4j.

5.9. Error Details:


Error Name Description
AbstractMethodError When a Java application tries to invoke an abstract method.

NullPointerException NullPointerException is a runtime exception in Java that occurs


when a variable is accessed which is not pointing to any object
and refers to nothing or null.
Error Indicating a serious but uncatchable error is thrown. This type
of error is a subclass of Throwable.
AssertionError To indicate that an assertion has failed.

ClassCircularityError While initializing a class, a circularity is detected.

IllegalAccessError A Java application attempts either to access or modify a field or


maybe invoking a method to which it does not have access.

ClassFormatError When JVM attempts to read a class file and find that the file is
malformed or cannot be interpreted as a class file.
InstantiationError In case an application is trying to use the Java new construct for
instantiating an abstract class or an interface.

ExceptionInInitializerError Signals that tell an unexpected exception have occurred in a


static initializer.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 84


Commercial in Confidence
FIDS APIs Document

Digital Platform and Application

InternalError Indicating the occurrence of an unexpected internal error in the


JVM.
IncompatibleClassChangeError When an incompatible class change has occurred to some class
of definition.
LinkageError Its subclass indicates that a class has some dependency on
another data.
NoSuchFieldError In case an application tries to access or modify a specified field
of an object, and after it, that object no longer has this field.

OutOfMemoryError In case JVM cannot allocate an object as it is out of memory,


such error is thrown that says no more memory could be made
available by the GC.
NoClassDefFoundError If a class loader instance or JVM, try to load in the class
definition and not found any class definition of the class.
ThreadDeath Its instance is thrown in the victim thread when in thread class,
the stop method with zero arguments is invoked.

NoSuchMethodError In case an application tries to call a specified method of a class


that can be either static or instance, and that class no longer
holds that method definition.

StackOverflowError When a stack overflow occurs in an application because it has


recursed too deeply.
UnsatisfiedLinkError In case JVM is unable to find an appropriate native language for
a native method definition.
VirtualMachineError Indicate that the JVM is broken or has run out of resources,
essential for continuing operating.
UnsupportedClassVersionError When the JVM attempts to read a class file and get to know that
the major & minor version numbers in the file are
unsupportable.
UnknownError In case a serious exception that is unknown has occurred in the
JVM.
VerifyError When it is found that a class file that is well-formed although
contains some sort of internal inconsistency or security problem
by the verifier.

FIDS API Document Jaringan Nadi Teknologi Sdn. Bhd. Page 85


Commercial in Confidence

You might also like