org.jivesoftware.smack.debugger.SmackDebugger Java Examples

The following examples show how to use org.jivesoftware.smack.debugger.SmackDebugger. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XmppTcpTransportModule.java    From Smack with Apache License 2.0 6 votes vote down vote up
XmppTcpTransportModule(XmppTcpTransportModuleDescriptor moduleDescriptor, ModularXmppClientToServerConnectionInternal connectionInternal) {
    super(moduleDescriptor, connectionInternal);

    tcpNioTransport = new XmppTcpNioTransport(connectionInternal);

    XmlPrinter incomingDebugPrettyPrinter = null;
    final SmackDebugger debugger = connectionInternal.smackDebugger;
    if (debugger != null) {
        // Incoming stream debugging.
        incomingDebugPrettyPrinter = XmlPrettyPrinter.builder()
                .setPrettyWriter(sb -> debugger.incomingStreamSink(sb))
                .build();

        // Outgoing stream debugging.
        XmlPrinter outgoingDebugPrettyPrinter = XmlPrettyPrinter.builder()
                .setPrettyWriter(sb -> debugger.outgoingStreamSink(sb))
                .build();
        outputDebugSplitter = new XmppXmlSplitter(outgoingDebugPrettyPrinter);
    }

    XmppXmlSplitter xmppXmlSplitter = new XmppXmlSplitter(MAX_ELEMENT_SIZE, xmppElementCallback,
            incomingDebugPrettyPrinter);
    splitter = new Utf8ByteXmppXmlSplitter(xmppXmlSplitter);
}
 
Example #2
Source File: ModularXmppClientToServerConnectionInternal.java    From Smack with Apache License 2.0 5 votes vote down vote up
public ModularXmppClientToServerConnectionInternal(ModularXmppClientToServerConnection connection, SmackReactor reactor,
                SmackDebugger smackDebugger, Queue<TopLevelStreamElement> outgoingElementsQueue) {
    this.connection = connection;
    this.reactor = reactor;
    this.smackDebugger = smackDebugger;
    this.outgoingElementsQueue = outgoingElementsQueue;
}
 
Example #3
Source File: ModularXmppClientToServerConnectionInternal.java    From Smack with Apache License 2.0 5 votes vote down vote up
public final void withSmackDebugger(Consumer<SmackDebugger> smackDebuggerConsumer) {
    if (smackDebugger == null) {
        return;
    }

    smackDebuggerConsumer.accept(smackDebugger);
}
 
Example #4
Source File: SLF4JDebuggerFactory.java    From Smack with Apache License 2.0 4 votes vote down vote up
@Override
public SmackDebugger create(XMPPConnection connection) throws IllegalArgumentException {
    return new SLF4JSmackDebugger(connection);
}
 
Example #5
Source File: EnhancedDebugger.java    From Smack with Apache License 2.0 4 votes vote down vote up
@Override
public SmackDebugger create(XMPPConnection connection) throws IllegalArgumentException {
    return new EnhancedDebugger(connection);
}