Search in sources :

Example 1 with MultilineOrientedCodecFactory

use of org.opennms.netmgt.provision.support.codec.MultilineOrientedCodecFactory in project opennms by OpenNMS.

the class FtpDetector method onInit.

/**
     * <p>onInit</p>
     */
@Override
protected void onInit() {
    //setup the correct codec for this Detector
    setProtocolCodecFilter(new ProtocolCodecFilter(new MultilineOrientedCodecFactory(StandardCharsets.UTF_8, getMultilineIndicator())));
    expectBanner(expectCodeRange(100, 600));
    send(request("quit"), expectCodeRange(100, 600));
}
Also used : MultilineOrientedCodecFactory(org.opennms.netmgt.provision.support.codec.MultilineOrientedCodecFactory) ProtocolCodecFilter(org.apache.mina.filter.codec.ProtocolCodecFilter)

Example 2 with MultilineOrientedCodecFactory

use of org.opennms.netmgt.provision.support.codec.MultilineOrientedCodecFactory in project opennms by OpenNMS.

the class SmtpDetector method onInit.

/**
     * <p>onInit</p>
     */
@Override
protected void onInit() {
    setProtocolCodecFilter(new ProtocolCodecFilter(new MultilineOrientedCodecFactory(StandardCharsets.UTF_8, "-")));
    expectBanner(startsWith("220"));
    send(request("HELO LOCALHOST"), startsWith("250"));
    send(request("QUIT"), startsWith("221"));
}
Also used : MultilineOrientedCodecFactory(org.opennms.netmgt.provision.support.codec.MultilineOrientedCodecFactory) ProtocolCodecFilter(org.apache.mina.filter.codec.ProtocolCodecFilter)

Aggregations

ProtocolCodecFilter (org.apache.mina.filter.codec.ProtocolCodecFilter)2 MultilineOrientedCodecFactory (org.opennms.netmgt.provision.support.codec.MultilineOrientedCodecFactory)2