1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 /////////////////////////////////////////////////////////////////
18 // WARNING : this is a generated file, don't change it !
19 /////////////////////////////////////////////////////////////////
21 #ifndef ADMIN_MODULES_ITF
22 #define ADMIN_MODULES_ITF
23 #include "nel/misc/types_nl.h"
25 #include "nel/misc/hierarchical_timer.h"
26 #include "nel/misc/string_conversion.h"
27 #include "nel/net/message.h"
28 #include "nel/net/module.h"
29 #include "nel/net/module_builder_parts.h"
30 #include "nel/net/module_message.h"
31 #include "nel/net/module_gateway.h"
33 #include "game_share/callback_adaptor.h"
35 #include "nel/misc/time_nl.h"
50 // This is the interface used by PHP to call methods
51 // on the Admin service module
53 class CAdminServiceWebItf
57 /// the callback server adaptor
58 CUniquePtr
<ICallbackServerAdaptor
> _CallbackServer
;
60 void getCallbakArray(NLNET::TCallbackItem
*&arrayPtr
, uint32
&arraySize
)
62 static NLNET::TCallbackItem callbackArray
[] =
64 { "GCMD", CAdminServiceWebItf::cb_globalCmd
},
65 { "CCMD", CAdminServiceWebItf::cb_controlCmd
},
66 { "SCMD", CAdminServiceWebItf::cb_serviceCmd
},
67 { "GSO", CAdminServiceWebItf::cb_getShardOrders
},
68 { "GS", CAdminServiceWebItf::cb_getStates
},
69 { "GHRGI", CAdminServiceWebItf::cb_getHighRezGraphInfo
},
70 { "GHRG", CAdminServiceWebItf::cb_getHighRezGraph
},
74 arrayPtr
= callbackArray
;
75 arraySize
= sizeofarray(callbackArray
);
78 static void _cbConnection(NLNET::TSockId from
, void *arg
)
80 H_AUTO(CAdminServiceWeb__cbConnection
);
81 CAdminServiceWebItf
*_this
= reinterpret_cast<CAdminServiceWebItf
*>(arg
);
83 _this
->on_CAdminServiceWeb_Connection(from
);
86 static void _cbDisconnection(NLNET::TSockId from
, void *arg
)
88 H_AUTO(CAdminServiceWeb__cbDisconnection
);
89 CAdminServiceWebItf
*_this
= reinterpret_cast<CAdminServiceWebItf
*>(arg
);
91 _this
->on_CAdminServiceWeb_Disconnection(from
);
96 /** Constructor, if you specify a replacement adaptor, then the object
97 * become owner of the adaptor (and it will be released with the
100 CAdminServiceWebItf(ICallbackServerAdaptor
*replacementAdaptor
= NULL
)
102 if (replacementAdaptor
== NULL
)
104 // use default callback server
105 _CallbackServer
= CUniquePtr
<ICallbackServerAdaptor
>(new CNelCallbackServerAdaptor(this));
109 // use the replacement one
110 _CallbackServer
= CUniquePtr
<ICallbackServerAdaptor
>(replacementAdaptor
);
114 virtual ~CAdminServiceWebItf()
118 /// Open the interface socket in the specified port
119 void openItf(uint16 port
)
121 NLNET::TCallbackItem
*arrayPtr
;
126 getCallbakArray(arrayPtr
, arraySize
);
127 _CallbackServer
->addCallbackArray(arrayPtr
, arraySize
);
129 _CallbackServer
->setConnectionCallback (_cbConnection
, this);
130 _CallbackServer
->setDisconnectionCallback (_cbDisconnection
, this);
132 _CallbackServer
->init(port
);
135 /** Must be called evenly, update the network subclass to receive message
136 * and dispatch method invokation.
140 H_AUTO(CAdminServiceWeb_update
);
144 _CallbackServer
->update();
148 nlwarning("CAdminServiceWeb : Exception launch in callback server update");
153 void commandResult(NLNET::TSockId dest
, const std::string
&serviceAlias
, const std::string
&result
)
155 H_AUTO(commandResult_commandResult
);
157 nldebug("CAdminServiceWeb::commandResult called");
159 NLNET::CMessage
message("CMDR");
160 nlWrite(message
, serial
, const_cast < std::string
& > (serviceAlias
));
161 nlWrite(message
, serial
, const_cast < std::string
& > (result
));
163 _CallbackServer
->send(message
, dest
);
166 static void cb_globalCmd (NLNET::CMessage
&message
, NLNET::TSockId from
, NLNET::CCallbackNetBase
&netbase
)
168 H_AUTO(globalCmd_on_globalCmd
);
170 nldebug("CAdminServiceWeb::cb_globalCmd received from class '%s'", typeid(netbase
).name());
172 ICallbackServerAdaptor
*adaptor
= static_cast< ICallbackServerAdaptor
*>(netbase
.getUserData());
174 CAdminServiceWebItf
*callback
= (CAdminServiceWebItf
*)adaptor
->getContainerClass();
176 if (callback
== NULL
)
179 nlRead(message
, serial
, command
);
183 nldebug("CAdminServiceWeb::cb_globalCmd : calling on_globalCmd");
187 callback
->on_globalCmd(from
, command
);
191 static void cb_controlCmd (NLNET::CMessage
&message
, NLNET::TSockId from
, NLNET::CCallbackNetBase
&netbase
)
193 H_AUTO(controlCmd_on_controlCmd
);
195 nldebug("CAdminServiceWeb::cb_controlCmd received from class '%s'", typeid(netbase
).name());
197 ICallbackServerAdaptor
*adaptor
= static_cast< ICallbackServerAdaptor
*>(netbase
.getUserData());
199 CAdminServiceWebItf
*callback
= (CAdminServiceWebItf
*)adaptor
->getContainerClass();
201 if (callback
== NULL
)
203 std::string serviceAlias
;
205 nlRead(message
, serial
, serviceAlias
);
206 nlRead(message
, serial
, command
);
210 nldebug("CAdminServiceWeb::cb_controlCmd : calling on_controlCmd");
214 callback
->on_controlCmd(from
, serviceAlias
, command
);
218 static void cb_serviceCmd (NLNET::CMessage
&message
, NLNET::TSockId from
, NLNET::CCallbackNetBase
&netbase
)
220 H_AUTO(serviceCmd_on_serviceCmd
);
222 nldebug("CAdminServiceWeb::cb_serviceCmd received from class '%s'", typeid(netbase
).name());
224 ICallbackServerAdaptor
*adaptor
= static_cast< ICallbackServerAdaptor
*>(netbase
.getUserData());
226 CAdminServiceWebItf
*callback
= (CAdminServiceWebItf
*)adaptor
->getContainerClass();
228 if (callback
== NULL
)
230 std::string serviceAlias
;
232 nlRead(message
, serial
, serviceAlias
);
233 nlRead(message
, serial
, command
);
237 nldebug("CAdminServiceWeb::cb_serviceCmd : calling on_serviceCmd");
241 callback
->on_serviceCmd(from
, serviceAlias
, command
);
245 static void cb_getShardOrders (NLNET::CMessage
&message
, NLNET::TSockId from
, NLNET::CCallbackNetBase
&netbase
)
247 H_AUTO(getShardOrders_on_getShardOrders
);
249 nldebug("CAdminServiceWeb::cb_getShardOrders received from class '%s'", typeid(netbase
).name());
251 ICallbackServerAdaptor
*adaptor
= static_cast< ICallbackServerAdaptor
*>(netbase
.getUserData());
253 CAdminServiceWebItf
*callback
= (CAdminServiceWebItf
*)adaptor
->getContainerClass();
255 if (callback
== NULL
)
260 nldebug("CAdminServiceWeb::cb_getShardOrders : calling on_getShardOrders");
263 std::vector
<std::string
> retValue
;
265 retValue
= callback
->on_getShardOrders(from
);
267 NLNET::CMessage
retMsg("R_GSO");
269 nlWrite(retMsg
, serialCont
, retValue
);
272 callback
->_CallbackServer
->send(retMsg
, from
);
276 static void cb_getStates (NLNET::CMessage
&message
, NLNET::TSockId from
, NLNET::CCallbackNetBase
&netbase
)
278 H_AUTO(getStates_on_getStates
);
280 nldebug("CAdminServiceWeb::cb_getStates received from class '%s'", typeid(netbase
).name());
282 ICallbackServerAdaptor
*adaptor
= static_cast< ICallbackServerAdaptor
*>(netbase
.getUserData());
284 CAdminServiceWebItf
*callback
= (CAdminServiceWebItf
*)adaptor
->getContainerClass();
286 if (callback
== NULL
)
291 nldebug("CAdminServiceWeb::cb_getStates : calling on_getStates");
294 std::vector
<std::string
> retValue
;
296 retValue
= callback
->on_getStates(from
);
298 NLNET::CMessage
retMsg("R_GS");
300 nlWrite(retMsg
, serialCont
, retValue
);
303 callback
->_CallbackServer
->send(retMsg
, from
);
307 static void cb_getHighRezGraphInfo (NLNET::CMessage
&message
, NLNET::TSockId from
, NLNET::CCallbackNetBase
&netbase
)
309 H_AUTO(getHighRezGraphInfo_on_getHighRezGraphInfo
);
311 nldebug("CAdminServiceWeb::cb_getHighRezGraphInfo received from class '%s'", typeid(netbase
).name());
313 ICallbackServerAdaptor
*adaptor
= static_cast< ICallbackServerAdaptor
*>(netbase
.getUserData());
315 CAdminServiceWebItf
*callback
= (CAdminServiceWebItf
*)adaptor
->getContainerClass();
317 if (callback
== NULL
)
320 nlRead(message
, serial
, varAddr
);
324 nldebug("CAdminServiceWeb::cb_getHighRezGraphInfo : calling on_getHighRezGraphInfo");
327 std::vector
<std::string
> retValue
;
329 retValue
= callback
->on_getHighRezGraphInfo(from
, varAddr
);
331 NLNET::CMessage
retMsg("R_GHRGI");
333 nlWrite(retMsg
, serialCont
, retValue
);
336 callback
->_CallbackServer
->send(retMsg
, from
);
340 static void cb_getHighRezGraph (NLNET::CMessage
&message
, NLNET::TSockId from
, NLNET::CCallbackNetBase
&netbase
)
342 H_AUTO(getHighRezGraph_on_getHighRezGraph
);
344 nldebug("CAdminServiceWeb::cb_getHighRezGraph received from class '%s'", typeid(netbase
).name());
346 ICallbackServerAdaptor
*adaptor
= static_cast< ICallbackServerAdaptor
*>(netbase
.getUserData());
348 CAdminServiceWebItf
*callback
= (CAdminServiceWebItf
*)adaptor
->getContainerClass();
350 if (callback
== NULL
)
356 nlRead(message
, serial
, varAddr
);
357 nlRead(message
, serial
, startDate
);
358 nlRead(message
, serial
, endDate
);
359 nlRead(message
, serial
, milliStep
);
363 nldebug("CAdminServiceWeb::cb_getHighRezGraph : calling on_getHighRezGraph");
366 std::vector
<std::string
> retValue
;
368 retValue
= callback
->on_getHighRezGraph(from
, varAddr
, startDate
, endDate
, milliStep
);
370 NLNET::CMessage
retMsg("R_GHRG");
372 nlWrite(retMsg
, serialCont
, retValue
);
375 callback
->_CallbackServer
->send(retMsg
, from
);
380 /// Connection callback : a new interface client connect
381 virtual void on_CAdminServiceWeb_Connection(NLNET::TSockId from
) =0;
382 /// Disconnection callback : one of the interface client disconnect
383 virtual void on_CAdminServiceWeb_Disconnection(NLNET::TSockId from
) =0;
386 // Send a command to the AS.
387 // This is used to issue global commands like 'as.allStart' or 'as.allStop'.
388 // The result is returned by the return message
390 virtual void on_globalCmd(NLNET::TSockId from
, const std::string
&command
) =0;
392 // Send a service related command to the executor
393 // (not to the controled service)
394 // The result is returned by the return message
396 virtual void on_controlCmd(NLNET::TSockId from
, const std::string
&serviceAlias
, const std::string
&command
) =0;
398 // Send a command to a service.
399 // The result is returned by the return message
401 virtual void on_serviceCmd(NLNET::TSockId from
, const std::string
&serviceAlias
, const std::string
&command
) =0;
403 // Get the orders of each known shard.
404 // The return value is a vector of string, one entry by shard
405 virtual std::vector
<std::string
> on_getShardOrders(NLNET::TSockId from
) =0;
407 // Get the last known state of all services.
408 // The return value is a vector of string, one entry by service
409 virtual std::vector
<std::string
> on_getStates(NLNET::TSockId from
) =0;
411 // Get information about a high rez graph.
412 // The return is a string array containing
413 // the name of the var, the available sample
414 // period as two unix date (start dans end)
415 // and the number of samples available
416 // If the var is not found, an empty array is returned
417 virtual std::vector
<std::string
> on_getHighRezGraphInfo(NLNET::TSockId from
, const std::string
&varAddr
) =0;
419 // Get the data for a high resolution graph.
420 // The return is a string array, each
421 // string containing 'time:milliOffset:value
422 // Set endDate to 0 to specify a start date relative
423 // to the last sample date. In this case, start date
424 // is interpreted as the number of second before
426 virtual std::vector
<std::string
> on_getHighRezGraph(NLNET::TSockId from
, const std::string
&varAddr
, uint32 startDate
, uint32 endDate
, uint32 milliStep
) =0;
430 // This is the interface used by PHP to call methods
431 // on the Admin service module
433 /** This is the client side of the interface
434 * Derive from this class to invoke method on the callback server
437 class CAdminServiceWebClientItf
441 /// the callback client adaptor
442 CUniquePtr
< ICallbackClientAdaptor
> _CallbackClient
;
445 void getCallbakArray(NLNET::TCallbackItem
*&arrayPtr
, uint32
&arraySize
)
448 static NLNET::TCallbackItem callbackArray
[] =
450 { "CMDR", CAdminServiceWebClientItf::cb_commandResult
},
454 arrayPtr
= callbackArray
;
455 arraySize
= sizeofarray(callbackArray
);
459 static void _cbDisconnection(NLNET::TSockId from
, void *arg
)
461 CAdminServiceWebClientItf
*_this
= reinterpret_cast<CAdminServiceWebClientItf
*>(arg
);
463 _this
->on_CAdminServiceWebClient_Disconnection(from
);
468 /// Retreive the message name for a given callback name
469 static const std::string
&getMessageName(const std::string
&methodName
)
471 static std::map
<std::string
, std::string
> messageNames
;
472 static bool initialized
= false;
475 messageNames
.insert(std::make_pair(std::string("on_commandResult"), std::string("CMDR")));
480 std::map
< std::string
, std::string
>::const_iterator
it(messageNames
.find(methodName
));
481 if (it
!= messageNames
.end())
485 static std::string emptyString
;
491 CAdminServiceWebClientItf(ICallbackClientAdaptor
*adaptorReplacement
= NULL
)
493 if (adaptorReplacement
== NULL
)
495 // use the default Nel adaptor
496 _CallbackClient
= CUniquePtr
< ICallbackClientAdaptor
>(new CNelCallbackClientAdaptor(this));
500 // use the replacement one
501 _CallbackClient
= CUniquePtr
< ICallbackClientAdaptor
>(adaptorReplacement
);
505 /// Connect the interface client to the callback server at the specified address and port
506 virtual void connectItf(NLNET::CInetAddress address
)
508 NLNET::TCallbackItem
*arrayPtr
;
511 static bool callbackAdded
= false;
515 getCallbakArray(arrayPtr
, arraySize
);
516 _CallbackClient
->addCallbackArray(arrayPtr
, arraySize
);
519 _CallbackClient
->setDisconnectionCallback (_cbDisconnection
, this);
521 _CallbackClient
->connect(address
);
524 /** Must be called evenly, update the network subclass to receive message
525 * and dispatch invokation returns.
527 virtual void update()
529 H_AUTO(CAdminServiceWeb_update
);
533 _CallbackClient
->update();
537 nlwarning("CAdminServiceWeb : Exception launch in callback client update");
541 // Send a command to the AS.
542 // This is used to issue global commands like 'as.allStart' or 'as.allStop'.
543 // The result is returned by the return message
546 void globalCmd(const std::string
&command
)
549 nldebug("CAdminServiceWebClient::globalCmd called");
551 NLNET::CMessage
message("GCMD");
552 nlWrite(message
, serial
, const_cast < std::string
& > (command
));
554 _CallbackClient
->send(message
);
556 // Send a service related command to the executor
557 // (not to the controled service)
558 // The result is returned by the return message
561 void controlCmd(const std::string
&serviceAlias
, const std::string
&command
)
564 nldebug("CAdminServiceWebClient::controlCmd called");
566 NLNET::CMessage
message("CCMD");
567 nlWrite(message
, serial
, const_cast < std::string
& > (serviceAlias
));
568 nlWrite(message
, serial
, const_cast < std::string
& > (command
));
570 _CallbackClient
->send(message
);
572 // Send a command to a service.
573 // The result is returned by the return message
576 void serviceCmd(const std::string
&serviceAlias
, const std::string
&command
)
579 nldebug("CAdminServiceWebClient::serviceCmd called");
581 NLNET::CMessage
message("SCMD");
582 nlWrite(message
, serial
, const_cast < std::string
& > (serviceAlias
));
583 nlWrite(message
, serial
, const_cast < std::string
& > (command
));
585 _CallbackClient
->send(message
);
587 // Get the orders of each known shard.
588 // The return value is a vector of string, one entry by shard
590 void getShardOrders()
593 nldebug("CAdminServiceWebClient::getShardOrders called");
595 NLNET::CMessage
message("GSO");
597 _CallbackClient
->send(message
);
599 // Get the last known state of all services.
600 // The return value is a vector of string, one entry by service
605 nldebug("CAdminServiceWebClient::getStates called");
607 NLNET::CMessage
message("GS");
609 _CallbackClient
->send(message
);
611 // Get information about a high rez graph.
612 // The return is a string array containing
613 // the name of the var, the available sample
614 // period as two unix date (start dans end)
615 // and the number of samples available
616 // If the var is not found, an empty array is returned
618 void getHighRezGraphInfo(const std::string
&varAddr
)
621 nldebug("CAdminServiceWebClient::getHighRezGraphInfo called");
623 NLNET::CMessage
message("GHRGI");
624 nlWrite(message
, serial
, const_cast < std::string
& > (varAddr
));
626 _CallbackClient
->send(message
);
628 // Get the data for a high resolution graph.
629 // The return is a string array, each
630 // string containing 'time:milliOffset:value
631 // Set endDate to 0 to specify a start date relative
632 // to the last sample date. In this case, start date
633 // is interpreted as the number of second before
636 void getHighRezGraph(const std::string
&varAddr
, uint32 startDate
, uint32 endDate
, uint32 milliStep
)
639 nldebug("CAdminServiceWebClient::getHighRezGraph called");
641 NLNET::CMessage
message("GHRG");
642 nlWrite(message
, serial
, const_cast < std::string
& > (varAddr
));
643 nlWrite(message
, serial
, startDate
);
644 nlWrite(message
, serial
, endDate
);
645 nlWrite(message
, serial
, milliStep
);
647 _CallbackClient
->send(message
);
650 static void cb_commandResult (NLNET::CMessage
&message
, NLNET::TSockId from
, NLNET::CCallbackNetBase
&netbase
)
653 nldebug("CAdminServiceWebClient::cb_commandResult received from class '%s'", typeid(netbase
).name());
655 ICallbackClientAdaptor
*adaptor
= static_cast< ICallbackClientAdaptor
*>(netbase
.getUserData());
657 CAdminServiceWebClientItf
*callback
= (CAdminServiceWebClientItf
*)adaptor
->getContainerClass();
659 if (callback
== NULL
)
661 std::string serviceAlias
;
663 nlRead(message
, serial
, serviceAlias
);
664 nlRead(message
, serial
, result
);
668 nldebug("CAdminServiceWebClient::cb_commandResult : calling on_commandResult");
671 callback
->on_commandResult(from
, serviceAlias
, result
);
675 /// Disconnection callback : the connection to the server is lost
676 virtual void on_CAdminServiceWebClient_Disconnection(NLNET::TSockId from
) =0;
679 virtual void on_commandResult(NLNET::TSockId from
, const std::string
&serviceAlias
, const std::string
&result
) =0;
682 /////////////////////////////////////////////////////////////////
683 // WARNING : this is a generated file, don't change it !
684 /////////////////////////////////////////////////////////////////
689 std::string _ServiceAlias
;
691 std::string _VarName
;
693 uint32 _SamplePeriod
;
698 const std::string
&getServiceAlias() const
700 return _ServiceAlias
;
703 std::string
&getServiceAlias()
705 return _ServiceAlias
;
709 void setServiceAlias(const std::string
&value
)
713 _ServiceAlias
= value
;
718 const std::string
&getVarName() const
723 std::string
&getVarName()
729 void setVarName(const std::string
&value
)
738 uint32
getSamplePeriod() const
740 return _SamplePeriod
;
743 void setSamplePeriod(uint32 value
)
746 _SamplePeriod
= value
;
750 double getValue() const
755 void setValue(double value
)
762 bool operator == (const TGraphData
&other
) const
764 return _ServiceAlias
== other
._ServiceAlias
765 && _VarName
== other
._VarName
766 && _SamplePeriod
== other
._SamplePeriod
767 && _Value
== other
._Value
;
777 void serial(NLMISC::IStream
&s
)
779 s
.serial(_ServiceAlias
);
781 s
.serial(_SamplePeriod
);
793 /////////////////////////////////////////////////////////////////
794 // WARNING : this is a generated file, don't change it !
795 /////////////////////////////////////////////////////////////////
802 std::vector
< TGraphData
> _Datas
;
805 uint32
getCurrentTime() const
810 void setCurrentTime(uint32 value
)
813 _CurrentTime
= value
;
817 const std::vector
< TGraphData
> &getDatas() const
822 std::vector
< TGraphData
> &getDatas()
828 void setDatas(const std::vector
< TGraphData
> &value
)
837 bool operator == (const TGraphDatas
&other
) const
839 return _CurrentTime
== other
._CurrentTime
840 && _Datas
== other
._Datas
;
850 void serial(NLMISC::IStream
&s
)
852 s
.serial(_CurrentTime
);
853 s
.serialCont(_Datas
);
864 /////////////////////////////////////////////////////////////////
865 // WARNING : this is a generated file, don't change it !
866 /////////////////////////////////////////////////////////////////
871 NLMISC::TTime _SampleTick
;
876 NLMISC::TTime
getSampleTick() const
881 void setSampleTick(NLMISC::TTime value
)
888 double getValue() const
893 void setValue(double value
)
900 bool operator == (const THighRezData
&other
) const
902 return _SampleTick
== other
._SampleTick
903 && _Value
== other
._Value
;
913 void serial(NLMISC::IStream
&s
)
915 s
.serial(_SampleTick
);
927 /////////////////////////////////////////////////////////////////
928 // WARNING : this is a generated file, don't change it !
929 /////////////////////////////////////////////////////////////////
934 std::string _ServiceAlias
;
936 std::string _VarName
;
940 std::vector
< THighRezData
> _Datas
;
943 const std::string
&getServiceAlias() const
945 return _ServiceAlias
;
948 std::string
&getServiceAlias()
950 return _ServiceAlias
;
954 void setServiceAlias(const std::string
&value
)
958 _ServiceAlias
= value
;
963 const std::string
&getVarName() const
968 std::string
&getVarName()
974 void setVarName(const std::string
&value
)
983 uint32
getCurrentTime() const
988 void setCurrentTime(uint32 value
)
991 _CurrentTime
= value
;
995 const std::vector
< THighRezData
> &getDatas() const
1000 std::vector
< THighRezData
> &getDatas()
1006 void setDatas(const std::vector
< THighRezData
> &value
)
1015 bool operator == (const THighRezDatas
&other
) const
1017 return _ServiceAlias
== other
._ServiceAlias
1018 && _VarName
== other
._VarName
1019 && _CurrentTime
== other
._CurrentTime
1020 && _Datas
== other
._Datas
;
1030 void serial(NLMISC::IStream
&s
)
1032 s
.serial(_ServiceAlias
);
1034 s
.serial(_CurrentTime
);
1035 s
.serialCont(_Datas
);
1054 /// the highest valid value in the enum
1055 last_enum_item
= so_autostart_off
,
1056 /// a value equal to the last enum item +1
1061 /// Number of enumerated values
1065 /// Index table to convert enum value to linear index table
1066 const std::map
<TValues
, uint32
> &getIndexTable() const
1068 static std::map
<TValues
, uint32
> indexTable
;
1069 static bool init
= false;
1072 // fill the index table
1073 indexTable
.insert(std::make_pair(so_autostart_on
, 0));
1074 indexTable
.insert(std::make_pair(so_autostart_off
, 1));
1083 static const NLMISC::CStringConversion
<TValues
> &getConversionTable()
1085 NL_BEGIN_STRING_CONVERSION_TABLE(TValues
)
1086 NL_STRING_CONVERSION_TABLE_ENTRY(so_autostart_on
)
1087 NL_STRING_CONVERSION_TABLE_ENTRY(so_autostart_off
)
1088 NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val
)
1090 static NLMISC::CStringConversion
<TValues
>
1091 conversionTable(TValues_nl_string_conversion_table
, sizeof(TValues_nl_string_conversion_table
)
1092 / sizeof(TValues_nl_string_conversion_table
[0]), invalid_val
);
1094 return conversionTable
;
1101 : _Value(invalid_val
)
1104 TShardOrders(TValues value
)
1109 TShardOrders(const std::string
&str
)
1111 _Value
= getConversionTable().fromString(str
);
1114 void serial(NLMISC::IStream
&s
)
1116 s
.serialEnum(_Value
);
1119 bool operator == (const TShardOrders
&other
) const
1121 return _Value
== other
._Value
;
1123 bool operator != (const TShardOrders
&other
) const
1125 return ! (_Value
== other
._Value
);
1127 bool operator < (const TShardOrders
&other
) const
1129 return _Value
< other
._Value
;
1132 bool operator <= (const TShardOrders
&other
) const
1134 return _Value
<= other
._Value
;
1137 bool operator > (const TShardOrders
&other
) const
1139 return !(_Value
<= other
._Value
);
1141 bool operator >= (const TShardOrders
&other
) const
1143 return !(_Value
< other
._Value
);
1146 const std::string
&toString() const
1148 return getConversionTable().toString(_Value
);
1150 static const std::string
&toString(TValues value
)
1152 return getConversionTable().toString(value
);
1155 TValues
getValue() const
1160 // return true if the actual value of the enum is valid, otherwise false
1163 if (_Value
== invalid_val
)
1166 // not invalid, check other enum value
1167 return getConversionTable().isValid(_Value
);
1173 std::map
<TValues
, uint32
>::const_iterator
it(getIndexTable().find(_Value
));
1174 nlassert(it
!= getIndexTable().end());
1181 struct TRunningOrders
1187 /// the highest valid value in the enum
1188 last_enum_item
= ro_activated
,
1189 /// a value equal to the last enum item +1
1194 /// Number of enumerated values
1198 /// Index table to convert enum value to linear index table
1199 const std::map
<TValues
, uint32
> &getIndexTable() const
1201 static std::map
<TValues
, uint32
> indexTable
;
1202 static bool init
= false;
1205 // fill the index table
1206 indexTable
.insert(std::make_pair(ro_deactivated
, 0));
1207 indexTable
.insert(std::make_pair(ro_activated
, 1));
1216 static const NLMISC::CStringConversion
<TValues
> &getConversionTable()
1218 NL_BEGIN_STRING_CONVERSION_TABLE(TValues
)
1219 NL_STRING_CONVERSION_TABLE_ENTRY(ro_deactivated
)
1220 NL_STRING_CONVERSION_TABLE_ENTRY(ro_activated
)
1221 NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val
)
1223 static NLMISC::CStringConversion
<TValues
>
1224 conversionTable(TValues_nl_string_conversion_table
, sizeof(TValues_nl_string_conversion_table
)
1225 / sizeof(TValues_nl_string_conversion_table
[0]), invalid_val
);
1227 return conversionTable
;
1234 : _Value(invalid_val
)
1237 TRunningOrders(TValues value
)
1242 TRunningOrders(const std::string
&str
)
1244 _Value
= getConversionTable().fromString(str
);
1247 void serial(NLMISC::IStream
&s
)
1249 s
.serialEnum(_Value
);
1252 bool operator == (const TRunningOrders
&other
) const
1254 return _Value
== other
._Value
;
1256 bool operator != (const TRunningOrders
&other
) const
1258 return ! (_Value
== other
._Value
);
1260 bool operator < (const TRunningOrders
&other
) const
1262 return _Value
< other
._Value
;
1265 bool operator <= (const TRunningOrders
&other
) const
1267 return _Value
<= other
._Value
;
1270 bool operator > (const TRunningOrders
&other
) const
1272 return !(_Value
<= other
._Value
);
1274 bool operator >= (const TRunningOrders
&other
) const
1276 return !(_Value
< other
._Value
);
1279 const std::string
&toString() const
1281 return getConversionTable().toString(_Value
);
1283 static const std::string
&toString(TValues value
)
1285 return getConversionTable().toString(value
);
1288 TValues
getValue() const
1293 // return true if the actual value of the enum is valid, otherwise false
1296 if (_Value
== invalid_val
)
1299 // not invalid, check other enum value
1300 return getConversionTable().isValid(_Value
);
1306 std::map
<TValues
, uint32
>::const_iterator
it(getIndexTable().find(_Value
));
1307 nlassert(it
!= getIndexTable().end());
1314 struct TRunningState
1321 /// the highest valid value in the enum
1322 last_enum_item
= rs_online
,
1323 /// a value equal to the last enum item +1
1328 /// Number of enumerated values
1332 /// Index table to convert enum value to linear index table
1333 const std::map
<TValues
, uint32
> &getIndexTable() const
1335 static std::map
<TValues
, uint32
> indexTable
;
1336 static bool init
= false;
1339 // fill the index table
1340 indexTable
.insert(std::make_pair(rs_stopped
, 0));
1341 indexTable
.insert(std::make_pair(rs_running
, 1));
1342 indexTable
.insert(std::make_pair(rs_online
, 2));
1351 static const NLMISC::CStringConversion
<TValues
> &getConversionTable()
1353 NL_BEGIN_STRING_CONVERSION_TABLE(TValues
)
1354 NL_STRING_CONVERSION_TABLE_ENTRY(rs_stopped
)
1355 NL_STRING_CONVERSION_TABLE_ENTRY(rs_running
)
1356 NL_STRING_CONVERSION_TABLE_ENTRY(rs_online
)
1357 NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val
)
1359 static NLMISC::CStringConversion
<TValues
>
1360 conversionTable(TValues_nl_string_conversion_table
, sizeof(TValues_nl_string_conversion_table
)
1361 / sizeof(TValues_nl_string_conversion_table
[0]), invalid_val
);
1363 return conversionTable
;
1370 : _Value(invalid_val
)
1373 TRunningState(TValues value
)
1378 TRunningState(const std::string
&str
)
1380 _Value
= getConversionTable().fromString(str
);
1383 void serial(NLMISC::IStream
&s
)
1385 s
.serialEnum(_Value
);
1388 bool operator == (const TRunningState
&other
) const
1390 return _Value
== other
._Value
;
1392 bool operator != (const TRunningState
&other
) const
1394 return ! (_Value
== other
._Value
);
1396 bool operator < (const TRunningState
&other
) const
1398 return _Value
< other
._Value
;
1401 bool operator <= (const TRunningState
&other
) const
1403 return _Value
<= other
._Value
;
1406 bool operator > (const TRunningState
&other
) const
1408 return !(_Value
<= other
._Value
);
1410 bool operator >= (const TRunningState
&other
) const
1412 return !(_Value
< other
._Value
);
1415 const std::string
&toString() const
1417 return getConversionTable().toString(_Value
);
1419 static const std::string
&toString(TValues value
)
1421 return getConversionTable().toString(value
);
1424 TValues
getValue() const
1429 // return true if the actual value of the enum is valid, otherwise false
1432 if (_Value
== invalid_val
)
1435 // not invalid, check other enum value
1436 return getConversionTable().isValid(_Value
);
1442 std::map
<TValues
, uint32
>::const_iterator
it(getIndexTable().find(_Value
));
1443 nlassert(it
!= getIndexTable().end());
1457 rt_globally_stopped
,
1458 rt_stopped_for_patch
,
1459 rt_externaly_started
,
1462 /// the highest valid value in the enum
1463 last_enum_item
= rt_slow_to_start
,
1464 /// a value equal to the last enum item +1
1469 /// Number of enumerated values
1473 /// Index table to convert enum value to linear index table
1474 const std::map
<TValues
, uint32
> &getIndexTable() const
1476 static std::map
<TValues
, uint32
> indexTable
;
1477 static bool init
= false;
1480 // fill the index table
1481 indexTable
.insert(std::make_pair(rt_chain_crashing
, 0));
1482 indexTable
.insert(std::make_pair(rt_locally_started
, 1));
1483 indexTable
.insert(std::make_pair(rt_locally_stopped
, 2));
1484 indexTable
.insert(std::make_pair(rt_globally_stopped
, 3));
1485 indexTable
.insert(std::make_pair(rt_stopped_for_patch
, 4));
1486 indexTable
.insert(std::make_pair(rt_externaly_started
, 5));
1487 indexTable
.insert(std::make_pair(rt_slow_to_stop
, 6));
1488 indexTable
.insert(std::make_pair(rt_slow_to_start
, 7));
1497 static const NLMISC::CStringConversion
<TValues
> &getConversionTable()
1499 NL_BEGIN_STRING_CONVERSION_TABLE(TValues
)
1500 NL_STRING_CONVERSION_TABLE_ENTRY(rt_chain_crashing
)
1501 NL_STRING_CONVERSION_TABLE_ENTRY(rt_locally_started
)
1502 NL_STRING_CONVERSION_TABLE_ENTRY(rt_locally_stopped
)
1503 NL_STRING_CONVERSION_TABLE_ENTRY(rt_globally_stopped
)
1504 NL_STRING_CONVERSION_TABLE_ENTRY(rt_stopped_for_patch
)
1505 NL_STRING_CONVERSION_TABLE_ENTRY(rt_externaly_started
)
1506 NL_STRING_CONVERSION_TABLE_ENTRY(rt_slow_to_stop
)
1507 NL_STRING_CONVERSION_TABLE_ENTRY(rt_slow_to_start
)
1508 NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val
)
1510 static NLMISC::CStringConversion
<TValues
>
1511 conversionTable(TValues_nl_string_conversion_table
, sizeof(TValues_nl_string_conversion_table
)
1512 / sizeof(TValues_nl_string_conversion_table
[0]), invalid_val
);
1514 return conversionTable
;
1521 : _Value(invalid_val
)
1524 TRunningTag(TValues value
)
1529 TRunningTag(const std::string
&str
)
1531 _Value
= getConversionTable().fromString(str
);
1534 void serial(NLMISC::IStream
&s
)
1536 s
.serialEnum(_Value
);
1539 bool operator == (const TRunningTag
&other
) const
1541 return _Value
== other
._Value
;
1543 bool operator != (const TRunningTag
&other
) const
1545 return ! (_Value
== other
._Value
);
1547 bool operator < (const TRunningTag
&other
) const
1549 return _Value
< other
._Value
;
1552 bool operator <= (const TRunningTag
&other
) const
1554 return _Value
<= other
._Value
;
1557 bool operator > (const TRunningTag
&other
) const
1559 return !(_Value
<= other
._Value
);
1561 bool operator >= (const TRunningTag
&other
) const
1563 return !(_Value
< other
._Value
);
1566 const std::string
&toString() const
1568 return getConversionTable().toString(_Value
);
1570 static const std::string
&toString(TValues value
)
1572 return getConversionTable().toString(value
);
1575 TValues
getValue() const
1580 // return true if the actual value of the enum is valid, otherwise false
1583 if (_Value
== invalid_val
)
1586 // not invalid, check other enum value
1587 return getConversionTable().isValid(_Value
);
1593 std::map
<TValues
, uint32
>::const_iterator
it(getIndexTable().find(_Value
));
1594 nlassert(it
!= getIndexTable().end());
1599 /////////////////////////////////////////////////////////////////
1600 // WARNING : this is a generated file, don't change it !
1601 /////////////////////////////////////////////////////////////////
1602 class TServiceStatus
1606 std::string _ShardName
;
1608 std::string _ServiceLongName
;
1610 std::string _ServiceShortName
;
1612 std::string _ServiceAliasName
;
1614 TRunningState _RunningState
;
1616 TRunningOrders _RunningOrders
;
1618 std::set
< TRunningTag
> _RunningTags
;
1620 std::string _Status
;
1623 const std::string
&getShardName() const
1628 std::string
&getShardName()
1634 void setShardName(const std::string
&value
)
1643 const std::string
&getServiceLongName() const
1645 return _ServiceLongName
;
1648 std::string
&getServiceLongName()
1650 return _ServiceLongName
;
1654 void setServiceLongName(const std::string
&value
)
1658 _ServiceLongName
= value
;
1663 const std::string
&getServiceShortName() const
1665 return _ServiceShortName
;
1668 std::string
&getServiceShortName()
1670 return _ServiceShortName
;
1674 void setServiceShortName(const std::string
&value
)
1678 _ServiceShortName
= value
;
1683 const std::string
&getServiceAliasName() const
1685 return _ServiceAliasName
;
1688 std::string
&getServiceAliasName()
1690 return _ServiceAliasName
;
1694 void setServiceAliasName(const std::string
&value
)
1698 _ServiceAliasName
= value
;
1703 TRunningState
getRunningState() const
1705 return _RunningState
;
1708 void setRunningState(TRunningState value
)
1711 _RunningState
= value
;
1715 TRunningOrders
getRunningOrders() const
1717 return _RunningOrders
;
1720 void setRunningOrders(TRunningOrders value
)
1723 _RunningOrders
= value
;
1727 const std::set
< TRunningTag
> &getRunningTags() const
1729 return _RunningTags
;
1732 std::set
< TRunningTag
> &getRunningTags()
1734 return _RunningTags
;
1738 void setRunningTags(const std::set
< TRunningTag
> &value
)
1742 _RunningTags
= value
;
1747 const std::string
&getStatus() const
1752 std::string
&getStatus()
1758 void setStatus(const std::string
&value
)
1767 bool operator == (const TServiceStatus
&other
) const
1769 return _ShardName
== other
._ShardName
1770 && _ServiceLongName
== other
._ServiceLongName
1771 && _ServiceShortName
== other
._ServiceShortName
1772 && _ServiceAliasName
== other
._ServiceAliasName
1773 && _RunningState
== other
._RunningState
1774 && _RunningOrders
== other
._RunningOrders
1775 && _RunningTags
== other
._RunningTags
1776 && _Status
== other
._Status
;
1786 void serial(NLMISC::IStream
&s
)
1788 s
.serial(_ShardName
);
1789 s
.serial(_ServiceLongName
);
1790 s
.serial(_ServiceShortName
);
1791 s
.serial(_ServiceAliasName
);
1792 s
.serial(_RunningState
);
1793 s
.serial(_RunningOrders
);
1794 s
.serialCont(_RunningTags
);
1807 /////////////////////////////////////////////////////////////////
1808 // WARNING : this is a generated file, don't change it !
1809 /////////////////////////////////////////////////////////////////
1810 class CAdminServiceSkel
1813 /// the interceptor type
1814 typedef NLNET::CInterceptorForwarder
< CAdminServiceSkel
> TInterceptor
;
1818 // do early run time check for message table
1819 getMessageHandlers();
1821 virtual ~CAdminServiceSkel()
1825 void init(NLNET::IModule
*module
)
1827 _Interceptor
.init(this, module
);
1830 // unused interceptors
1831 std::string
fwdBuildModuleManifest() const { return std::string(); }
1832 void fwdOnModuleUp(NLNET::IModuleProxy
*moduleProxy
) {}
1833 void fwdOnModuleDown(NLNET::IModuleProxy
*moduleProxy
) {}
1834 void fwdOnModuleSecurityChange(NLNET::IModuleProxy
*moduleProxy
) {}
1836 // process module message interceptor
1837 bool fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
1840 typedef void (CAdminServiceSkel::*TMessageHandler
)(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
1841 typedef std::map
<std::string
, TMessageHandler
> TMessageHandlerMap
;
1843 const TMessageHandlerMap
&getMessageHandlers() const;
1846 void upServiceUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1848 void graphUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1850 void highRezGraphUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1852 void commandResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1854 // declare one interceptor member of the skeleton
1855 TInterceptor _Interceptor
;
1857 // declare the interceptor forwarder as friend of this class
1858 friend class NLNET::CInterceptorForwarder
< CAdminServiceSkel
>;
1860 /////////////////////////////////////////////////////////////////
1861 // WARNING : this is a generated file, don't change it !
1862 /////////////////////////////////////////////////////////////////
1864 // An AES send an update of the list of service up
1865 virtual void upServiceUpdate(NLNET::IModuleProxy
*sender
, const std::vector
< TServiceStatus
> &serviceStatus
) =0;
1866 // An AES send graph data update
1867 virtual void graphUpdate(NLNET::IModuleProxy
*sender
, const TGraphDatas
&graphDatas
) =0;
1868 // An AES send high rez graph data update
1869 virtual void highRezGraphUpdate(NLNET::IModuleProxy
*sender
, const THighRezDatas
&graphDatas
) =0;
1870 // AES send back the result of execution of a command
1871 virtual void commandResult(NLNET::IModuleProxy
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
) =0;
1876 /////////////////////////////////////////////////////////////////
1877 // WARNING : this is a generated file, don't change it !
1878 /////////////////////////////////////////////////////////////////
1879 class CAdminServiceProxy
1881 /// Smart pointer on the module proxy
1882 NLNET::TModuleProxyPtr _ModuleProxy
;
1884 // Pointer on the local module that implement the interface (if the proxy is for a local module)
1885 NLNET::TModulePtr _LocalModule
;
1886 // Direct pointer on the server implementation interface for collocated module
1887 CAdminServiceSkel
*_LocalModuleSkel
;
1891 CAdminServiceProxy(NLNET::IModuleProxy
*proxy
)
1894 _ModuleProxy
= proxy
;
1896 // initialize collocated servant interface
1897 if (proxy
->getModuleDistance() == 0)
1899 _LocalModule
= proxy
->getLocalModule();
1900 nlassert(_LocalModule
!= NULL
);
1901 CAdminServiceSkel::TInterceptor
*interceptor
= NULL
;
1902 interceptor
= static_cast < NLNET::CModuleBase
* >(_LocalModule
.getPtr())->getInterceptor(interceptor
);
1903 nlassert(interceptor
!= NULL
);
1905 _LocalModuleSkel
= interceptor
->getParent();
1906 nlassert(_LocalModuleSkel
!= NULL
);
1909 _LocalModuleSkel
= 0;
1912 virtual ~CAdminServiceProxy()
1916 NLNET::IModuleProxy
*getModuleProxy()
1918 return _ModuleProxy
;
1921 // An AES send an update of the list of service up
1922 void upServiceUpdate(NLNET::IModule
*sender
, const std::vector
< TServiceStatus
> &serviceStatus
);
1923 // An AES send graph data update
1924 void graphUpdate(NLNET::IModule
*sender
, const TGraphDatas
&graphDatas
);
1925 // An AES send high rez graph data update
1926 void highRezGraphUpdate(NLNET::IModule
*sender
, const THighRezDatas
&graphDatas
);
1927 // AES send back the result of execution of a command
1928 void commandResult(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
);
1930 // Message serializer. Return the message received in reference for easier integration
1931 static const NLNET::CMessage
&buildMessageFor_upServiceUpdate(NLNET::CMessage
&__message
, const std::vector
< TServiceStatus
> &serviceStatus
);
1933 // Message serializer. Return the message received in reference for easier integration
1934 static const NLNET::CMessage
&buildMessageFor_graphUpdate(NLNET::CMessage
&__message
, const TGraphDatas
&graphDatas
);
1936 // Message serializer. Return the message received in reference for easier integration
1937 static const NLNET::CMessage
&buildMessageFor_highRezGraphUpdate(NLNET::CMessage
&__message
, const THighRezDatas
&graphDatas
);
1939 // Message serializer. Return the message received in reference for easier integration
1940 static const NLNET::CMessage
&buildMessageFor_commandResult(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
);
1947 /////////////////////////////////////////////////////////////////
1948 // WARNING : this is a generated file, don't change it !
1949 /////////////////////////////////////////////////////////////////
1950 class CAdminExecutorServiceSkel
1953 /// the interceptor type
1954 typedef NLNET::CInterceptorForwarder
< CAdminExecutorServiceSkel
> TInterceptor
;
1956 CAdminExecutorServiceSkel()
1958 // do early run time check for message table
1959 getMessageHandlers();
1961 virtual ~CAdminExecutorServiceSkel()
1965 void init(NLNET::IModule
*module
)
1967 _Interceptor
.init(this, module
);
1970 // unused interceptors
1971 std::string
fwdBuildModuleManifest() const { return std::string(); }
1972 void fwdOnModuleUp(NLNET::IModuleProxy
*moduleProxy
) {}
1973 void fwdOnModuleDown(NLNET::IModuleProxy
*moduleProxy
) {}
1974 void fwdOnModuleSecurityChange(NLNET::IModuleProxy
*moduleProxy
) {}
1976 // process module message interceptor
1977 bool fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
1980 typedef void (CAdminExecutorServiceSkel::*TMessageHandler
)(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
1981 typedef std::map
<std::string
, TMessageHandler
> TMessageHandlerMap
;
1983 const TMessageHandlerMap
&getMessageHandlers() const;
1986 void setShardOrders_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1988 void shutdownShard_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1990 void controlCmd_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1992 void serviceCmd_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1994 void commandResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1996 void graphUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
1998 void highRezGraphUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
2000 void serviceStatusUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
2002 // declare one interceptor member of the skeleton
2003 TInterceptor _Interceptor
;
2005 // declare the interceptor forwarder as friend of this class
2006 friend class NLNET::CInterceptorForwarder
< CAdminExecutorServiceSkel
>;
2008 /////////////////////////////////////////////////////////////////
2009 // WARNING : this is a generated file, don't change it !
2010 /////////////////////////////////////////////////////////////////
2012 // AS send orders for a shard
2013 virtual void setShardOrders(NLNET::IModuleProxy
*sender
, const std::string
&shardName
, const TShardOrders
&shardOrders
) =0;
2014 // AS send a command to shutdown a shard with a delay
2015 virtual void shutdownShard(NLNET::IModuleProxy
*sender
, const std::string
&shardName
, uint32 delay
) =0;
2016 // AS send a control command to this AES
2017 virtual void controlCmd(NLNET::IModuleProxy
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
) =0;
2018 // Send a command to a service.
2019 virtual void serviceCmd(NLNET::IModuleProxy
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
) =0;
2020 // AES client send back the result of execution of a command
2021 virtual void commandResult(NLNET::IModuleProxy
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
) =0;
2022 // A service send graph data update
2023 virtual void graphUpdate(NLNET::IModuleProxy
*sender
, const TGraphDatas
&graphDatas
) =0;
2024 // A service high rez graph data update
2025 virtual void highRezGraphUpdate(NLNET::IModuleProxy
*sender
, const THighRezDatas
&graphDatas
) =0;
2026 // A service send an update of of it's status string
2027 virtual void serviceStatusUpdate(NLNET::IModuleProxy
*sender
, const std::string
&status
) =0;
2032 /////////////////////////////////////////////////////////////////
2033 // WARNING : this is a generated file, don't change it !
2034 /////////////////////////////////////////////////////////////////
2035 class CAdminExecutorServiceProxy
2037 /// Smart pointer on the module proxy
2038 NLNET::TModuleProxyPtr _ModuleProxy
;
2040 // Pointer on the local module that implement the interface (if the proxy is for a local module)
2041 NLNET::TModulePtr _LocalModule
;
2042 // Direct pointer on the server implementation interface for collocated module
2043 CAdminExecutorServiceSkel
*_LocalModuleSkel
;
2047 CAdminExecutorServiceProxy(NLNET::IModuleProxy
*proxy
)
2050 _ModuleProxy
= proxy
;
2052 // initialize collocated servant interface
2053 if (proxy
->getModuleDistance() == 0)
2055 _LocalModule
= proxy
->getLocalModule();
2056 nlassert(_LocalModule
!= NULL
);
2057 CAdminExecutorServiceSkel::TInterceptor
*interceptor
= NULL
;
2058 interceptor
= static_cast < NLNET::CModuleBase
* >(_LocalModule
.getPtr())->getInterceptor(interceptor
);
2059 nlassert(interceptor
!= NULL
);
2061 _LocalModuleSkel
= interceptor
->getParent();
2062 nlassert(_LocalModuleSkel
!= NULL
);
2065 _LocalModuleSkel
= 0;
2068 virtual ~CAdminExecutorServiceProxy()
2072 NLNET::IModuleProxy
*getModuleProxy()
2074 return _ModuleProxy
;
2077 // AS send orders for a shard
2078 void setShardOrders(NLNET::IModule
*sender
, const std::string
&shardName
, const TShardOrders
&shardOrders
);
2079 // AS send a command to shutdown a shard with a delay
2080 void shutdownShard(NLNET::IModule
*sender
, const std::string
&shardName
, uint32 delay
);
2081 // AS send a control command to this AES
2082 void controlCmd(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
);
2083 // Send a command to a service.
2084 void serviceCmd(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
);
2085 // AES client send back the result of execution of a command
2086 void commandResult(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
);
2087 // A service send graph data update
2088 void graphUpdate(NLNET::IModule
*sender
, const TGraphDatas
&graphDatas
);
2089 // A service high rez graph data update
2090 void highRezGraphUpdate(NLNET::IModule
*sender
, const THighRezDatas
&graphDatas
);
2091 // A service send an update of of it's status string
2092 void serviceStatusUpdate(NLNET::IModule
*sender
, const std::string
&status
);
2093 // AS send orders for a shard
2095 // This is the broadcast version of the method.
2096 template < class ProxyIterator
>
2097 static void broadcast_setShardOrders(ProxyIterator first
, ProxyIterator last
, NLNET::IModule
*sender
, const std::string
&shardName
, const TShardOrders
&shardOrders
)
2099 NLNET::CMessage message
;
2101 // create the message to send to multiple dest
2102 buildMessageFor_setShardOrders(message
, shardName
, shardOrders
);
2104 for (; first
!= last
; ++first
)
2106 NLNET::IModuleProxy
*proxy
= *first
;
2108 proxy
->sendModuleMessage(sender
, message
);
2112 // AS send a command to shutdown a shard with a delay
2114 // This is the broadcast version of the method.
2115 template < class ProxyIterator
>
2116 static void broadcast_shutdownShard(ProxyIterator first
, ProxyIterator last
, NLNET::IModule
*sender
, const std::string
&shardName
, uint32 delay
)
2118 NLNET::CMessage message
;
2120 // create the message to send to multiple dest
2121 buildMessageFor_shutdownShard(message
, shardName
, delay
);
2123 for (; first
!= last
; ++first
)
2125 NLNET::IModuleProxy
*proxy
= *first
;
2127 proxy
->sendModuleMessage(sender
, message
);
2131 // AS send a control command to this AES
2133 // This is the broadcast version of the method.
2134 template < class ProxyIterator
>
2135 static void broadcast_controlCmd(ProxyIterator first
, ProxyIterator last
, NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
)
2137 NLNET::CMessage message
;
2139 // create the message to send to multiple dest
2140 buildMessageFor_controlCmd(message
, commandId
, serviceAlias
, command
);
2142 for (; first
!= last
; ++first
)
2144 NLNET::IModuleProxy
*proxy
= *first
;
2146 proxy
->sendModuleMessage(sender
, message
);
2151 // Message serializer. Return the message received in reference for easier integration
2152 static const NLNET::CMessage
&buildMessageFor_setShardOrders(NLNET::CMessage
&__message
, const std::string
&shardName
, const TShardOrders
&shardOrders
);
2154 // Message serializer. Return the message received in reference for easier integration
2155 static const NLNET::CMessage
&buildMessageFor_shutdownShard(NLNET::CMessage
&__message
, const std::string
&shardName
, uint32 delay
);
2157 // Message serializer. Return the message received in reference for easier integration
2158 static const NLNET::CMessage
&buildMessageFor_controlCmd(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
);
2160 // Message serializer. Return the message received in reference for easier integration
2161 static const NLNET::CMessage
&buildMessageFor_serviceCmd(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
);
2163 // Message serializer. Return the message received in reference for easier integration
2164 static const NLNET::CMessage
&buildMessageFor_commandResult(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
);
2166 // Message serializer. Return the message received in reference for easier integration
2167 static const NLNET::CMessage
&buildMessageFor_graphUpdate(NLNET::CMessage
&__message
, const TGraphDatas
&graphDatas
);
2169 // Message serializer. Return the message received in reference for easier integration
2170 static const NLNET::CMessage
&buildMessageFor_highRezGraphUpdate(NLNET::CMessage
&__message
, const THighRezDatas
&graphDatas
);
2172 // Message serializer. Return the message received in reference for easier integration
2173 static const NLNET::CMessage
&buildMessageFor_serviceStatusUpdate(NLNET::CMessage
&__message
, const std::string
&status
);
2180 /////////////////////////////////////////////////////////////////
2181 // WARNING : this is a generated file, don't change it !
2182 /////////////////////////////////////////////////////////////////
2183 class CAdminExecutorServiceClientSkel
2186 /// the interceptor type
2187 typedef NLNET::CInterceptorForwarder
< CAdminExecutorServiceClientSkel
> TInterceptor
;
2189 CAdminExecutorServiceClientSkel()
2191 // do early run time check for message table
2192 getMessageHandlers();
2194 virtual ~CAdminExecutorServiceClientSkel()
2198 void init(NLNET::IModule
*module
)
2200 _Interceptor
.init(this, module
);
2203 // unused interceptors
2204 std::string
fwdBuildModuleManifest() const { return std::string(); }
2205 void fwdOnModuleUp(NLNET::IModuleProxy
*moduleProxy
) {}
2206 void fwdOnModuleDown(NLNET::IModuleProxy
*moduleProxy
) {}
2207 void fwdOnModuleSecurityChange(NLNET::IModuleProxy
*moduleProxy
) {}
2209 // process module message interceptor
2210 bool fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
2213 typedef void (CAdminExecutorServiceClientSkel::*TMessageHandler
)(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
2214 typedef std::map
<std::string
, TMessageHandler
> TMessageHandlerMap
;
2216 const TMessageHandlerMap
&getMessageHandlers() const;
2219 void serviceCmd_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
2221 void serviceCmdNoReturn_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
2223 // declare one interceptor member of the skeleton
2224 TInterceptor _Interceptor
;
2226 // declare the interceptor forwarder as friend of this class
2227 friend class NLNET::CInterceptorForwarder
< CAdminExecutorServiceClientSkel
>;
2229 /////////////////////////////////////////////////////////////////
2230 // WARNING : this is a generated file, don't change it !
2231 /////////////////////////////////////////////////////////////////
2233 // execute a command and return the result.
2234 virtual void serviceCmd(NLNET::IModuleProxy
*sender
, uint32 commandId
, const std::string
&command
) =0;
2235 // Send a command to a service without waiting for the return value.
2236 virtual void serviceCmdNoReturn(NLNET::IModuleProxy
*sender
, const std::string
&command
) =0;
2241 /////////////////////////////////////////////////////////////////
2242 // WARNING : this is a generated file, don't change it !
2243 /////////////////////////////////////////////////////////////////
2244 class CAdminExecutorServiceClientProxy
2246 /// Smart pointer on the module proxy
2247 NLNET::TModuleProxyPtr _ModuleProxy
;
2249 // Pointer on the local module that implement the interface (if the proxy is for a local module)
2250 NLNET::TModulePtr _LocalModule
;
2251 // Direct pointer on the server implementation interface for collocated module
2252 CAdminExecutorServiceClientSkel
*_LocalModuleSkel
;
2256 CAdminExecutorServiceClientProxy(NLNET::IModuleProxy
*proxy
)
2259 _ModuleProxy
= proxy
;
2261 // initialize collocated servant interface
2262 if (proxy
->getModuleDistance() == 0)
2264 _LocalModule
= proxy
->getLocalModule();
2265 nlassert(_LocalModule
!= NULL
);
2266 CAdminExecutorServiceClientSkel::TInterceptor
*interceptor
= NULL
;
2267 interceptor
= static_cast < NLNET::CModuleBase
* >(_LocalModule
.getPtr())->getInterceptor(interceptor
);
2268 nlassert(interceptor
!= NULL
);
2270 _LocalModuleSkel
= interceptor
->getParent();
2271 nlassert(_LocalModuleSkel
!= NULL
);
2274 _LocalModuleSkel
= 0;
2277 virtual ~CAdminExecutorServiceClientProxy()
2281 NLNET::IModuleProxy
*getModuleProxy()
2283 return _ModuleProxy
;
2286 // execute a command and return the result.
2287 void serviceCmd(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&command
);
2288 // Send a command to a service without waiting for the return value.
2289 void serviceCmdNoReturn(NLNET::IModule
*sender
, const std::string
&command
);
2291 // Message serializer. Return the message received in reference for easier integration
2292 static const NLNET::CMessage
&buildMessageFor_serviceCmd(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&command
);
2294 // Message serializer. Return the message received in reference for easier integration
2295 static const NLNET::CMessage
&buildMessageFor_serviceCmdNoReturn(NLNET::CMessage
&__message
, const std::string
&command
);