Package org.apache.vysper.xmpp.modules.extension.xep0060_pubsub

Examples of org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.PubSubAffiliation


    /**
     * Returns the affiliation of the entity to the node. Only the bare JID will be compared.
     */
    public PubSubAffiliation getAffiliation(String nodeName, Entity entity) {
        PubSubAffiliation psa = this.nodeAffiliations.get(nodeName)
                                                     .get(entity.getBareJID());
        return psa != null ? psa : PubSubAffiliation.NONE; // NONE if there is no affiliation known.
    }
View Full Code Here


     * Call the visitor with the each member JID and its associated affiliation.
     */
    public void acceptForEachMemberAffiliation(String name, MemberAffiliationVisitor mav) {
        Map<Entity, PubSubAffiliation> affils = this.nodeAffiliations.get(name);
        for(Entity jid : affils.keySet()) {
            PubSubAffiliation affil = affils.get(jid);
            mav.visit(jid, affil);
        }
    }
View Full Code Here

    /**
     * Returns the affiliation of the entity to the node. Only the bare JID will be compared.
     */
    public PubSubAffiliation getAffiliation(String nodeName, Entity entity) {
        PubSubAffiliation psa = this.nodeAffiliations.get(nodeName).get(entity.getBareJID());
        return psa != null ? psa : PubSubAffiliation.NONE; // NONE if there is no affiliation known.
    }
View Full Code Here

     * Call the visitor with the each member JID and its associated affiliation.
     */
    public void acceptForEachMemberAffiliation(String name, MemberAffiliationVisitor mav) {
        Map<Entity, PubSubAffiliation> affils = this.nodeAffiliations.get(name);
        for (Entity jid : affils.keySet()) {
            PubSubAffiliation affil = affils.get(jid);
            mav.visit(jid, affil);
        }
    }
View Full Code Here

                userJID = EntityImpl.parse(affiliationElement.getAttributeValue("jid"));
            } catch (EntityFormatException e) {
                return errorStanzaGenerator.generateJIDMalformedErrorStanza(serverJID, sender, stanza); // TODO not defined in the standard(?)
            }

            PubSubAffiliation newAffiliation = PubSubAffiliation.get(affiliationElement
                    .getAttributeValue("affiliation"));
            node.setAffiliation(userJID, newAffiliation);
        } catch (LastOwnerResignedException e) {
            // if the last owner tries to resign.
            return errorStanzaGenerator.generateNotAcceptableErrorStanza(serverJID, sender, stanza);
View Full Code Here

                userJID = EntityImpl.parse(affiliationElement.getAttributeValue("jid"));
            } catch (EntityFormatException e) {
                return errorStanzaGenerator.generateJIDMalformedErrorStanza(serverJID, sender, stanza); // TODO not defined in the standard(?)
            }

            PubSubAffiliation newAffiliation = PubSubAffiliation.get(affiliationElement
                    .getAttributeValue("affiliation"));
            node.setAffiliation(userJID, newAffiliation);
        } catch (LastOwnerResignedException e) {
            // if the last owner tries to resign.
            return errorStanzaGenerator.generateNotAcceptableErrorStanza(serverJID, sender, stanza);
View Full Code Here

     * @param sender
     * @param requestedAffiliation
     * @return
     */
    public boolean isAuthorized(Entity sender, PubSubAffiliation requestedAffiliation) {
        PubSubAffiliation affiliation = this.storage.getAffiliation(name, sender);
        return affiliation.compareTo(requestedAffiliation) >= 0;
    }
View Full Code Here

     * @param sender
     * @param requestedAffiliation
     * @return
     */
    public boolean isAuthorized(Entity sender, PubSubAffiliation requestedAffiliation) {
        PubSubAffiliation affiliation = this.storage.getAffiliation(name, sender);
        return affiliation.compareTo(requestedAffiliation) >= 0;
    }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.PubSubAffiliation

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.