Examples of UserAdmin


Examples of org.jitterbit.integration.client.server.useradmin.UserAdmin

        @Override
        protected void runImpl() throws InterruptedException {
            setMessage("Retrieving info from the server");
            IntegrationServer server = IntegrationServer.getInstance();
            UserAdmin call = server.getServerCall(UserAdmin.class);
            call.getUsersAndGroups(FetchJob.this, includePasswords);
        }
View Full Code Here

Examples of org.jitterbit.integration.client.server.useradmin.UserAdmin

    @Override
    protected void runImpl() throws InterruptedException {
        setMessage(Strings.get("UserProfile.Upload.Started"));
        Thread.sleep(500);
        IntegrationServer server = IntegrationServer.getInstance();
        UserAdmin call = server.getServerCall(UserAdmin.class);
        call.setUserInfo(user, callback);
    }
View Full Code Here

Examples of org.jitterbit.integration.client.server.useradmin.UserAdmin

    @Override
    protected void runImpl() throws InterruptedException {
        setMessage(Strings.get("UserProfile.Download.Started"));
        Thread.sleep(500);
        IntegrationServer server = IntegrationServer.getInstance();
        UserAdmin call = server.getServerCall(UserAdmin.class);
        call.getUserInfo(callback);
    }
View Full Code Here

Examples of org.jitterbit.integration.client.server.useradmin.UserAdmin

    protected void runImpl() throws InterruptedException {
        setMessage(Strings.get("User.UploadJob.Started"));
        List<User> users = model.getUsers();
        List<Group> groups = model.getGroups();
        IntegrationServer server = IntegrationServer.getInstance();
        UserAdmin call = server.getServerCall(UserAdmin.class);
        call.setUsersAndGroups(users, groups, internalCallback);
    }
View Full Code Here

