Search in sources :

Example 11 with Record

use of org.apache.qpid.proton.engine.Record in project hono by eclipse.

the class Constants method setClientPrincipal.

/**
 * Gets the principal representing a connection's client.
 *
 * @param con The connection to get the principal for.
 * @param principal The principal representing the authenticated client.
 * @throws NullPointerException if any of the parameters is {@code null}.
 */
public static void setClientPrincipal(final ProtonConnection con, final HonoUser principal) {
    Objects.requireNonNull(principal);
    Record attachments = Objects.requireNonNull(con).attachments();
    attachments.set(KEY_CLIENT_PRINCIPAL, HonoUser.class, principal);
}
Also used : Record(org.apache.qpid.proton.engine.Record)

Aggregations

Record (org.apache.qpid.proton.engine.Record)11 Test (org.junit.Test)5 ProtonConnection (io.vertx.proton.ProtonConnection)4 Connection (org.apache.qpid.proton.engine.Connection)4 Session (org.apache.qpid.proton.engine.Session)4 RecordImpl (org.apache.qpid.proton.engine.impl.RecordImpl)4 Handler (io.vertx.core.Handler)3 ProtonReceiver (io.vertx.proton.ProtonReceiver)2 ProtonSender (io.vertx.proton.ProtonSender)2 Sender (org.apache.qpid.proton.engine.Sender)2 Vertx (io.vertx.core.Vertx)1 Target (org.apache.qpid.proton.amqp.messaging.Target)1 Delivery (org.apache.qpid.proton.engine.Delivery)1 Receiver (org.apache.qpid.proton.engine.Receiver)1