Search in sources :

Example 1 with Poller

use of com.adaptris.core.Poller in project interlok by adaptris.

the class SftpConsumerTest method createConsumerExamples.

private List createConsumerExamples(FileTransferConnection conn, Poller... pollers) {
    List<StandaloneConsumer> result = new ArrayList();
    try {
        for (Poller p : pollers) {
            FtpConsumer ftp = new FtpConsumer();
            ftp.setProcDirectory("/proc");
            ftp.setFtpEndpoint("sftp://overrideuser@hostname:port/path/to/directory");
            ftp.setFilterExpression("*.xml");
            ftp.setPoller(p);
            result.add(new StandaloneConsumer(conn, ftp));
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) StandaloneConsumer(com.adaptris.core.StandaloneConsumer) Poller(com.adaptris.core.Poller)

Example 2 with Poller

use of com.adaptris.core.Poller in project interlok by adaptris.

the class FsConsumerCase method retrieveObjectsForSampleConfig.

@Override
protected List retrieveObjectsForSampleConfig() {
    ArrayList result = new ArrayList();
    for (FilterImplementation filter : FilterImplementation.values()) {
        for (Poller poller : POLLER_LIST) {
            for (FileSortImplementation sort : FileSortImplementation.values()) {
                StandaloneConsumer sc = new StandaloneConsumer(createConsumer(null));
                ((FsConsumerImpl) sc.getConsumer()).setPoller(poller);
                ((FsConsumerImpl) sc.getConsumer()).setBaseDirectoryUrl(filter.getEndpoint());
                ((FsConsumerImpl) sc.getConsumer()).setFilterExpression(filter.getExpression());
                ((FsConsumerImpl) sc.getConsumer()).setFileFilterImp(filter.getImpl());
                ((FsConsumerImpl) sc.getConsumer()).setFileSorter(sort.getImplementation());
                result.add(sc);
            }
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) StandaloneConsumer(com.adaptris.core.StandaloneConsumer) Poller(com.adaptris.core.Poller) FixedIntervalPoller(com.adaptris.core.FixedIntervalPoller) QuartzCronPoller(com.adaptris.core.QuartzCronPoller)

Example 3 with Poller

use of com.adaptris.core.Poller in project interlok by adaptris.

the class RelaxedSftpConsumerTest method createConsumerExamples.

private List createConsumerExamples(FileTransferConnection conn, Poller... pollers) {
    List<StandaloneConsumer> result = new ArrayList();
    try {
        for (Poller p : pollers) {
            RelaxedFtpConsumer ftp = new RelaxedFtpConsumer();
            ftp.setFtpEndpoint("sftp://overrideuser@hostname:port/path/to/directory");
            ftp.setFilterExpression("*.xml");
            ftp.setPoller(p);
            result.add(new StandaloneConsumer(conn, ftp));
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) StandaloneConsumer(com.adaptris.core.StandaloneConsumer) Poller(com.adaptris.core.Poller)

Aggregations

Poller (com.adaptris.core.Poller)3 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)3 ArrayList (java.util.ArrayList)3 FixedIntervalPoller (com.adaptris.core.FixedIntervalPoller)1 QuartzCronPoller (com.adaptris.core.QuartzCronPoller)1