Mercurial > hg > monetdb-java
comparison src/main/java/org/monetdb/merovingian/Control.java @ 631:0674e6fb4bdd
Add isStopped() method to Control
(contributed by Wouter Alink)
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Fri, 21 Jan 2022 10:41:53 +0100 (2022-01-21) |
parents | ea8e3d011632 |
children | e2fd07352866 |
comparison
equal
deleted
inserted
replaced
630:ea8e3d011632 | 631:0674e6fb4bdd |
---|---|
247 throws MerovingianException, IOException | 247 throws MerovingianException, IOException |
248 { | 248 { |
249 sendCommand(database, "start", false); | 249 sendCommand(database, "start", false); |
250 } | 250 } |
251 | 251 |
252 public boolean isStopped(String database) | |
253 throws MerovingianException, IOException | |
254 { | |
255 switch (getStatus(database).getState()) { | |
256 case SABdbInactive: | |
257 case SABdbCrashed: | |
258 case SABdbIllegal: | |
259 return true; | |
260 case SABdbStarting: | |
261 case SABdbRunning: | |
262 return false; | |
263 default: | |
264 throw new IllegalStateException(); | |
265 } | |
266 } | |
267 | |
252 public void stop(String database) | 268 public void stop(String database) |
253 throws MerovingianException, IOException | 269 throws MerovingianException, IOException |
254 { | 270 { |
255 sendCommand(database, "stop", false); | 271 sendCommand(database, "stop", false); |
256 } | 272 } |