Java Code Examples for org.apache.sshd.server.session.ServerSession#getAttribute()

The following examples show how to use org.apache.sshd.server.session.ServerSession#getAttribute() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tomee   File:    License: Apache License 2.0 5 votes vote down vote up
public void setSession(final ServerSession session) {
    final String username = session.getAttribute(OpenEJBJaasPasswordAuthenticator.USERNAME_KEY);
    if (username == null) {
        throw new IllegalStateException("No username in the session");

    loginContext = session.getAttribute(OpenEJBJaasPasswordAuthenticator.LOGIN_CONTEXT_KEY);
Example 2
Source Project: onedev   File:    License: MIT License 4 votes vote down vote up
public Long getPublicKeyOwnerId(ServerSession session) {
	return session.getAttribute(ATTR_PUBLIC_KEY_OWNER_ID);