use of org.jivesoftware.smack.util.ObservableReader in project Smack by igniterealtime.
the class SLF4JSmackDebugger method newConnectionReader.
@Override
public Reader newConnectionReader(Reader newReader) {
reader.removeReaderListener(slf4JRawXmlListener);
reader = new ObservableReader(newReader);
reader.addReaderListener(slf4JRawXmlListener);
return reader;
}
use of org.jivesoftware.smack.util.ObservableReader in project Smack by igniterealtime.
the class LiteDebugger method newConnectionReader.
@Override
public Reader newConnectionReader(Reader newReader) {
((ObservableReader) reader).removeReaderListener(readerListener);
ObservableReader debugReader = new ObservableReader(newReader);
debugReader.addReaderListener(readerListener);
reader = debugReader;
return reader;
}
use of org.jivesoftware.smack.util.ObservableReader in project Smack by igniterealtime.
the class AbstractDebugger method newConnectionReader.
@Override
public Reader newConnectionReader(Reader newReader) {
reader.removeReaderListener(readerListener);
ObservableReader debugReader = new ObservableReader(newReader);
debugReader.addReaderListener(readerListener);
reader = debugReader;
return reader;
}
use of org.jivesoftware.smack.util.ObservableReader in project Smack by igniterealtime.
the class SmackDebugger method newConnectionReader.
/**
* Returns a new special Reader that wraps the new connection Reader. The connection
* has been secured so the connection is using a new reader and writer. The debugger
* needs to wrap the new reader and writer to keep being notified of the connection
* traffic.
*
* @param reader connection reader.
* @return a new special Reader that wraps the new connection Reader.
*/
public final Reader newConnectionReader(Reader reader) {
XmlPrettyPrinter xmlPrettyPrinter = XmlPrettyPrinter.builder().setPrettyWriter(sb -> incomingStreamSink(sb)).build();
incomingStreamSplitterForPrettyPrinting = new XmppXmlSplitter(xmlPrettyPrinter);
ObservableReader observableReader = new ObservableReader(reader);
observableReader.addReaderListener(readString -> {
try {
incomingStreamSplitterForPrettyPrinting.append(readString);
} catch (IOException e) {
throw new AssertionError(e);
}
});
return observableReader;
}
use of org.jivesoftware.smack.util.ObservableReader in project Smack by igniterealtime.
the class EnhancedDebugger method newConnectionReader.
@Override
public Reader newConnectionReader(Reader newReader) {
((ObservableReader) reader).removeReaderListener(readerListener);
ObservableReader debugReader = new ObservableReader(newReader);
debugReader.addReaderListener(readerListener);
reader = debugReader;
return reader;
}
Aggregations