public SSLSocketChannelInput(final SSLSocketChannel socketChannel) { in = new SSLSocketChannelInputStream(socketChannel); countingIn = new ByteCountingInputStream(in); this.bufferedIn = new BufferedInputStream(countingIn); }
public boolean isDataAvailable() throws IOException { return available() > 0; } }
@Override public void consume() throws IOException { in.consume(); } }
@Override public RecordReader createRecordReader(final FlowFile flowFile, final ComponentLog logger) throws IOException, MalformedRecordException, SchemaNotFoundException { if (recordReader != null) { throw new IllegalStateException("Cannot create RecordReader because already created"); } final InputStream in = new SSLSocketChannelInputStream(sslSocketChannel); recordReader = readerFactory.createRecordReader(flowFile, in, logger); return recordReader; }
public boolean isDataAvailable() throws IOException { return available() > 0; } }
public SSLCommsSession(final SSLContext sslContext, final String hostname, final int port, final int timeoutMillis) throws IOException { final SocketChannel socketChannel = SocketChannel.open(); socketChannel.socket().connect(new InetSocketAddress(hostname, port), timeoutMillis); socketChannel.configureBlocking(false); sslSocketChannel = new SSLSocketChannel(sslContext, socketChannel,true); in = new SSLSocketChannelInputStream(sslSocketChannel); bufferedIn = new BufferedInputStream(in); out = new SSLSocketChannelOutputStream(sslSocketChannel); bufferedOut = new BufferedOutputStream(out); this.sslContext = sslContext; this.hostname = hostname; this.port = port; }
@Override public RecordReader createRecordReader(final FlowFile flowFile, final ComponentLog logger) throws IOException, MalformedRecordException, SchemaNotFoundException { if (recordReader != null) { throw new IllegalStateException("Cannot create RecordReader because already created"); } final InputStream in = new SSLSocketChannelInputStream(sslSocketChannel); recordReader = readerFactory.createRecordReader(flowFile, in, logger); return recordReader; }
public SSLCommsSession(final SSLContext sslContext, final String hostname, final int port, final int timeoutMillis) throws IOException { final SocketChannel socketChannel = SocketChannel.open(); socketChannel.socket().connect(new InetSocketAddress(hostname, port), timeoutMillis); socketChannel.configureBlocking(false); sslSocketChannel = new SSLSocketChannel(sslContext, socketChannel,true); in = new SSLSocketChannelInputStream(sslSocketChannel); bufferedIn = new BufferedInputStream(in); out = new SSLSocketChannelOutputStream(sslSocketChannel); bufferedOut = new BufferedOutputStream(out); this.sslContext = sslContext; this.hostname = hostname; this.port = port; }