Factory_SI Migration
available starting proxy v.29.0



Background information

APIv2 is moving to a new architecture for opening and closing conversation: the way your application connects to the Amadeus Central System will change.
Your application needs to be updated to use the createConversationFactory_SI() functions. This is a technical change required by Amadeus to prepare for the new architecture we are deploying. The changes on your application's side can be done at anytime, but please keep in mind that, after a migration period where the previous and the new open mechanism co-exist, only the createConversationFactory_SI() method will be available from Proxy-32 onward.


 CaiErr CAI_createConversationFactory_SI (
	CAI_Connection_SI  
  	CAI_Authentication 
	CAI_ConversationFactory 

*in_connection,
*in_authentication, 
**o_factory);

You can migrate to this new function at anytime, and we recommend you to do it ASAP. Once you start using the new CAI_createConversationFactory_SI() function, everything will continue to work as before, as this new function supports both the current and the future way of connecting to Amadeus.
In fact, we recommend using the CAI_getConnectionInfoFromIni() function as well. By using these two functions, when the new Amadeus architecture is ready, all you will have to do is update the configuration file.

Important: Please note that there is no new function to replace the existing CAI_openConversationByCorporateID() as this function will disappear.
Users of the CAI_openConversationByCorporateID() must update their application and use the conversation factory.

Warning: Starting with Proxy-32, which will be the first Proxy to be relased in 2006, the traditional CAI_openConversationByCorporateID() and CAI_createConversationFactory functions will no longer exist.
If you want to benefit from the new functionalities introduced with the Proxy-32 and beyond, you have to migrate to the new CAI_createConversationFactory_SI() method.


Purpose of this migration

We need to make these changes to offer the possibility to specify the OfficeID when opening the conversation from the factory. Today, an OfficeID is associated to a user. In order to use several OfficeID, APIv2 users often define many users, with the user-name being equal to the OfficeID.
Once the new feature is available on Amadeus' side, APIv2 customers using the CAI_createConversationFactory_SI() will be able to define only ONE user, and then specify the OfficeID when opening the conversation from the factory.

Benefits:

  • Simpler, easier to manage list of userIDs.
  • Instead of maintaining one conversation factory per OfficeID, you will be able to create only one factory, since you will specify the officeID when opening the conversation.



  • Updating your application - A practical example

    Here are two samples of code, a "before" and an "after".
    For highlighting purposes, the lines that are changed are in bold.

    Before:
    
        CaiErr 			cai_err	= CAI_OK;
        CAI_Conversation	*conversation = NULL;
        CAI_CustomSign		customsign;
        CAI_Connection		connection;
        CAI_Authentication	authentication;
        CAI_OpenType		open_type;
        CAI_ConversationFactory	*factory = NULL;
    
        printf("*****************************************************\n");
        printf("*  Creating the conversation Factory ...            *\n");
        printf("*****************************************************\n");
    
        CAI_initCustomSign(&customsign);
        CAI_initConnection(&connection);
        CAI_initAuthentication(&authentication);
        CAI_initOpenType(&open_type);
    
        /* Initialize the connection parameters */
        connection.port_number = 12345;
        connection.tcp_server  = (unsigned char *) "Server";
        
        authentication.corporate_id = (unsigned char *) "Corpo";
        authentication.user_id =      (unsigned char *) "User";
        authentication.password =     (unsigned char *) "Secret";
    
        open_type.bind_host_resource = 0;                           /* Fast Open */
        open_type.custom_sign = &customsign;
    
        cai_err = CAI_createConversationFactory(&connection, &authentication, &factory);   
        checkErr(cai_err, "createConversationFactory", NULL, &factory, NULL);
    	
    
        printf("*****************************************************\n");
        printf("*  Opening a conversation from the Factory ...      *\n");
        printf("*****************************************************\n");
    
        cai_err = CAI_openConversationFromFactory(factory, &open_type, &conversation);
        checkErr(cai_err, "openConversationFromFactory", &conversation, &factory, NULL);
    

    After:
    
        CaiErr 			cai_err	= CAI_OK;
        CAI_Conversation	*conversation = NULL;
        CAI_CustomSign		customsign;
        CAI_Connection_SI	connection;
        CAI_Authentication	authentication;
        CAI_OpenType		open_type;
        CAI_ConversationFactory	*factory = NULL;
    
        printf("*****************************************************\n");
        printf("*  Creating the conversation Factory ...            *\n");
        printf("*****************************************************\n");
    
        CAI_initCustomSign(&customsign);
        CAI_initConnection_SI(&connection);
        CAI_initAuthentication(&authentication);
        CAI_initOpenType(&open_type);
    
        /* Initialize the connection parameters */
        cai_err = CAI_getConnectionInfoFromINI(iniFile, &connection);
        checkErr(cai_err, "getConnectionInfoFromINI", NULL, NULL, NULL);
        
        authentication.corporate_id = (unsigned char *) "Corpo";        /* no longer needed */
        authentication.user_id =      (unsigned char *) "User";
        authentication.password =     (unsigned char *) "Secret";
    
        open_type.bind_host_resource = 0;                               /* no longer needed */
        open_type.custom_sign = &customsign;
    
        cai_err = CAI_createConversationFactory_SI(&connection, &authentication, &factory);
        checkErr(cai_err, "createConversationFactory", NULL, &factory, NULL);
    	
    
        printf("*****************************************************\n");
        printf("*  Opening a conversation from the Factory ...      *\n");
        printf("*****************************************************\n");
    
        cai_err = CAI_openConversationFromFactory(factory, &open_type, &conversation);
        checkErr(cai_err, "openConversationFromFactory", &conversation, &factory, NULL);
    


    Example of a .INI file:
    
        # This is an example of ini file to Connect to the Amadeus test system. 
    
        # TCP/IP Connection information
        [CAI_Connection_SI]
        tcp_connection_type = 0        ; type 0 connection to Gateway
        tcp_connection_nb = 1
    
        [CAI_Connection0]
        tcp_server = 195.27.163.89
        port_number = 20002
    
        # Custom sign information (empty)
        [CAI_CustomSign]
    


    The modified code works with both the current and the new architecture Amadeus is putting in place in Central System.
    Once the new architecture is in place, you will be able to improve your application by specifying the officeID just before opening the conversation by adding the following code:
    
        cai_err = CAI_getCustomSignInfoFromINI(iniFile, "OfficeA", &customsign);
        open_type.custom_sign = &customsign;