concept leg in category java

This is an excerpt from Manning's book Spring Integration in Action.
In our Spring Integration travel example application, a quotation request for a trip may contain multiple legs. Once the trip is split into legs, the message flow needs to generate quotation requests for the different elements of the trip, such as the hotel accommodation and car rental. To do this, you must separate the constituent parts of the trip relating to hotel, flight, and car rental before transforming the internal canonical representation to one that is understood by the third-party systems. One approach is to maintain a number of Java payload types representing the request formats of each individual system and a set of transformations between the canonical form and the third-party form. This task can become unwieldy as the number of systems with which you integrate grows. The request format of the third-party system is likely to be some form of XML, so the process of generating a quote for each leg of the trip should be implemented as an XML-based message flow.
The trigger for the leg-quote-generation flow is the receipt of a message containing a LegQuoteCommand. It contains the requirements for the start and end locations of the leg, the desired dates for travel, and additional specifications for hotel and car rental if required. On receipt of this message, the system first converts it into the canonical XML form of a trip leg. XSLT is then used to add the leg information to each criteria section prior to splitting. Having duplicated the leg information to each criteria section, you can then split the document into separate requests. Since the requests are now self-contained, they can then be processed in parallel, a common strategy for speeding up the overall processing of requests. In this case the splitting is achieved by the use of XPath, which splits the document into one document per child of the legQuote element. The leg-quote flow can then process each request in parallel and route it to the appropriate third-party system. Again, this is done using an XPath expression, which routes the message according to the route element name. Finally, before making a request to the third-party system, you validate that each request conforms to the schema that defines the third-party request format. This is achieved by using the out-of-the-box support for validating messages against an XML schema definition.
Now that the leg quote is in the canonical form, the next step is to transform the XML document to ensure that it can then be split into three separate requests ready to send to the external systems. These external systems then provide the quotes for car rentals, hotels, and flights. Currently, the elements containing information about start and end locations and dates are child elements of the root legQuote element. Therefore, the next step in the message flow is to use an XSLT to add the leg information to the criteria elements and rename them. To achieve this, you use the following XSL: