Examples of attributePresent()


Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

            if (stanza.getFrom() != null) return false;
        } else {
            if (!stanza.getFrom().equals(from)) return false;
        }
        if (!xmlElementVerifier.nameEquals("presence")) return false;
        if (presenceType == null && xmlElementVerifier.attributePresent("type")) return false;
        if (presenceType != null && !xmlElementVerifier.attributeEquals("type", presenceType.value())) return false;
        try {
            if (show != null && !xmlElementVerifier.subElementPresent("show")
                    && !stanza.getSingleInnerElementsNamed("show").getSingleInnerText().getText().equals(show)) {
                return false;
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

        Attribute attributeJID = itemElement.getAttribute("jid");
        if (attributeJID == null || attributeJID.getValue() == null) throw new RosterBadRequestException("missing 'jid' attribute on item node");

        XMLElementVerifier verifier = itemElement.getVerifier();
        String name = verifier.attributePresent("name") ? itemElement.getAttribute("name").getValue() : null;
        if (name != null && name.length() > RosterConfiguration.ROSTER_ITEM_NAME_MAX_LENGTH) {
            throw new RosterNotAcceptableException("roster name too long: " + name.length());
        }

        SubscriptionType subscription = verifier.attributePresent("subscription") ? SubscriptionType.valueOf(itemElement.getAttribute("subscription").getValue().toUpperCase()) : SubscriptionType.NONE;
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

        String name = verifier.attributePresent("name") ? itemElement.getAttribute("name").getValue() : null;
        if (name != null && name.length() > RosterConfiguration.ROSTER_ITEM_NAME_MAX_LENGTH) {
            throw new RosterNotAcceptableException("roster name too long: " + name.length());
        }

        SubscriptionType subscription = verifier.attributePresent("subscription") ? SubscriptionType.valueOf(itemElement.getAttribute("subscription").getValue().toUpperCase()) : SubscriptionType.NONE;
        if (!parseSubscriptionTypes && subscription != SubscriptionType.REMOVE) subscription = SubscriptionType.NONE; // roster remove is always tolerated

        AskSubscriptionType askSubscriptionType = AskSubscriptionType.NOT_SET;
        if (parseSubscriptionTypes) {
            askSubscriptionType = verifier.attributePresent("ask") ? AskSubscriptionType.valueOf("ASK_" + itemElement.getAttribute("ask").getValue().toUpperCase()) : AskSubscriptionType.NOT_SET;
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

        SubscriptionType subscription = verifier.attributePresent("subscription") ? SubscriptionType.valueOf(itemElement.getAttribute("subscription").getValue().toUpperCase()) : SubscriptionType.NONE;
        if (!parseSubscriptionTypes && subscription != SubscriptionType.REMOVE) subscription = SubscriptionType.NONE; // roster remove is always tolerated

        AskSubscriptionType askSubscriptionType = AskSubscriptionType.NOT_SET;
        if (parseSubscriptionTypes) {
            askSubscriptionType = verifier.attributePresent("ask") ? AskSubscriptionType.valueOf("ASK_" + itemElement.getAttribute("ask").getValue().toUpperCase()) : AskSubscriptionType.NOT_SET;
        }

        String contactJid = attributeJID.getValue();
        Entity contact;
        try {
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

            } else {
                responseVersion = clientVersion;
            }
        }

        if (xmlElementVerifier.attributePresent("id")) {
            // ignore silently (see RFC3920 4.4)
        }

        Stanza responseStanza = null;
        if (clientCall) {
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

        XMPPVersion versionSent = XMPPVersion.VERSION_1_0;
        Stanza response = getVersionResponse(versionSent);

        XMLElementVerifier responseVerifier = response.getVerifier();
        assertTrue(responseVerifier.attributeEquals("version", XMPPVersion.VERSION_1_0.toString()));
        assertTrue(responseVerifier.attributePresent("id"));
        assertFalse("no error", responseVerifier.subElementPresent("error"));
    }

    public void testProcessClientStreamOpeningResponse_NoVersion() {
        sessionContext.setSessionState(getDefaultState());
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

        XMPPVersion versionSent = null;
        Stanza response = getVersionResponse(versionSent);

        XMLElementVerifier responseVerifier = response.getVerifier();
        assertFalse(responseVerifier.attributePresent("version"));
        assertFalse("no error", responseVerifier.subElementPresent("error"));
    }

    public void testProcessClientStreamOpeningResponse_Version_1_1() {
        sessionContext.setSessionState(getDefaultState());
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

        protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanza, sessionStateHolder);

        recordedResponse = sessionContext.getNextRecordedResponse();
        responseVerifier = recordedResponse.getVerifier();
        if (xmlLang == null) {
            assertFalse(responseVerifier.attributePresent(NamespaceURIs.XML, "lang"));
        } else {
            assertTrue(responseVerifier.attributeEquals(NamespaceURIs.XML, "lang", xmlLang));
        }
    }
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

            } else {
                responseVersion = clientVersion;
            }
        }

        if (xmlElementVerifier.attributePresent("id")) {
            // ignore silently (see RFC3920 4.4)
        }

        Stanza responseStanza = null;
        if (clientCall) {
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.attributePresent()

            if (!stanza.getFrom().equals(from))
                return false;
        }
        if (!xmlElementVerifier.nameEquals("presence"))
            return false;
        if (presenceType == null && xmlElementVerifier.attributePresent("type"))
            return false;
        if (presenceType != null && !xmlElementVerifier.attributeEquals("type", presenceType.value()))
            return false;
        try {
            if (show != null && !xmlElementVerifier.subElementPresent("show")
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.