Back to home page

Enduro/X

 
 

    


0001 /**
0002  * @brief Command with prefix config. Supported commands:
0003  *   1. config.load     - for first time
0004  *   2. config.reload   - for configuration re-load
0005  *
0006  * @file cmd_config.c
0007  */
0008 /* -----------------------------------------------------------------------------
0009  * Enduro/X Middleware Platform for Distributed Transaction Processing
0010  * Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0011  * Copyright (C) 2017-2023, Mavimax, Ltd. All Rights Reserved.
0012  * This software is released under one of the following licenses:
0013  * AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
0014  * See LICENSE file for full text.
0015  * -----------------------------------------------------------------------------
0016  * AGPL license:
0017  *
0018  * This program is free software; you can redistribute it and/or modify it under
0019  * the terms of the GNU Affero General Public License, version 3 as published
0020  * by the Free Software Foundation;
0021  *
0022  * This program is distributed in the hope that it will be useful, but WITHOUT ANY
0023  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0024  * PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
0025  * for more details.
0026  *
0027  * You should have received a copy of the GNU Affero General Public License along 
0028  * with this program; if not, write to the Free Software Foundation, Inc.,
0029  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0030  *
0031  * -----------------------------------------------------------------------------
0032  * A commercial use license is available from Mavimax, Ltd
0033  * contact@mavimax.com
0034  * -----------------------------------------------------------------------------
0035  */
0036 #include <string.h>
0037 #include <stdio.h>
0038 #include <stdlib.h>
0039 #include <memory.h>
0040 
0041 #include <ndrstandard.h>
0042 
0043 #include "ndebug.h"
0044 #include "userlog.h"
0045 #include <ndrxd.h>
0046 #include <cmd_processor.h>
0047 /*---------------------------Externs------------------------------------*/
0048 /*---------------------------Macros-------------------------------------*/
0049 /*---------------------------Enums--------------------------------------*/
0050 /*---------------------------Typedefs-----------------------------------*/
0051 /*---------------------------Globals------------------------------------*/
0052 /*---------------------------Statics------------------------------------*/
0053 /*---------------------------Prototypes---------------------------------*/
0054 
0055 /**
0056  * Commad for loading initial configuration.
0057  * If initial config is set, then just respond with OK.
0058  * @param args
0059  * @return 
0060  */
0061 expublic int cmd_config_load (command_call_t * call, char *data, size_t len, int context)
0062 {
0063     int ret=EXSUCCEED;
0064 
0065     /*
0066     ret = load_active_config(&G_app_config, &G_process_model,
0067                 &G_process_model_hash, &G_process_model_pid_hash);
0068     */
0069     ret = load_active_config_live();
0070     
0071     if (EXSUCCEED!=simple_command_reply(call, ret, 0L, NULL, NULL, 0, 0, NULL))
0072     {
0073         userlog("Failed to send reply back to [%s]", call->reply_queue);
0074     }
0075 
0076     NDRX_LOG(log_warn, "cmd_config_load returns with status %d", ret);
0077     
0078     return EXSUCCEED; /* Do not want to break the system! */
0079 }
0080 
0081 /* vim: set ts=4 sw=4 et smartindent: */