Examples of SecurityManager


Examples of org.apache.qpid.server.security.SecurityManager

        return connection;
    }

    public static Exchange createExchange(String hostName) throws Exception
    {
        SecurityManager securityManager = new SecurityManager(mock(Broker.class), false);
        VirtualHost virtualHost = mock(VirtualHost.class);
        when(virtualHost.getName()).thenReturn(hostName);
        when(virtualHost.getSecurityManager()).thenReturn(securityManager);
        DefaultExchangeFactory factory = new DefaultExchangeFactory(virtualHost);
        return factory.createExchange("amp.direct", "direct", false, false);
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

public class VirtualHostRecovererTest extends TestCase
{
    public void testCreate()
    {
        StatisticsGatherer statisticsGatherer = mock(StatisticsGatherer.class);
        SecurityManager securityManager = mock(SecurityManager.class);
        ConfigurationEntry entry = mock(ConfigurationEntry.class);
        Broker parent = mock(Broker.class);
        when(parent.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(3000l);
        when(parent.getSecurityManager()).thenReturn(securityManager);
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

    }

    public void testCreateVirtualHostFromStoreConfigAtrributes()
    {
        StatisticsGatherer statisticsGatherer = mock(StatisticsGatherer.class);
        SecurityManager securityManager = mock(SecurityManager.class);
        ConfigurationEntry entry = mock(ConfigurationEntry.class);
        Broker parent = mock(Broker.class);
        when(parent.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(3000l);
        when(parent.getSecurityManager()).thenReturn(securityManager);
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

    }

    public void checkMandatoryAttributesAreValidated(String[] mandatoryAttributes, Map<String, Object> attributes)
    {
        StatisticsGatherer statisticsGatherer = mock(StatisticsGatherer.class);
        SecurityManager securityManager = mock(SecurityManager.class);
        ConfigurationEntry entry = mock(ConfigurationEntry.class);
        Broker parent = mock(Broker.class);
        when(parent.getSecurityManager()).thenReturn(securityManager);
        VirtualHostRecoverer recoverer = new VirtualHostRecoverer(statisticsGatherer);
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

            logStartupMessages(CurrentActor.get());

            // Management needs to be registered so that JMXManagement.childAdded can create optional management objects
            createAndStartManagementPlugins(_configuration, _broker);

            _securityManager = new SecurityManager(_configuration.getConfig());

            _groupManagerList = createGroupManagers(_configuration);

            _authenticationManagerRegistry = createAuthenticationManagerRegistry(_configuration, new GroupPrincipalAccessor(_groupManagerList));
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

        _id = UUIDGenerator.generateVhostUUID(_name);

        CurrentActor.get().message(VirtualHostMessages.CREATED(_name));

        _securityManager = new SecurityManager(_appRegistry.getSecurityManager(), _vhostConfig.getConfig());

        _connectionRegistry = new ConnectionRegistry();
        _connectionRegistry.addRegistryChangeListener(this);

        _houseKeepingTasks = new ScheduledThreadPoolExecutor(_vhostConfig.getHouseKeepingThreadCount());
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

        String type = getType(method, args);
        String vhost = getVirtualHost(method, args);
        int impact = getImpact(method, args);

        // Get the security manager for the virtual host (if set)
        SecurityManager security;
        if (vhost == null)
        {
            security = _appRegistry.getSecurityManager();
        }
        else
        {
            security = _appRegistry.getVirtualHostRegistry().getVirtualHost(vhost).getSecurityManager();
        }

        methodName = getMethodName(method, args);
        if (isAccessMethod(methodName) || impact == MBeanOperationInfo.INFO)
        {
            // Check for read-only method invocation permission
            if (!security.authoriseMethod(Operation.ACCESS, type, methodName))
            {
                throw new SecurityException("Permission denied: Access " + methodName);
            }
        }
        else
        {
            // Check for setting properties permission
            if (!security.authoriseMethod(Operation.UPDATE, type, methodName))
            {
                throw new SecurityException("Permission denied: Update " + methodName);
            }
        }
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

            String type = getType(method, args);
            String vhost = getVirtualHost(method, args);
            int impact = getImpact(method, args);

            // Get the security manager for the virtual host (if set)
            SecurityManager security;
            if (vhost == null)
            {
                security = _appRegistry.getSecurityManager();
            }
            else
            {
                security = _appRegistry.getVirtualHostRegistry().getVirtualHost(vhost).getSecurityManager();
            }

            methodName = getMethodName(method, args);
            if (isAccessMethod(methodName) || impact == MBeanOperationInfo.INFO)
            {
                // Check for read-only method invocation permission
                if (!security.authoriseMethod(Operation.ACCESS, type, methodName))
                {
                    throw new SecurityException("Permission denied: Access " + methodName);
                }
            }
            else
            {
                // Check for setting properties permission
                if (!security.authoriseMethod(Operation.UPDATE, type, methodName))
                {
                    throw new SecurityException("Permission denied: Update " + methodName);
                }
            }
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

        _qmfId = _appRegistry.getConfigStore().createId();
        _id = UUIDGenerator.generateVhostUUID(_name);

        CurrentActor.get().message(VirtualHostMessages.CREATED(_name));

        _securityManager = new SecurityManager(_appRegistry.getSecurityManager());
        _securityManager.configureHostPlugins(_vhostConfig);

        _connectionRegistry = new ConnectionRegistry();
        _connectionRegistry.addRegistryChangeListener(this);
View Full Code Here

Examples of org.apache.qpid.server.security.SecurityManager

            _qmfService = new QMFService(getConfigStore(), this);

            logStartupMessages(CurrentActor.get());

            _securityManager = new SecurityManager(_configuration, _pluginManager);

            _authenticationManagerRegistry = createAuthenticationManagerRegistry(_configuration, _pluginManager);

            if(!_authManagerChangeListeners.isEmpty())
            {
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.