Package org.apache.qpid.server.model

Examples of org.apache.qpid.server.model.PreferencesProvider


            response.sendError(HttpServletResponse.SC_FORBIDDEN, "Viewing of preferences is not allowed");
            return;
        }

        Map<String, Object> preferences = null;
        PreferencesProvider preferencesProvider = getPreferencesProvider(authenticationProviderName);
        if (preferencesProvider == null)
        {
            response.sendError(HttpServletResponse.SC_NOT_FOUND, "Preferences provider is not configured");
            return;
        }
        preferences =  preferencesProvider.getPreferences(userId);

        sendJsonResponse(preferences, request, response);
    }
View Full Code Here


        if (authenticationProvider == null)
        {
            throw new IllegalArgumentException(String.format("Authentication provider '%s' is not found",
                    authenticationProviderName));
        }
        PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
        return preferencesProvider;
    }
View Full Code Here

        {
            if (authenticationProviderName != null && !authenticationProvider.getName().equals(authenticationProviderName))
            {
                continue;
            }
            PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
            if (preferencesProvider != null)
            {
                Set<String> usernames = preferencesProvider.listUserIDs();
                for (String name : usernames)
                {
                    Map<String, Object> userMap = new HashMap<String, Object>();
                    userMap.put(User.NAME, name);
                    userMap.put("authenticationProvider", authenticationProvider.getName());
View Full Code Here

            for (Map.Entry<String, Set<String>> entry : providerUsers.entrySet())
            {
                String providerName = entry.getKey();
                AuthenticationProvider provider = requestProviders.get(providerName);
                Set<String> usersToDelete = entry.getValue();
                PreferencesProvider preferencesProvider = provider.getPreferencesProvider();

                if (preferencesProvider != null && !usersToDelete.isEmpty())
                {
                    String[] users = usersToDelete.toArray(new String[usersToDelete.size()]);
                    preferencesProvider.deletePreferences(users);
                }
            }
        }

    }
View Full Code Here

            response.sendError(HttpServletResponse.SC_FORBIDDEN, "Viewing of preferences is not allowed");
            return;
        }

        Map<String, Object> preferences = null;
        PreferencesProvider preferencesProvider = getPreferencesProvider(authenticationProviderName);
        if (preferencesProvider == null)
        {
            response.sendError(HttpServletResponse.SC_NOT_FOUND, "Preferences provider is not configured");
            return;
        }
        preferences =  preferencesProvider.getPreferences(userId);

        sendJsonResponse(preferences, response);
    }
View Full Code Here

        if (authenticationProvider == null)
        {
            throw new IllegalArgumentException(String.format("Authentication provider '%s' is not found",
                    authenticationProviderName));
        }
        PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
        return preferencesProvider;
    }
View Full Code Here

        {
            if (authenticationProviderName != null && !authenticationProvider.getName().equals(authenticationProviderName))
            {
                continue;
            }
            PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
            if (preferencesProvider != null)
            {
                Set<String> usernames = preferencesProvider.listUserIDs();
                for (String name : usernames)
                {
                    Map<String, Object> userMap = new HashMap<String, Object>();
                    userMap.put(User.NAME, name);
                    userMap.put("authenticationProvider", authenticationProvider.getName());
View Full Code Here

            for (Map.Entry<String, Set<String>> entry : providerUsers.entrySet())
            {
                String providerName = entry.getKey();
                AuthenticationProvider provider = requestProviders.get(providerName);
                Set<String> usersToDelete = entry.getValue();
                PreferencesProvider preferencesProvider = provider.getPreferencesProvider();

                if (preferencesProvider != null && !usersToDelete.isEmpty())
                {
                    String[] users = usersToDelete.toArray(new String[usersToDelete.size()]);
                    preferencesProvider.deletePreferences(users);
                }
            }
        }

    }
View Full Code Here

    public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
    {
        if(childClass == PreferencesProvider.class)
        {
            attributes = new HashMap<String, Object>(attributes);
            PreferencesProvider pp = getObjectFactory().create(PreferencesProvider.class, attributes, this);

            _preferencesProvider = pp;
            return (C)pp;
        }
        throw new IllegalArgumentException("Cannot create child of class " + childClass.getSimpleName());
View Full Code Here

                                                 ".prefs.json",
                                                 "{\"test_user\":{\"pref1\": \"pref1Value\", \"pref2\": 1.0} }");
        try
        {
            attributes.put(FileSystemPreferencesProvider.PATH, file.getAbsolutePath());
            PreferencesProvider provider = new FileSystemPreferencesProviderImpl(attributes,_authenticationProvider);
            provider.open();
            assertNotNull("Preferences provider was not recovered", provider);
            assertEquals("Unexpected name", "test-provider", provider.getName());
            assertEquals("Unexpected id", id, provider.getId());
            assertEquals("Unexpected path", file.getAbsolutePath(), provider.getAttribute(
                    FileSystemPreferencesProvider.PATH));
        }
        finally
        {
            file.delete();
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.model.PreferencesProvider

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.