| 1 |
/* |
| 2 |
* Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, |
| 3 |
* and the EPL 1.0 (https://h2database.com/html/license.html). |
| 4 |
* Initial Developer: H2 Group |
| 5 |
*/ |
| 6 |
package org.h2.jmx; |
| 7 |
|
| 8 |
/** |
| 9 |
* Information and management operations for the given database. |
| 10 |
* |
| 11 |
* @author Eric Dong |
| 12 |
* @author Thomas Mueller |
| 13 |
*/ |
| 14 |
public interface DatabaseInfoMBean { |
| 15 |
|
| 16 |
/** |
| 17 |
* Is the database open in exclusive mode? |
| 18 |
* |
| 19 |
* @return true if the database is open in exclusive mode, false otherwise |
| 20 |
*/ |
| 21 |
boolean isExclusive(); |
| 22 |
|
| 23 |
/** |
| 24 |
* Is the database read-only? |
| 25 |
* |
| 26 |
* @return true if the database is read-only, false otherwise |
| 27 |
*/ |
| 28 |
boolean isReadOnly(); |
| 29 |
|
| 30 |
/** |
| 31 |
* The database compatibility mode (REGULAR if no compatibility mode is |
| 32 |
* used). |
| 33 |
* |
| 34 |
* @return the database mode |
| 35 |
*/ |
| 36 |
String getMode(); |
| 37 |
|
| 38 |
/** |
| 39 |
* The number of write operations since the database was opened. |
| 40 |
* |
| 41 |
* @return the write count |
| 42 |
*/ |
| 43 |
long getFileWriteCount(); |
| 44 |
|
| 45 |
/** |
| 46 |
* The file read count since the database was opened. |
| 47 |
* |
| 48 |
* @return the read count |
| 49 |
*/ |
| 50 |
long getFileReadCount(); |
| 51 |
|
| 52 |
/** |
| 53 |
* The database file size in KB. |
| 54 |
* |
| 55 |
* @return the number of pages |
| 56 |
*/ |
| 57 |
long getFileSize(); |
| 58 |
|
| 59 |
/** |
| 60 |
* The maximum cache size in KB. |
| 61 |
* |
| 62 |
* @return the maximum size |
| 63 |
*/ |
| 64 |
int getCacheSizeMax(); |
| 65 |
|
| 66 |
/** |
| 67 |
* Change the maximum size. |
| 68 |
* |
| 69 |
* @param kb the cache size in KB. |
| 70 |
*/ |
| 71 |
void setCacheSizeMax(int kb); |
| 72 |
|
| 73 |
/** |
| 74 |
* The current cache size in KB. |
| 75 |
* |
| 76 |
* @return the current size |
| 77 |
*/ |
| 78 |
int getCacheSize(); |
| 79 |
|
| 80 |
/** |
| 81 |
* The database version. |
| 82 |
* |
| 83 |
* @return the version |
| 84 |
*/ |
| 85 |
String getVersion(); |
| 86 |
|
| 87 |
/** |
| 88 |
* The trace level (0 disabled, 1 error, 2 info, 3 debug). |
| 89 |
* |
| 90 |
* @return the level |
| 91 |
*/ |
| 92 |
int getTraceLevel(); |
| 93 |
|
| 94 |
/** |
| 95 |
* Set the trace level. |
| 96 |
* |
| 97 |
* @param level the new value |
| 98 |
*/ |
| 99 |
void setTraceLevel(int level); |
| 100 |
|
| 101 |
/** |
| 102 |
* List the database settings. |
| 103 |
* |
| 104 |
* @return the database settings |
| 105 |
*/ |
| 106 |
String listSettings(); |
| 107 |
|
| 108 |
/** |
| 109 |
* List sessions, including the queries that are in |
| 110 |
* progress, and locked tables. |
| 111 |
* |
| 112 |
* @return information about the sessions |
| 113 |
*/ |
| 114 |
String listSessions(); |
| 115 |
|
| 116 |
} |