Examples of StanzaReceiverQueue


Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

    public StanzaReceiverQueue addReceiver(Entity entity, String resourceId) {
        if (!(getServerRuntimeContext().getStanzaRelay() instanceof StanzaReceiverRelay)) {
            throw new RuntimeException("cannot add receiver - the stanza relay is of a different kind");
        }
        StanzaReceiverQueue relay = new StanzaReceiverQueue();
        if (resourceId != null) entity = new EntityImpl(entity.getNode(), entity.getDomain(), resourceId);
        ((StanzaReceiverRelay) getServerRuntimeContext().getStanzaRelay()).add(entity, relay);
        return relay;
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

        return createForSession(sessionContext, entity, true);
    }

    public static TestUser createForSession(TestSessionContext sessionContext, Entity entity, boolean receiveForFullJID) throws BindException {
        String boundResourceId = sessionContext.bindResource();
        StanzaReceiverQueue queue = sessionContext.addReceiver(entity, receiveForFullJID ? boundResourceId : null);
        return new TestUser(boundResourceId, entity, queue);
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

    public static TestUser createQueueReceiver(TestSessionContext parentSession, String entity) throws BindException, EntityFormatException {
        return createQueueReceiver(parentSession, EntityImpl.parse(entity));
    }

    public static TestUser createQueueReceiver(TestSessionContext parentSession, Entity entity) throws BindException {
        StanzaReceiverQueue queue = parentSession.addReceiver(entity, null);
        return new TestUser(null, entity, queue);
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

    public StanzaReceiverQueue addReceiver(Entity entity, String resourceId) {
        if (!(getServerRuntimeContext().getStanzaRelay() instanceof StanzaReceiverRelay)) {
            throw new RuntimeException("cannot add receiver - the stanza relay is of a different kind");
        }
        StanzaReceiverQueue relay = new StanzaReceiverQueue();
        if (resourceId != null)
            entity = new EntityImpl(entity.getNode(), entity.getDomain(), resourceId);
        ((StanzaReceiverRelay) getServerRuntimeContext().getStanzaRelay()).add(entity, relay);
        return relay;
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

        Entity receiver = EntityImpl.parse("to_exist@example.com");
        Entity noReceiver = EntityImpl.parse("to_unavail@example.com");

        StanzaReceiverRelay stanzaRelay = (StanzaReceiverRelay) senderSessionContext.getServerRuntimeContext()
                .getStanzaRelay();
        StanzaReceiverQueue senderQueue = new StanzaReceiverQueue();
        StanzaReceiverQueue receiverQueue = new StanzaReceiverQueue();
        stanzaRelay.add(sender, senderQueue);
        stanzaRelay.add(receiver, receiverQueue);

        Stanza successfulMessageStanza = StanzaBuilder.createMessageStanza(sender, receiver, "en", "info").build();
        ResponseStanzaContainer responseStanzaContainer = messageHandler.execute(successfulMessageStanza,
                senderSessionContext.getServerRuntimeContext(), true, senderSessionContext, null);
        assertEquals(successfulMessageStanza, receiverQueue.getNext());

        Stanza failureMessageStanza = StanzaBuilder.createMessageStanza(sender, noReceiver, "en", "info").build();
        responseStanzaContainer = messageHandler.execute(failureMessageStanza, senderSessionContext
                .getServerRuntimeContext(), true, senderSessionContext, null);
        assertNull(receiverQueue.getNext());
        Stanza rejectionStanza = senderQueue.getNext();
        assertNotNull(rejectionStanza);
        XMPPCoreStanza rejectionCoreStanza = XMPPCoreStanza.getWrapper(rejectionStanza);
        assertEquals("error", rejectionCoreStanza.getType());
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

    }

    public static TestUser createForSession(TestSessionContext sessionContext, Entity entity, boolean receiveForFullJID)
            throws BindException {
        String boundResourceId = sessionContext.bindResource();
        StanzaReceiverQueue queue = sessionContext.addReceiver(entity, receiveForFullJID ? boundResourceId : null);
        return new TestUser(boundResourceId, entity, queue);
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

            EntityFormatException {
        return createQueueReceiver(parentSession, EntityImpl.parse(entity));
    }

    public static TestUser createQueueReceiver(TestSessionContext parentSession, Entity entity) throws BindException {
        StanzaReceiverQueue queue = parentSession.addReceiver(entity, null);
        return new TestUser(null, entity, queue);
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

    public StanzaReceiverQueue addReceiver(Entity entity, String resourceId) {
        if (!(getServerRuntimeContext().getStanzaRelay() instanceof StanzaReceiverRelay)) {
            throw new RuntimeException("cannot add receiver - the stanza relay is of a different kind");
        }
        StanzaReceiverQueue relay = new StanzaReceiverQueue();
        if (resourceId != null)
            entity = new EntityImpl(entity.getNode(), entity.getDomain(), resourceId);
        ((StanzaReceiverRelay) getServerRuntimeContext().getStanzaRelay()).add(entity, relay);
        return relay;
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

    public StanzaReceiverQueue addReceiver(Entity entity, String resourceId) {
        if (!(getServerRuntimeContext().getStanzaRelay() instanceof StanzaReceiverRelay)) {
            throw new RuntimeException("cannot add receiver - the stanza relay is of a different kind");
        }
        StanzaReceiverQueue relay = new StanzaReceiverQueue();
        if (resourceId != null)
            entity = new EntityImpl(entity.getNode(), entity.getDomain(), resourceId);
        ((StanzaReceiverRelay) getServerRuntimeContext().getStanzaRelay()).add(entity, relay);
        return relay;
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.delivery.StanzaReceiverQueue

    public StanzaReceiverQueue addReceiver(Entity entity, String resourceId) {
        if (!(getServerRuntimeContext().getStanzaRelay() instanceof StanzaReceiverRelay)) {
            throw new RuntimeException("cannot add receiver - the stanza relay is of a different kind");
        }
        StanzaReceiverQueue relay = new StanzaReceiverQueue();
        if (resourceId != null)
            entity = new EntityImpl(entity.getNode(), entity.getDomain(), resourceId);
        ((StanzaReceiverRelay) getServerRuntimeContext().getStanzaRelay()).add(entity, relay);
        return relay;
    }
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.