Creates a database information string. @param context database context @return info string
(final Context context)
| 40 | * @return info string |
| 41 | */ |
| 42 | public static String info(final Context context) { |
| 43 | final TokenBuilder tb = new TokenBuilder(); |
| 44 | tb.add(GENERAL_INFO + COL + NL); |
| 45 | info(tb, VERSINFO, Prop.VERSION); |
| 46 | |
| 47 | final User user = context.user(); |
| 48 | info(tb, USED_MEM, Performance.formatMemory()); |
| 49 | |
| 50 | if(user.has(Perm.ADMIN)) { |
| 51 | final StaticOptions sopts = context.soptions; |
| 52 | tb.add(NL + GLOBAL_OPTIONS + COL + NL); |
| 53 | for(final Option<?> o : sopts) info(tb, o.name(), sopts.get(o)); |
| 54 | } |
| 55 | |
| 56 | final MainOptions opts = context.options; |
| 57 | tb.add(NL + LOCAL_OPTIONS + NL); |
| 58 | for(final Option<?> o : opts) info(tb, o.name(), opts.get(o)); |
| 59 | return tb.toString(); |
| 60 | } |
| 61 | } |