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


Java ForwardingFilter类代码示例

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


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

示例1: localPortForwardingRequested

import org.apache.sshd.common.ForwardingFilter; //导入依赖的package包/类
@Override
public synchronized SshdSocketAddress localPortForwardingRequested(SshdSocketAddress local) throws IOException {
    if (local == null) {
        throw new IllegalArgumentException("Local address is null");
    }
    if (local.getPort() < 0) {
        throw new IllegalArgumentException("Invalid local port: " + local.getPort());
    }
    final ForwardingFilter filter = session.getFactoryManager().getTcpipForwardingFilter();
    if (filter == null || !filter.canListen(local, session)) {
        throw new IOException("Rejected address: " + local);
    }
    SshdSocketAddress bound = doBind(local);
    localForwards.add(bound);
    return bound;
}
 
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:17,代码来源:DefaultTcpipForwarder.java

示例2: testDenyFilter

import org.apache.sshd.common.ForwardingFilter; //导入依赖的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

示例3: testLocalForwardFilter

import org.apache.sshd.common.ForwardingFilter; //导入依赖的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

示例4: getForwardingFilter

import org.apache.sshd.common.ForwardingFilter; //导入依赖的package包/类
/**
 * 
 * @return an implementation of {@link ForwardingFilter} that can be used to see if forwarding is allowed.
 */
ForwardingFilter getForwardingFilter();
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:6,代码来源:SshdSettingsInterface.java

示例5: getForwardingFilter

import org.apache.sshd.common.ForwardingFilter; //导入依赖的package包/类
@Override
public ForwardingFilter getForwardingFilter() {
    if (isForwardingAllowed()) {
        return new LocalForwardingFilter(artifactoryInfo.getArtifactoryHost(), artifactoryInfo.getArtifactoryPort());
    } else {
        return new DenyingForwardingFilter();
    }
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:9,代码来源:SshdProxySettings.java


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