use of org.apache.ignite.internal.processors.odbc.jdbc.JdbcConnectionContext in project ignite by apache.
the class ClientListenerProcessor method clientConnectionDescription.
/**
* Compose connection description string.
* @param ses Client's NIO session.
* @param ctx Client's connection context.
* @return connection description.
*/
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
private static String clientConnectionDescription(GridNioSession ses, ClientListenerConnectionContext ctx) {
StringBuilder sb = new StringBuilder();
if (ctx instanceof JdbcConnectionContext)
sb.append("JdbcClient [");
else if (ctx instanceof OdbcConnectionContext)
sb.append("OdbcClient [");
else
sb.append("ThinClient [");
InetSocketAddress rmtAddr = ses.remoteAddress();
InetSocketAddress locAddr = ses.localAddress();
assert rmtAddr != null;
assert locAddr != null;
String rmtAddrStr = rmtAddr.getHostString() + ":" + rmtAddr.getPort();
String locAddrStr = locAddr.getHostString() + ":" + locAddr.getPort();
String login = ctx.securityContext() == null ? "<anonymous>" : "@" + ctx.securityContext().subject().login();
sb.append("id=" + ctx.connectionId());
sb.append(", user=").append(login);
sb.append(", rmtAddr=" + rmtAddrStr);
sb.append(", locAddr=" + locAddrStr);
return sb.append(']').toString();
}
Aggregations