Package org.apache.qpid.server.security.access.management

Examples of org.apache.qpid.server.security.access.management.AMQUserManagementMBean


    public void initialiseManagement(ServerConfiguration config) throws ConfigurationException
    {
        try
        {
            AMQUserManagementMBean _mbean = new AMQUserManagementMBean();

            List<String> principalDBs = config.getManagementPrincipalDBs();

            if (principalDBs.size() == 0)
            {
                throw new ConfigurationException("No principal-database specified for jmx security");
            }

            String databaseName = principalDBs.get(0);

            PrincipalDatabase database = getDatabases().get(databaseName);

            if (database == null)
            {
                throw new ConfigurationException("Principal-database '" + databaseName + "' not found");
            }

            _mbean.setPrincipalDatabase(database);

            List<String> jmxaccesslist = config.getManagementAccessList();

            if (jmxaccesslist.size() == 0)
            {
                throw new ConfigurationException("No access control files specified for jmx security");
            }

            String jmxaccesssFile = null;

            try
            {
                jmxaccesssFile = PropertyUtils.replaceProperties(jmxaccesslist.get(0));
            }
            catch (PropertyException e)
            {
                throw new ConfigurationException("Unable to parse access control filename '" + jmxaccesssFile + "'");
            }

            try
            {
                _mbean.setAccessFile(jmxaccesssFile);
            }
            catch (IOException e)
            {
                _logger.warn("Unable to load access file:" + jmxaccesssFile);
            }

            try
            {
                _mbean.register();
            }
            catch (AMQException e)
            {
                _logger.warn("Unable to register user management MBean");
            }
View Full Code Here


    public void initialiseManagement(ServerConfiguration config) throws ConfigurationException
    {
        try
        {
            AMQUserManagementMBean _mbean = new AMQUserManagementMBean();

            List<String> principalDBs = config.getManagementPrincipalDBs();

            if (principalDBs.size() == 0)
            {
                throw new ConfigurationException("No principal-database specified for jmx security");
            }

            String databaseName = principalDBs.get(0);

            PrincipalDatabase database = getDatabases().get(databaseName);

            if (database == null)
            {
                throw new ConfigurationException("Principal-database '" + databaseName + "' not found");
            }

            _mbean.setPrincipalDatabase(database);

            List<String> jmxaccesslist = config.getManagementAccessList();

            if (jmxaccesslist.size() == 0)
            {
                throw new ConfigurationException("No access control files specified for jmx security");
            }

            String jmxaccesssFile = null;

            try
            {
                jmxaccesssFile = PropertyUtils.replaceProperties(jmxaccesslist.get(0));
            }
            catch (PropertyException e)
            {
                throw new ConfigurationException("Unable to parse access control filename '" + jmxaccesssFile + "'");
            }

            try
            {
                _mbean.setAccessFile(jmxaccesssFile);
            }
            catch (IOException e)
            {
                _logger.warn("Unable to load access file:" + jmxaccesssFile);
            }

            _mbean.register();
        }
        catch (JMException e)
        {
            _logger.warn("User management disabled as unable to create MBean:" + e);
        }
View Full Code Here

    public void initialiseManagement(Configuration config) throws ConfigurationException
    {
        try
        {
            AMQUserManagementMBean _mbean = new AMQUserManagementMBean();

            String baseSecurity = "security.jmx";
            List<String> principalDBs = config.getList(baseSecurity + ".principal-database");

            if (principalDBs.size() == 0)
            {
                throw new ConfigurationException("No principal-database specified for jmx security(" + baseSecurity + ".principal-database)");
            }

            String databaseName = principalDBs.get(0);

            PrincipalDatabase database = getDatabases().get(databaseName);

            if (database == null)
            {
                throw new ConfigurationException("Principal-database '" + databaseName + "' not found");
            }

            _mbean.setPrincipalDatabase(database);

            List<String> jmxaccesslist = config.getList(baseSecurity + ".access");

            if (jmxaccesslist.size() == 0)
            {
                throw new ConfigurationException("No access control files specified for jmx security(" + baseSecurity + ".access)");
            }

            String jmxaccesssFile = null;

            try
            {
                jmxaccesssFile = PropertyUtils.replaceProperties(jmxaccesslist.get(0));
            }
            catch (PropertyException e)
            {
                throw new ConfigurationException("Unable to parse access control filename '" + jmxaccesssFile + "'");
            }

            try
            {
                _mbean.setAccessFile(jmxaccesssFile);
            }
            catch (IOException e)
            {
                _logger.warn("Unable to load access file:" + jmxaccesssFile);
            }

            try
            {
                _mbean.register();
            }
            catch (AMQException e)
            {
                _logger.warn("Unable to register user management MBean");
            }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.access.management.AMQUserManagementMBean

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.