Class AccessModel

    • Constructor Detail

      • AccessModel

        public AccessModel()
    • Method Detail

      • valueOf

        public static AccessModel valueOf​(String name)
        Returns the specific subclass of AccessModel as specified by the access model name. If an unknown name is specified then an IllegalArgumentException is going to be thrown.
        Parameters:
        name - the name of the subsclass.
        Returns:
        the specific subclass of AccessModel as specified by the access model name.
      • getName

        public abstract String getName()
        Returns the name as defined by the JEP-60 spec.
        Returns:
        the name as defined by the JEP-60 spec.
      • canSubscribe

        public abstract boolean canSubscribe​(Node node,
                                             org.xmpp.packet.JID owner,
                                             org.xmpp.packet.JID subscriber)
        Returns true if the entity is allowed to subscribe to the specified node.
        Parameters:
        node - the node that the subscriber is trying to subscribe to.
        owner - the JID of the owner of the subscription.
        subscriber - the JID of the subscriber.
        Returns:
        true if the subscriber is allowed to subscribe to the specified node.
      • canAccessItems

        public abstract boolean canAccessItems​(Node node,
                                               org.xmpp.packet.JID owner,
                                               org.xmpp.packet.JID subscriber)
        Returns true if the entity is allowed to get the node published items.
        Parameters:
        node - the node that the entity is trying to get the node's items.
        owner - the JID of the owner of the subscription.
        subscriber - the JID of the subscriber.
        Returns:
        true if the subscriber is allowed to get the node's published items.
      • getSubsriptionError

        public abstract org.xmpp.packet.PacketError.Condition getSubsriptionError()
        Returns the error condition that should be returned to the subscriber when subscription is not allowed.
        Returns:
        the error condition that should be returned to the subscriber when subscription is not allowed.
      • getSubsriptionErrorDetail

        public abstract org.dom4j.Element getSubsriptionErrorDetail()
        Returns the error element that should be returned to the subscriber as error detail when subscription is not allowed. The returned element is created each time this message is sent so it is safe to include the returned element in the parent element.
        Returns:
        the error element that should be returned to the subscriber as error detail when subscription is not allowed.
      • isAuthorizationRequired

        public abstract boolean isAuthorizationRequired()
        Returns true if the new subscription should be authorized by a node owner.
        Returns:
        true if the new subscription should be authorized by a node owner.