Examples of org.osgi.service.useradmin.UserAdmin

    public final Object addingService(ServiceReference reference)
    {
        SimpleWebConsolePlugin plugin = this.plugin;
        if (plugin == null)
        {
            final UserAdmin service = (UserAdmin) context.getService(reference);
            this.plugin = new WebConsolePlugin(service).register(context);
            //            printerRegistration = context.registerService(ConfigurationPrinter.SERVICE,
            //                new ComponentConfigurationPrinter(service), null);
        }
View Full Code Here

Examples of org.osgi.service.useradmin.UserAdmin

    public void testFelix3735_StopRunningStoreRetainsDataOk() throws Exception
    {
        final String userName = "testUser";
        final String groupName = "testGroup";

        UserAdmin userAdmin = awaitService(UserAdmin.class.getName());
        Bundle fileStoreBundle = getFileStoreBundle();
        // Start a suitable storage service...
        fileStoreBundle.start();

        // Fill the user admin with some data...
        User testUser = (User) userAdmin.createRole(userName, Role.USER);
        testUser.getProperties().put("key", "value");

        Group testGroup = (Group) userAdmin.createRole(groupName, Role.GROUP);
        testGroup.addMember(testUser);

        // Stop the file store...
        fileStoreBundle.stop();

        // retrieve the useradmin again...
        userAdmin = awaitService(UserAdmin.class.getName());

        // Verify the user + group are gone (no store available)...
        assertNull(userAdmin.getRole(userName));
        assertNull(userAdmin.getRole(groupName));

        // Start the file store...
        fileStoreBundle.start();

        // Verify the user + group are gone (no store available)...
        User readUser = (User) userAdmin.getRole(userName);
        assertNotNull(readUser);
        assertEquals(userName, readUser.getName());
        assertEquals("value", readUser.getProperties().get("key"));

        Group readGroup = (Group) userAdmin.getRole(groupName);
        assertNotNull(readGroup);
        assertEquals(groupName, readGroup.getName());
        assertEquals(1, readGroup.getMembers().length);
        assertEquals(readUser, readGroup.getMembers()[0]);
    }
View Full Code Here

Examples of org.osgi.service.useradmin.UserAdmin

    public void testFelix3735_StartStoreAfterUserAdminInitializesOk() throws Exception
    {
        final String userName = "anotherTestUser";
        final String groupName = "anotherTestGroup";

        UserAdmin userAdmin = awaitService(UserAdmin.class.getName());
        Bundle fileStoreBundle = getFileStoreBundle();
        // Start a suitable storage service...
        fileStoreBundle.start();

        // Fill the user admin with some data...
        User testUser = (User) userAdmin.createRole(userName, Role.USER);
        testUser.getProperties().put("key", "value");

        Group testGroup = (Group) userAdmin.createRole(groupName, Role.GROUP);
        testGroup.addMember(testUser);

        // Stop the file store...
        fileStoreBundle.stop();

        Bundle userAdminBundle = findBundle(ORG_APACHE_FELIX_USERADMIN);
        assertNotNull(userAdminBundle);
        userAdminBundle.stop();

        // Obtain user admin service again; shouldn't be available...
        userAdmin = getService(UserAdmin.class.getName());
        assertNull(userAdmin);

        userAdminBundle.start();

        // Obtain user admin service again; should be available now...
        userAdmin = awaitService(UserAdmin.class.getName());
        assertNotNull(userAdmin);

        // Verify the user + group are gone (no store available)...
        assertNull(userAdmin.getRole(userName));
        assertNull(userAdmin.getRole(groupName));

        // Start the file store...
        fileStoreBundle.start();

        // Verify the user + group are gone (no store available)...
        User readUser = (User) userAdmin.getRole(userName);
        assertNotNull(readUser);
        assertEquals(userName, readUser.getName());
        assertEquals("value", readUser.getProperties().get("key"));

        Group readGroup = (Group) userAdmin.getRole(groupName);
        assertNotNull(readGroup);
        assertEquals(groupName, readGroup.getName());
        assertEquals(1, readGroup.getMembers().length);
        assertEquals(readUser, readGroup.getMembers()[0]);
    }
View Full Code Here

Examples of org.osgi.service.useradmin.UserAdmin

     * performed correctly.
     */
    @Test
    public void testStoreIsInitializedAndClosedProperlyOk() throws Exception
    {
        UserAdmin ua = getUserAdmin();
        // Start the file store bundle...
        Bundle fileStoreBundle = getFileStoreBundle();
        fileStoreBundle.start();

        // Create two roles...
        User user = (User) ua.createRole("user1", Role.USER);
        assertNotNull(user);

        Group group = (Group) ua.createRole("group1", Role.GROUP);
        assertNotNull(group);

        group.addMember(user);
        group.addRequiredMember(ua.getRole(Role.USER_ANYONE));

        // Stop the file store; should persist the two roles...
        fileStoreBundle.stop();

        Thread.sleep(100); // Wait a little until the bundle is really stopped...

        // Retrieve the roles again; should both yield null due to the store not being available...
        user = (User) ua.getRole("user1");
        assertNull(user);

        group = (Group) ua.getRole("group1");
        assertNull(group);

        // This will not succeed: no backend to store the user in...
        assertNull(ua.createRole("user2", Role.USER));

        fileStoreBundle.start();

        awaitService(ORG_APACHE_FELIX_USERADMIN_FILESTORE);

        // Retrieve the roles again; should both yield valid values...
        user = (User) ua.getRole("user1");
        assertNotNull(user);

        group = (Group) ua.getRole("group1");
        assertNotNull(group);

        Role[] members = group.getMembers();
        assertNotNull(members);
        assertEquals(1, members.length);
        assertEquals("user1", members[0].getName());

        members = group.getRequiredMembers();
        assertNotNull(members);
        assertEquals(1, members.length);
        assertEquals(Role.USER_ANYONE, members[0].getName());

        user = (User) ua.getRole("user2");
        assertNull(user);
    }
View Full Code Here

Examples of org.osgi.service.useradmin.UserAdmin

     * Tests that fetching an empty role without properties or other roles does not cause a NPE.
     */
    @Test
    public void testFelix4399_FetchEmptyRoleOk() throws Exception
    {
        UserAdmin ua = getUserAdmin();

        String roleName = "emptyRole";

        if (canRunTest())
        {
            Role emptyRole = ua.createRole(roleName, Role.USER);
            assertNotNull("Collection not empty?!", emptyRole);

            Role readRole = ua.getRole(roleName);

            assertNotNull("Unable to read back created empty role?!", readRole);
            assertEquals("Names not equal?!", emptyRole.getName(), readRole.getName());
            assertEquals("Types not equal?!", emptyRole.getType(), readRole.getType());

            Role[] readRoles = ua.getRoles(null);

            assertNotNull("Unable to read back created empty role?!", readRoles);
            assertEquals(1, readRoles.length);
        }
    }
View Full Code Here

Examples of org.osgi.service.useradmin.UserAdmin

     * Tests that creating a new role returns the actual created role.
     */
    @Test
    public void testFelix4400_CreateRoleReturnsNonNullOk() throws Exception
    {
        UserAdmin ua = getUserAdmin();

        String roleName = "newRole";

        if (canRunTest())
        {
            Role newRole = ua.createRole(roleName, Role.USER);
            assertNotNull("Felix-4400 not resolved?!", newRole);

            assertEquals("Names not equal?!", roleName, newRole.getName());
            assertEquals("Types not equal?!", Role.USER, newRole.getType());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.