Search in sources :

Example 6 with SessionPrincipal

use of org.apache.qpid.server.connection.SessionPrincipal in project qpid-broker-j by apache.

the class AbstractMessageLogger method getActor.

protected String getActor() {
    Subject subject = Subject.getSubject(AccessController.getContext());
    SessionPrincipal sessionPrincipal = getPrincipal(subject, SessionPrincipal.class);
    String message;
    if (sessionPrincipal != null) {
        message = generateSessionMessage(sessionPrincipal.getSession());
    } else {
        ConnectionPrincipal connPrincipal = getPrincipal(subject, ConnectionPrincipal.class);
        if (connPrincipal != null) {
            message = generateConnectionMessage(connPrincipal.getConnection());
        } else {
            TaskPrincipal taskPrincipal = getPrincipal(subject, TaskPrincipal.class);
            if (taskPrincipal != null) {
                message = generateTaskMessage(taskPrincipal);
            } else {
                ManagementConnectionPrincipal managementConnection = getPrincipal(subject, ManagementConnectionPrincipal.class);
                if (managementConnection != null) {
                    message = generateManagementConnectionMessage(managementConnection, getPrincipal(subject, AuthenticatedPrincipal.class));
                } else {
                    message = "<<UNKNOWN>> ";
                }
            }
        }
    }
    return message;
}
Also used : TaskPrincipal(org.apache.qpid.server.security.auth.TaskPrincipal) SessionPrincipal(org.apache.qpid.server.connection.SessionPrincipal) ConnectionPrincipal(org.apache.qpid.server.connection.ConnectionPrincipal) ManagementConnectionPrincipal(org.apache.qpid.server.security.auth.ManagementConnectionPrincipal) Subject(javax.security.auth.Subject) ManagementConnectionPrincipal(org.apache.qpid.server.security.auth.ManagementConnectionPrincipal)

Aggregations

Subject (javax.security.auth.Subject)6 SessionPrincipal (org.apache.qpid.server.connection.SessionPrincipal)6 Principal (java.security.Principal)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 ConnectionPrincipal (org.apache.qpid.server.connection.ConnectionPrincipal)1 MessageFilter (org.apache.qpid.server.filter.MessageFilter)1 LogSubject (org.apache.qpid.server.logging.LogSubject)1 QueueLogSubject (org.apache.qpid.server.logging.subjects.QueueLogSubject)1 GenericPrincipal (org.apache.qpid.server.model.preferences.GenericPrincipal)1 MessageFilterFactory (org.apache.qpid.server.plugin.MessageFilterFactory)1 QpidServiceLoader (org.apache.qpid.server.plugin.QpidServiceLoader)1 LinkModel (org.apache.qpid.server.protocol.LinkModel)1 AuthenticatedPrincipal (org.apache.qpid.server.security.auth.AuthenticatedPrincipal)1 ManagementConnectionPrincipal (org.apache.qpid.server.security.auth.ManagementConnectionPrincipal)1