1 6 7 package enhydraManager; 8 9 import com.lutris.appserver.server.*; 10 import com.lutris.appserver.server.httpPresentation.*; 11 import com.lutris.appserver.server.session.*; 12 import com.lutris.util.*; 13 14 import com.lutris.http.BasicAuth; 15 import com.lutris.http.BasicAuthResult; 16 import enhydraManager.spec.*; 17 22 public class EnhydraManager extends StandardApplication { 23 24 25 private String username, password, locale; 27 private String relm = "EnhydraManager"; 29 30 31 32 public static String refresh = "0"; 33 37 public void startup(Config appConfig) throws ApplicationException { 38 try { 39 username = appConfig.getString("enhydraManager.Username"); 40 password = appConfig.getString("enhydraManager.Password"); 41 } catch (ConfigException except) { 42 throw new ApplicationException(except); 43 } 44 45 super.startup(appConfig); 46 try { 47 refresh = appConfig.getString("enhydraManager.Refresh"); 48 Integer.parseInt(refresh); 49 } catch (Exception ex){ 50 refresh = "0"; 51 } 52 53 try{ 54 }catch(NullPointerException e){} 57 58 } 59 60 public boolean requestPreprocessor(HttpPresentationComms comms) 61 throws Exception { 62 super.requestPreprocessor(comms); 63 if (comms.session == null) { 64 return false; 66 } 67 68 80 81 String user = comms.request.getRemoteUser(); 82 83 if(user!=null) 84 { 85 if (comms.session.getUser() == null) 86 { 87 EnhydraManagerUser enhydraManagerUser = new EnhydraManagerUser(user); 88 comms.session.setUser(enhydraManagerUser); 89 90 } 91 } 92 93 return false; 95 } 96 97 98 106 public String toHtml() { 107 return "This is <I>SessionViewer</I>"; 108 } 109 } 110 111 | Popular Tags |