Package org.apache.qpid.server.logging

Examples of org.apache.qpid.server.logging.LogActor


            subject = tryToAuthenticate(request, managementConfig);
            if (subject == null)
            {
                throw new SecurityException("Only authenticated users can access the management interface");
            }
            LogActor actor = createHttpManagementActor(broker, request);
            if (hasAccessToManagement(broker.getSecurityManager(), subject, actor))
            {
                saveAuthorisedSubject(session, subject, actor);
            }
            else
View Full Code Here


            CurrentActor.set(_actor);
        }
        else
        {
            ServerSession channel = (ServerSession) getSession(event.getChannel());
            LogActor channelActor = null;

            if (channel != null)
            {
                channelActor = channel.getLogActor();
            }
View Full Code Here

            throw new NullPointerException("LogSubject has not been set");
        }

        UnitTestMessageLogger logger = new UnitTestMessageLogger(statusUpdatesEnabled);

        LogActor actor = new TestLogActor(logger);

        actor.message(_subject, new LogMessage()
        {
            public String toString()
            {
                return "<Log Message>";
            }
View Full Code Here

            // Create a new actor using retrieving the rootMessageLogger from
            // the default ApplicationRegistry.
            //fixme reminder that we need a better approach for broker testing.
            try
            {
                LogActor defaultActor = CurrentActor.get();

                AMQPConnectionActor actor = new AMQPConnectionActor(getConnection(),
                                                                    new NullRootMessageLogger());

                CurrentActor.set(actor);
View Full Code Here

        VirtualHostConfiguration vhostConfig = mock(VirtualHostConfiguration.class);
        when(_virtualHost.getConfiguration()).thenReturn(vhostConfig);
        _queueConfiguration = mock(QueueConfiguration.class);
        when(vhostConfig.getQueueConfiguration(anyString())).thenReturn(_queueConfiguration);
        LogActor logActor = mock(LogActor.class);
        CurrentActor.set(logActor);
        RootMessageLogger rootLogger = mock(RootMessageLogger.class);
        when(logActor.getRootMessageLogger()).thenReturn(rootLogger);
        DurableConfigurationStore store = mock(DurableConfigurationStore.class);
        when(_virtualHost.getDurableConfigurationStore()).thenReturn(store);

        mockExchangeCreation();
        mockQueueRegistry();
View Full Code Here

        if(saslServer.isComplete())
        {
            Subject subject = subjectCreator.createSubjectWithGroups(saslServer.getAuthorizationID());

            Broker broker = getBroker();
            LogActor actor = HttpManagementUtil.getOrCreateAndCacheLogActor(request, broker);
            if (!HttpManagementUtil.hasAccessToManagement(broker.getSecurityManager(), subject, actor))
            {
                sendError(response, HttpServletResponse.SC_FORBIDDEN);
                return;
            }
View Full Code Here

        AMQBody body = frame.getBodyFrame();

        //Look up the Channel's Actor and set that as the current actor
        // If that is not available then we can use the ConnectionActor
        // that is associated with this AMQMPSession.
        LogActor channelActor = null;
        if (_channelMap.get(channelId) != null)
        {
            channelActor = _channelMap.get(channelId).getLogActor();
        }
        CurrentActor.set(channelActor == null ? _actor : channelActor);
View Full Code Here

    protected void authoriseManagement(HttpServletRequest request, Subject subject)
    {
        // TODO: We should eliminate SecurityManager.setThreadSubject in favour of Subject.doAs
        SecurityManager.setThreadSubject(subject)// Required for accessManagement check
        LogActor actor = createHttpManagementActor(request);
        CurrentActor.set(actor);
        try
        {
            try
            {
View Full Code Here

    protected void setAuthorisedSubjectInSession(Subject subject, HttpServletRequest request, final HttpSession session)
    {
        session.setAttribute(ATTR_SUBJECT, subject);

        LogActor logActor = createHttpManagementActor(request);
        // Cause the user logon to be logged.
        session.setAttribute(ATTR_LOGIN_LOGOUT_REPORTER, new LoginLogoutReporter(logActor, subject));
    }
View Full Code Here

            user = splitConnectionId[1];
        }

        // use a separate instance of actor as subject is not set on connect/disconnect
        // we need to pass principal name explicitly into log actor
        LogActor logActor = new ManagementActor(_appRegistry.getRootMessageLogger(), user);
        if (JMXConnectionNotification.OPENED.equals(type))
        {
            logActor.message(ManagementConsoleMessages.OPEN(user));
        }
        else if (JMXConnectionNotification.CLOSED.equals(type) ||
                 JMXConnectionNotification.FAILED.equals(type))
        {
            logActor.message(ManagementConsoleMessages.CLOSE(user));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.logging.LogActor

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.