本文整理汇总了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.");
}
}
示例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.");
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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));
}
示例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);
}
示例11: createFileSystemView
import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public FileSystemView createFileSystemView(final Session username) {
return new AndroidFileSystemView(username.getUsername(), context);
}
示例12: sessionCreated
import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionCreated(Session session) {
}
示例13: sessionChanged
import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionChanged(Session session) {
}
示例14: sessionClosed
import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public void sessionClosed(Session session) {
connection.close();
}
示例15: create
import org.apache.sshd.common.Session; //导入依赖的package包/类
@Override
public TcpipForwarder create( Session session )
{
return new DefaultTcpipForwarder( session );
}