Example #1
0
        public ServerModule(string aHttpDirectory)
        {
            UserList = new UserList();
            UserList.SetUser(new User("chrisc", "Chris Cheung", GravatarUrl("*****@*****.**")));
            UserList.SetUser(new User("andreww", "Andrew Wilson", GravatarUrl("*****@*****.**")));
            UserList.SetUser(new User("simonc", "Simon Chisholm", GravatarUrl("*****@*****.**")));
            UserList.SetUser(new User("grahamd", "Graham Darnell", GravatarUrl("*****@*****.**")));
            UserList.SetUser(new User("stathisv", "Stathis Voukelatos", GravatarUrl("*****@*****.**")));

            var serverHealthApp = new ServerHealthApp(Path.Combine(aHttpDirectory, "serverhealth"));
            AppsStateFactory appsStateFactory = new AppsStateFactory(
                serverHealthApp,
                () => DateTime.UtcNow,
                new ServerTabTimeoutPolicy(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10)),
                UserList);

            LoginApp loginApp = new LoginApp(UserList, Path.Combine(aHttpDirectory, "login"));
            var appsState = appsStateFactory.CreateAppsState();
            iCleanupStack.Add(XappServer = new Server(appsState, new Strand(), aHttpDirectory));
            XappServer.SetXappAdapter(aXapp => new UserAndBrowserFilter(aXapp, loginApp, UserList));
            XappServer.AddXapp("login", loginApp);
            XappServer.AddXapp("serverhealth", serverHealthApp);

            //var browserDiscriminationFilter = new BrowserDiscriminationFilter();
            //var loginFilter = new LoginFilter(loginApp);

            //XappServer.AddFilter(browserDiscriminationFilter);
            //XappServer.AddFilter(loginFilter);

            iCleanupStack.Add(new Gate.Hosts.Firefly.ServerFactory().Create(XappServer.HandleRequest, 12921));
        }
Example #2
0
 public LoginApp(UserList aUserList, string aHttpDirectory)
 {
     iUserList = aUserList;
     iHttpDirectory = aHttpDirectory;
     iUserList.Updated += OnUserListUpdated;
     iUrlDispatcher = new AppPathDispatcher();
     iUrlDispatcher.MapPath( new string[] { }, ServeAppHtml);
     iUrlDispatcher.MapPrefixToDirectory(new string[] { }, aHttpDirectory);
 }
Example #3
0
 public ChatAppTab(ChatApp aChatApp, IBrowserTabProxy aBrowserTabProxy, int aId, UserList aUserList, string aUserId)
 {
     iChatApp = aChatApp;
     iBrowserTabProxy = aBrowserTabProxy;
     iId = aId;
     iUserId = aUserId;
     //iUserList = aUserList;
 }
Example #4
0
 public UserAndBrowserFilter(IXapp aBaseApp, LoginApp aLoginApp, UserList aUserList)
 {
     iBaseApp = aBaseApp;
     iLoginApp = aLoginApp;
     iUserList = aUserList;
 }
Example #5
0
 internal SessionRecord(string aKey, TabStatusQueue aListener, IAppsStateFactory aAppsStateFactory, UserList aUserList)
 {
     iListener = aListener;
     iAppsStateFactory = aAppsStateFactory;
     iUserList = aUserList;
     Key = aKey;
     Tabs = new Dictionary<string, ServerTab>();
 }
Example #6
0
 public AppsStateFactory(ITabStatusListener aTabListener, Func<DateTime> aClock, ServerTabTimeoutPolicy aTimeoutPolicy, UserList aUserList)
 {
     iAppsStateThread = new Strand();
     iTabStatusQueue = new TabStatusQueue(aTabListener);
     iTimeoutPolicy = aTimeoutPolicy;
     iUserList = aUserList;
     iClock = aClock;
     iTimerThread = new TimerThread(iClock);
 }