Package rocks.xmpp.core.stanza.model.errors

Examples of rocks.xmpp.core.stanza.model.errors.ServiceUnavailable


    public void marshalIQWithError() throws JAXBException, XMLStreamException {
        IQ iq = new IQ(IQ.Type.GET);
        iq.setId("id");
        iq.setTo(new Jid("to", "domain"));
        iq.setFrom(new Jid("from", "domain"));
        iq.setError(new StanzaError(StanzaError.Type.MODIFY, new ServiceUnavailable()));
        String xml = marshal(iq);
        Assert.assertEquals(xml, "<iq from=\"from@domain\" id=\"id\" to=\"to@domain\" type=\"get\"><error type=\"modify\"><service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"></service-unavailable></error></iq>");
    }
View Full Code Here


                    logger.log(Level.WARNING, e.getMessage(), e);
                }
            }
            if (incoming && (iq.getType() == IQ.Type.GET || iq.getType() == IQ.Type.SET) && !iqEvent.isConsumed()) {
                // return <service-unavailble/> if the <iq/> is not understood or has not been handles by an event listener.
                IQ error = iq.createError(new StanzaError(new ServiceUnavailable()));
                send(error);
            }
        }
    }
View Full Code Here

                                // Gracefully send an empty result.
                                xmppSession.send(iq.createResult());
                                updateRoster(roster, true);
                            } else {
                                // If the client receives a roster push from an unauthorized entity, it MUST NOT process the pushed data; in addition, the client can either return a stanza error of <service-unavailable/> error
                                xmppSession.send(iq.createError(new StanzaError(new ServiceUnavailable())));
                            }
                        } else if (iq.getType() == IQ.Type.RESULT) {
                            updateRoster(roster, false);
                        }
                        e.consume();
View Full Code Here

TOP

Related Classes of rocks.xmpp.core.stanza.model.errors.ServiceUnavailable

Copyright © 2018 www.massapicom. 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.