- private void putPage(String path, Page p, String category) {
- pages.put(path, p);
- reveresePages.put(p, path);
- if (category == null) {
+ 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 Template baseTemplate;
+
+ 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;
+ DatabaseConnection.init(conf);
+ this.truststore = truststore;
+ pinger = new PingerDaemon(truststore);
+ pinger.start();
+ }
+ }
+
+ @Override
+ public synchronized void init() throws ServletException {
+ if (firstInstanceInited) {
+ super.init();