Examples of Close


Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Close

        assertEquals(IQ.Type.SET, close.getType());
    }

    @Test
    public void shouldSetAllFieldsCorrectly() {
        Close close = new Close("sessionID");
        assertEquals("sessionID", close.getSessionID());
    }
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Close

            .e("close")
                .a("xmlns", "http://jabber.org/protocol/ibb")
                .a("sid", "i781hf64")
            .asString(outputProperties);

        Close close = new Close("i781hf64");
        close.setFrom("romeo@montague.lit/orchard");
        close.setTo("juliet@capulet.lit/balcony");
        close.setPacketID("us71g45j");
       
        assertXMLEqual(control, close.toXML());
    }
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Close

    protected CloseListener(InBandBytestreamManager manager) {
        this.manager = manager;
    }

    public void processPacket(Packet packet) {
        Close closeRequest = (Close) packet;
        InBandBytestreamSession ibbSession = this.manager.getSessions().get(
                        closeRequest.getSessionID());
        if (ibbSession == null) {
            this.manager.replyItemNotFoundPacket(closeRequest);
        }
        else {
            ibbSession.closeByPeer(closeRequest);
            this.manager.getSessions().remove(closeRequest.getSessionID());
        }

    }
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Close

        if (this.inputStream.isClosed && this.outputStream.isClosed) {
            this.isClosed = true;

            // send close request
            Close close = new Close(this.byteStreamRequest.getSessionID());
            close.setTo(this.remoteJID);
            try {
                SyncPacketSend.getReply(this.connection, close);
            }
            catch (XMPPException e) {
                throw new IOException("Error while closing stream: " + e.getMessage());
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Close

        // get the CloseListener from InBandByteStreamManager
        CloseListener closeListener = Whitebox.getInternalState(byteStreamManager,
                        CloseListener.class);

        Close close = new Close("unknownSessionId");
        close.setFrom(initiatorJID);
        close.setTo(targetJID);

        closeListener.processPacket(close);

        // wait because packet is processed in an extra thread
        Thread.sleep(200);
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Close

*/
public class CloseIQProvider implements IQProvider {

    public IQ parseIQ(XmlPullParser parser) throws Exception {
        String sid = parser.getAttributeValue("", "sid");
        return new Close(sid);
    }
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Close

        if (this.inputStream.isClosed && this.outputStream.isClosed) {
            this.isClosed = true;

            // send close request
            Close close = new Close(this.byteStreamRequest.getSessionID());
            close.setTo(this.remoteJID);
            try {
                SyncPacketSend.getReply(this.connection, close);
            }
            catch (XMPPException e) {
                throw new IOException("Error while closing stream: " + e.getMessage());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.