Package de.novanic.eventservice.service.registry.user

Examples of de.novanic.eventservice.service.registry.user.UserManager


    @Test
    public void testResetEventRegistry() throws Exception {
        final String theTestUserId = "TestUser1";

        UserManager theUserManager = UserManagerFactory.getInstance().getUserManager(100);
        theUserManager.getUserActivityScheduler().stop();

        theUserManager.addUser(theTestUserId);
        assertNotNull(theUserManager.getUser(theTestUserId));

        EventRegistry theEventRegistry = EventRegistryFactory.getInstance().getEventRegistry();
        assertNotNull(theEventRegistry);
        Thread.sleep(400);
        assertNull(theUserManager.getUser(theTestUserId)); //cleaned-up by the user-activity scheduler which is activated by the EventRegistry

        EventRegistryFactory.getInstance().resetEventRegistry();
        theUserManager.addUser(theTestUserId);

        Thread.sleep(400);
        assertNotNull(theUserManager.getUser(theTestUserId)); //not cleaned-up by the user-activity scheduler, because the EventRegistry got stopped
    }
View Full Code Here


        UserInfo theTestUser_2 = mock(UserInfo.class, TEST_USER_ID_2);
        when(theTestUser_2.getUserId()).thenReturn(TEST_USER_ID_2);
        when(theTestUser_2.getLastActivityTime()).thenReturn(PlatformUtil.getCurrentTime());
        when(theTestUser_2.getUnlistenEvent()).thenReturn(new DefaultUnlistenEvent());

        UserManager theUserManager = UserManagerFactory.getInstance().getUserManager(99999);
        theUserManager.addUser(theTestUser_1);
        theUserManager.addUser(theTestUser_2);

        setUp(createConfiguration(0, 90000, 99999999));
        myEventRegistry = EventRegistryFactory.getInstance().getEventRegistry();
        setUp(myEventRegistry);
View Full Code Here

            eventRegistry.unlisten(userId);
        }
        log.info(
                "Removed {} client(s).  Waiting for outstanding polls to time out...",
                clientCount);
        UserManager userManager =
                UserManagerFactory.getInstance().getUserManager();
        userManager.getUserActivityScheduler().stop();
    }
View Full Code Here

        EventExecutorServiceFactory factory =
                EventExecutorServiceFactory.getInstance();
        this.eventExecutorService =
                factory.getEventExecutorService(workspaceId);

        UserManager userManager =
                UserManagerFactory.getInstance().getUserManager();
        // this will notify us of all user timeouts (whether part of this
        // workspace or not)
        // TODO deregister listener to avoid memory leak
        userManager.getUserActivityScheduler().addTimeoutListener(
                new UserTimeoutListener() {
                    @Override
                    public void onTimeout(UserInfo userInfo) {
                        String connectionId = userInfo.getUserId();
                        EditorClientId editorClientId =
View Full Code Here

TOP

Related Classes of de.novanic.eventservice.service.registry.user.UserManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.