+ // rootMenu.prepare();
+ return rootMenu;
+ }
+
+ private void addLanguages(Menu languages) {
+ for (Locale l : Language.getSupportedLocales()) {
+ languages.addItem(new SimpleUntranslatedMenuItem("?lang=" + l.toString(), l.getDisplayName(l)));
+ }
+ }
+
+ public Map<String, Page> getPages() {
+ return Collections.unmodifiableMap(pages);
+ }
+ }
+
+ public static final String LOGGEDIN = "loggedin";
+
+ public static final String CERT_SERIAL = "org.cacert.gigi.serial";
+
+ public static final String CERT_ISSUER = "org.cacert.gigi.issuer";
+
+ public static final String AUTH_CONTEXT = "auth";
+
+ public static final String LOGIN_METHOD = "org.cacert.gigi.loginMethod";
+
+ private static final long serialVersionUID = -6386785421902852904L;
+
+ private static Gigi instance;
+
+ private static final Template baseTemplate = new Template(Gigi.class.getResource("Gigi.templ"));;
+
+ private PingerDaemon pinger;
+
+ private KeyStore truststore;
+
+ private boolean testing;
+
+ private MenuCollector rootMenu;
+
+ private Map<String, Page> pages;
+
+ private boolean firstInstanceInited = false;
+
+ public Gigi(Properties conf, KeyStore truststore) {
+ synchronized (Gigi.class) {
+ if (instance != null) {
+ throw new IllegalStateException("Multiple Gigi instances!");
+ }
+ testing = conf.getProperty("testing") != null;
+ instance = this;
+ DomainAssessment.init(conf);
+ DatabaseConnection.init(conf);
+ TimeConditions.init(conf);
+ PasswordHash.init(conf);
+ this.truststore = truststore;
+ pinger = new PingerDaemon(truststore);
+ pinger.start();