@@ -41,6 +41,7 @@ void DatabaseManager::setProperties(const DatabasePropertiesOptions& options)
4141 if (const auto replicaMode = options.getReplicaMode ())
4242 {
4343 std::uint8_t modeVal = 0 ;
44+
4445 switch (*replicaMode)
4546 {
4647 case ReplicaMode::NONE :
@@ -56,9 +57,66 @@ void DatabaseManager::setProperties(const DatabasePropertiesOptions& options)
5657 assert (false );
5758 break ;
5859 }
60+
5961 builder->insertBytes (&statusWrapper, isc_spb_prp_replica_mode, &modeVal, 1u );
6062 }
6163
64+ if (const auto shutdownMode = options.getShutdownMode ())
65+ {
66+ std::uint8_t stateVal = 0 ;
67+
68+ switch (*shutdownMode)
69+ {
70+ case ShutdownMode::NORMAL :
71+ stateVal = isc_spb_prp_sm_normal;
72+ break ;
73+ case ShutdownMode::MULTI :
74+ stateVal = isc_spb_prp_sm_multi;
75+ break ;
76+ case ShutdownMode::SINGLE :
77+ stateVal = isc_spb_prp_sm_single;
78+ break ;
79+ case ShutdownMode::FULL :
80+ stateVal = isc_spb_prp_sm_full;
81+ break ;
82+ default :
83+ assert (false );
84+ break ;
85+ }
86+
87+ builder->insertBytes (&statusWrapper, isc_spb_prp_shutdown_mode, &stateVal, 1u );
88+ }
89+
90+ if (const auto shutdownType = options.getShutdownType ())
91+ {
92+ const auto timeout = options.getShutdownTimeout ().value_or (0 );
93+
94+ switch (*shutdownType)
95+ {
96+ case ShutdownType::DENY_TRANSACTIONS :
97+ builder->insertInt (&statusWrapper, isc_spb_prp_deny_new_transactions, timeout);
98+ break ;
99+ case ShutdownType::DENY_ATTACHMENTS :
100+ builder->insertInt (&statusWrapper, isc_spb_prp_deny_new_attachments, timeout);
101+ break ;
102+ case ShutdownType::FORCED :
103+ builder->insertInt (&statusWrapper, isc_spb_prp_force_shutdown, timeout);
104+ break ;
105+ default :
106+ assert (false );
107+ break ;
108+ }
109+ }
110+
111+ if (const auto online = options.getOnline ())
112+ {
113+ if (*online)
114+ {
115+ std::uint8_t stateVal = isc_spb_prp_sm_normal;
116+ builder->insertBytes (&statusWrapper, isc_spb_prp_online_mode, &stateVal, 1u );
117+ }
118+ }
119+
62120 const auto buffer = builder->getBuffer (&statusWrapper);
63121 const auto length = builder->getBufferLength (&statusWrapper);
64122
0 commit comments