[jdev] Implementing db:result with JSO

Daniel Tietze daniel.tietze at go4teams.com
Mon Mar 29 08:43:51 CST 2004


Hi.

The problem indeed seems to be fixed in the current version.
But I'm encountering another strange problem. I implemented
a "db:result" packet, following the docs. The thing appears
to send itself OK, at least that's what my Logger tells me:

[LOGGER]  sent: <db:result xmlns='jabber:server' from='athen.go4teams.com'
to='belfast.go4teams.com'>danielduesentrieb</db:result>

On the Jabber server (jabberd2), this package is not
received/processed until I kill my server. I get the "sent"
output on my own server right away, but only after I kill my
server with CTRL-C (closing all connections) the "jabberd -D"
output shows that it has received this packet (debug from io.c:189).

I have found no way to flush the underlying JSO stream implementation
to ensure that my packet is being sent out.

I'm attaching my JSO extension class to the bottom of this message.

Here's how I'm sending it:
---------------------------
try
{
	DialbackResultPacket dbr = new
DialbackResultPacket(JSOImplementation.getInstance().getDataFactory());
	dbr.setDialbackText("danielduesentrieb");
	dbr.setTo(new JID("belfast.go4teams.com"));
	dbr.setFrom(new JID("athen.go4teams.com"));
	// Send the Dialback result packet
	connection.send(dbr);
}
catch (Exception ex)
{
	ex.printStackTrace();
}
---------------------------

Any help greatly appreciated, as usual.

   Daniel

--[ 8< SNIP for Dialback Packet implementation ] -------

public interface DialbackResult
{
	public static final NSI NAME = new NSI("db:result", "jabber:server");

	void setDialbackText(String text);

	String getDialbackText();



}


public class DialbackResultPacket
		extends BasicPacketNode
		implements DialbackResult
{
	StreamDataFactory fact;

	public DialbackResultPacket(StreamDataFactory sdf)
	{
		super(sdf, NAME);
		fact = sdf;
	}

	public DialbackResultPacket(org.jabberstudio.jso.StreamElement
streamElement, BasicPacketNode basicPacketNode)
	{
		super(streamElement, basicPacketNode);
	}


	public org.jabberstudio.jso.StreamObject
copy(org.jabberstudio.jso.StreamElement streamElement)
	{
		return new DialbackResultPacket(streamElement, this);
	}

	public String getDialbackText()
	{
		return null;
	}

	public void setDialbackText(String text)
	{
		this.add(new TextNode(fact, text));
	}
}




More information about the JDev mailing list