当前位置: 首页>>代码示例>>Java>>正文


Java Session类代码示例

本文整理汇总了Java中org.apache.sshd.common.Session的典型用法代码示例。如果您正苦于以下问题:Java Session类的具体用法?Java Session怎么用?Java Session使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Session类属于org.apache.sshd.common包,在下文中一共展示了Session类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sessionCreated

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionCreated(Session session) {
    // this may not be called if the listener is created after the session
    // has been created
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("session " + session.toString() + "gets started.");
    }
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:9,代码来源:SshRequestLogListener.java

示例2: sessionClosed

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionClosed(Session session) {
    for (SshRequestInfo request : sshRequestList) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("logging the ssh request info " + request.toString());
        }
        requestLog.log(request);
    }
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("session" + session.toString() + " closed.");
    }
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:13,代码来源:SshRequestLogListener.java

示例3: canConnect

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public boolean canConnect(SshdSocketAddress socketAddress, Session session) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Connect forwarding requested from {} for {}", socketAddress, session);
    }

    // we don't want to allow forwards to just anywhere, we only allow them to the artifactory host.
    int sp = socketAddress.getPort();
    if (sp != toPort) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Denying forwarding requested from {} for {} tohost {} toPort {}", socketAddress, session,
                            toHost, Integer.valueOf(toPort));
        }

        return false;
    }

    String spHost = socketAddress.getHostName().toLowerCase();
    if (!toHost.equals(spHost)) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Denying forwarding requested from {} for {} tohost {} toPort {}", socketAddress, session,
                            toHost, Integer.valueOf(toPort));
        }

        return false;
    }

    return true;
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:30,代码来源:LocalForwardingFilter.java

示例4: canForwardX11

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public boolean canForwardX11(Session session) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("X11 forwarding requested for {}", session);
    }

    return false;
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:9,代码来源:DenyingForwardingFilter.java

示例5: canListen

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public boolean canListen(SshdSocketAddress socketAddress, Session session) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Listen forwarding requested from {} for {}", socketAddress, session);
    }

    return false;
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:9,代码来源:DenyingForwardingFilter.java

示例6: canConnect

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public boolean canConnect(SshdSocketAddress socketAddress, Session session) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Connect forwarding requested from {} for {}", socketAddress, session);
    }

    return false;
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:9,代码来源:DenyingForwardingFilter.java

示例7: canForwardAgent

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public boolean canForwardAgent(Session session) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Agent forwarding requested for {}", session);
    }

    return false;
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:9,代码来源:DenyingForwardingFilter.java

示例8: sessionClosed

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionClosed(Session session) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Session is closed. Try to interrupt the downloading thread if it is still blocked.");
    }

    if (null != this.threadRunningScpCommand) {
        this.threadRunningScpCommand.interrupt();
    }
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:11,代码来源:ScpCommandSessionListener.java

示例9: testDenyFilter

import org.apache.sshd.common.Session; //导入依赖的package包/类
/**
 * not a test.
 * 
 * @param filter
 */
@Test(enabled = false)
public static void testDenyFilter(ForwardingFilter filter) {
    Session session = Mockito.mock(Session.class);
    SshdSocketAddress address = Mockito.mock(SshdSocketAddress.class);

    Assert.assertFalse(filter.canForwardAgent(session));
    Assert.assertFalse(filter.canForwardX11(session));
    Assert.assertFalse(filter.canListen(address, session));
    Assert.assertFalse(filter.canConnect(address, session));
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:16,代码来源:TestForwardingFilters.java

示例10: testLocalForwardFilter

import org.apache.sshd.common.Session; //导入依赖的package包/类
/**
 * not a test.
 * 
 * @param filter
 */
@SuppressWarnings("boxing")
@Test(enabled = false)
public static void testLocalForwardFilter(ForwardingFilter filter, String hostname, int port, boolean expected) {
    Session session = Mockito.mock(Session.class);
    SshdSocketAddress address = Mockito.mock(SshdSocketAddress.class);
    Mockito.when(address.getHostName()).thenReturn(hostname);
    Mockito.when(address.getPort()).thenReturn(port);

    Assert.assertFalse(filter.canForwardAgent(session));
    Assert.assertFalse(filter.canForwardX11(session));
    Assert.assertFalse(filter.canListen(address, session));
    Assert.assertEquals(filter.canConnect(address, session), expected);
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:19,代码来源:TestForwardingFilters.java

示例11: createFileSystemView

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public FileSystemView createFileSystemView(final Session username) {
    return new AndroidFileSystemView(username.getUsername(), context);
}
 
开发者ID:KDE,项目名称:kdeconnect-android,代码行数:5,代码来源:SimpleSftpServer.java

示例12: sessionCreated

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionCreated(Session session) {
}
 
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:4,代码来源:CloseListener.java

示例13: sessionChanged

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionChanged(Session session) {
}
 
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:4,代码来源:CloseListener.java

示例14: sessionClosed

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionClosed(Session session) {
    connection.close();
}
 
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:5,代码来源:CloseListener.java

示例15: create

import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public TcpipForwarder create( Session session )
{
   return new DefaultTcpipForwarder( session );
}
 
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:6,代码来源:DefaultTcpipForwarderFactory.java


注:本文中的org.apache.sshd.common.Session类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。