Package org.apache.qpid.server.security

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


            initialiseManagedObjectRegistry();

            _virtualHostRegistry = new VirtualHostRegistry(this);

            _securityManager = new SecurityManager(_configuration, _pluginManager);

            createDatabaseManager(_configuration);

            _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
View Full Code Here


            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 = ApplicationRegistry.getInstance().getSecurityManager();
            }
            else
            {
                security = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost(vhost).getSecurityManager();
            }
           
      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 if (isUpdateMethod(methodName))
            {
              // Check for setting properties permission
                if (!security.authoriseMethod(Operation.UPDATE, type, methodName))
                {
                    throw new SecurityException("Permission denied: Update " + methodName);
                }
            }
      else
            {
              // Check for invoking/executing method action/operation permission
                if (!security.authoriseMethod(Operation.EXECUTE, type, methodName))
                {
                    throw new SecurityException("Permission denied: Execute " + methodName);
                }
            }
     
View Full Code Here

        if (_name == null || _name.length() == 0)
        {
        throw new IllegalArgumentException("Illegal name (" + _name + ") for virtualhost.");
        }

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

        _virtualHostMBean = new VirtualHostMBean();

        _connectionRegistry = new ConnectionRegistry();
View Full Code Here

            initialiseManagedObjectRegistry();

            _virtualHostRegistry = new VirtualHostRegistry(this);

            _securityManager = new SecurityManager(_configuration, _pluginManager);

            _authenticationManager = createAuthenticationManager();

            _managedObjectRegistry.start();
        }
View Full Code Here

    }

    private boolean isQueueUpdateMethodAuthorized(String methodName, VirtualHost host)
    {
        SecurityManager securityManager = host.getSecurityManager();
        return securityManager.authoriseMethod(Operation.UPDATE, "VirtualHost.Queue", methodName);
    }
View Full Code Here

        _id = UUIDGenerator.generateVhostUUID(_name);

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

        _securityManager = new SecurityManager(parentSecurityManager, _vhostConfig.getConfig().getString("security.acl"), _name);

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

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

        when(broker.getId()).thenReturn(UUID.randomUUID());
        when(broker.getSubjectCreator(any(SocketAddress.class))).thenReturn(subjectCreator);
        RootMessageLogger rootMessageLogger = CurrentActor.get().getRootMessageLogger();
        when(broker.getRootMessageLogger()).thenReturn(rootMessageLogger);
        when(broker.getVirtualHostRegistry()).thenReturn(new VirtualHostRegistry());
        when(broker.getSecurityManager()).thenReturn(new SecurityManager(mock(Broker.class), false));
        GenericActor.setDefaultMessageLogger(rootMessageLogger);
        return broker;
    }
View Full Code Here

    public static VirtualHost createVirtualHost(VirtualHostConfiguration virtualHostConfiguration, VirtualHostRegistry virtualHostRegistry)
            throws Exception
    {
        StatisticsGatherer statisticsGatherer = mock(StatisticsGatherer.class);
        VirtualHost host = new VirtualHostImpl(virtualHostRegistry, statisticsGatherer, new SecurityManager(mock(Broker.class), false), virtualHostConfiguration);
        virtualHostRegistry.registerVirtualHost(host);
        return host;
    }
View Full Code Here

        return host;
    }

    public static VirtualHost createVirtualHost(VirtualHostConfiguration virtualHostConfiguration) throws Exception
    {
        return new VirtualHostImpl(null, mock(StatisticsGatherer.class), new SecurityManager(mock(Broker.class), false), virtualHostConfiguration);
    }
View Full Code Here

        return new InternalTestProtocolSession(virtualHost, createBrokerMock());
    }

    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

TOP

Related Classes of org.apache.qpid.server.security.SecurityManager$ClearingThreadLocal

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.