final IQ iq = new IQ() { @Override public String getChildElementXML() { return "<retrieve xmlns='urn:xmpp:archive' with='test@customOpenfire.com'><set xmlns='http://jabber.org/protocol/rsm'><max xmlns='http://jabber.org/protocol/rsm'>30</max></set> </retrieve>"; } }; iq.setType(IQ.Type.GET); iq.setPacketID("987654321"); xmppConnection.sendPacket(iq);
/** * A convenience method to create an IQ packet. * * @param ID The packet ID of the * @param to To whom the packet is addressed. * @param from From whom the packet is sent. * @param type The IQ type of the packet. * @return The created IQ packet. */ public static IQ createIQ(final String ID, final String to, final String from, final IQ.Type type) { IQ iqPacket = new IQ() { public String getChildElementXML() { return null; } }; iqPacket.setPacketID(ID); iqPacket.setTo(to); iqPacket.setFrom(from); iqPacket.setType(type); return iqPacket; }
IQ iq = new IQ(); iq.setTo("destination@server"); iq.setFrom("9f30dacb@web.vlivetech.com/9f30dacb"); iq.setType(IQ.Type.GET); iq.setPacketID("1"); connection.sendPacket(iq);
/** * A convience method to create an IQ packet. * * @param ID The packet ID of the * @param to To whom the packet is addressed. * @param from From whom the packet is sent. * @param type The iq type of the packet. * @return The created IQ packet. */ protected static IQ createIQ(final String ID, final String to, final String from, final IQ.Type type) { IQ iqPacket = new IQ() { public String getChildElementXML() { return null; } }; iqPacket.setPacketID(ID); iqPacket.setTo(to); iqPacket.setFrom(from); iqPacket.setType(type); return iqPacket; }
/** * A convenience method to create an IQ packet. * * @param ID The packet ID of the * @param to To whom the packet is addressed. * @param from From whom the packet is sent. * @param type The IQ type of the packet. * @return The created IQ packet. */ public static IQ createIQ(final String ID, final String to, final String from, final IQ.Type type) { IQ iqPacket = new IQ() { public String getChildElementXML() { return null; } }; iqPacket.setPacketID(ID); iqPacket.setTo(to); iqPacket.setFrom(from); iqPacket.setType(type); return iqPacket; }
/** * A convenience method to create an IQ packet. * * @param ID The packet ID of the * @param to To whom the packet is addressed. * @param from From whom the packet is sent. * @param type The IQ type of the packet. * @return The created IQ packet. */ public static IQ createIQ(final String ID, final String to, final String from, final IQ.Type type) { IQ iqPacket = new IQ() { public String getChildElementXML() { return null; } }; iqPacket.setPacketID(ID); iqPacket.setTo(to); iqPacket.setFrom(from); iqPacket.setType(type); return iqPacket; }
IQ iq = new IQ(){ @Override public String getChildElementXML() { // TODO Auto-generated method stub return null; } }; iq.setTo(from+"/"+resource); iq.setFrom(to); iq.setType(IQ.Type.GET); iq.setPacketID("vc2"); mConnection.sendPacket(iq);
/** * A convience method to create an IQ packet. * * @param ID * The packet ID of the * @param to * To whom the packet is addressed. * @param from * From whom the packet is sent. * @param type * The iq type of the packet. * @return The created IQ packet. */ public static IQ createIQ(String ID, String to, String from, IQ.Type type) { IQ iqPacket = new IQ() { public String getChildElementXML() { return null; } }; iqPacket.setPacketID(ID); iqPacket.setTo(to); iqPacket.setFrom(from); iqPacket.setType(type); return iqPacket; }
/** * A convience method to create an IQ packet. * * @param ID * The packet ID of the * @param to * To whom the packet is addressed. * @param from * From whom the packet is sent. * @param type * The iq type of the packet. * @return The created IQ packet. */ public static IQ createIQ(String ID, String to, String from, IQ.Type type) { IQ iqPacket = new IQ() { public String getChildElementXML() { return null; } }; iqPacket.setPacketID(ID); iqPacket.setTo(to); iqPacket.setFrom(from); iqPacket.setType(type); return iqPacket; }
iq.setType(IQ.Type.RESULT); iq.setFrom(packet.getFrom()); iq.setPacketID(packet.getPacketID());
iq.setType(IQ.Type.RESULT); iq.setFrom(packet.getFrom()); iq.setPacketID(packet.getPacketID());
/** * Complete and send an error. Complete all the null fields in an IQ error * reponse, using the sesssion information we have or some info from the * incoming packet. * * @param iq * The Jingle packet we are responing to * @param jingleError * the IQ packet we want to complete and send */ public IQ createJingleError(IQ iq, JingleError jingleError) { IQ errorPacket = null; if (jingleError != null) { errorPacket = createIQ(getSid(), iq.getFrom(), iq.getTo(), IQ.Type.ERROR); List<PacketExtension> extList = new ArrayList<PacketExtension>(); extList.add(jingleError); XMPPError error = new XMPPError(XMPPError.Type.CANCEL, jingleError.toString(), "", extList); // Fill in the fields with the info from the Jingle packet errorPacket.setPacketID(iq.getPacketID()); errorPacket.setError(error); // errorPacket.addExtension(jingleError); // NO! Let the normal state machinery do all of the sending. // getConnection().sendPacket(perror); LOGGER.severe("Error sent: " + errorPacket.toXML()); } return errorPacket; }
iq.setType(IQ.Type.RESULT); iq.setFrom(packet.getFrom()); iq.setPacketID(packet.getPacketID());
/** * Complete and send an error. Complete all the null fields in an IQ error * reponse, using the sesssion information we have or some info from the * incoming packet. * * @param iq * The Jingle packet we are responing to * @param error * the IQ packet we want to complete and send */ public IQ createJingleError(IQ iq, JingleError jingleError) { IQ errorPacket = null; if (jingleError != null) { errorPacket = createIQ(getSid(), iq.getFrom(), iq.getTo(), IQ.Type.ERROR); List<PacketExtension> extList = new ArrayList<PacketExtension>(); extList.add(jingleError); XMPPError error = new XMPPError(0, XMPPError.Type.CANCEL, jingleError.toString(), "", extList); // Fill in the fields with the info from the Jingle packet errorPacket.setPacketID(iq.getPacketID()); errorPacket.setError(error); // errorPacket.addExtension(jingleError); // NO! Let the normal state machinery do all of the sending. // getConnection().sendPacket(perror); LOGGER.error("Error sent: " + errorPacket.toXML()); } return errorPacket; }
result.setPacketID(request.getPacketID()); result.setFrom(request.getTo()); result.setTo(request.getFrom());
result.setPacketID(request.getPacketID()); result.setFrom(request.getTo()); result.setTo(request.getFrom());
result.setPacketID(request.getPacketID()); result.setFrom(request.getTo()); result.setTo(request.getFrom());
result.setPacketID(request.getPacketID()); result.setFrom(request.getTo()); result.setTo(request.getFrom());
result.setPacketID(request.getPacketID()); result.setFrom(request.getTo()); result.setTo(request.getFrom());
result.setPacketID(request.getPacketID()); result.setFrom(request.getTo()); result.setTo(request.getFrom());