Class DefaultPubSubLogic

  • All Implemented Interfaces:
    PubSubLogic

    @Bean(name="logic",
          parent=PubSubComponent.class,
          active=true)
    public class DefaultPubSubLogic
    extends java.lang.Object
    implements PubSubLogic
    Helper bean containing PubSub logic

    Created by andrzej on 25.12.2016.

    • Constructor Detail

      • DefaultPubSubLogic

        public DefaultPubSubLogic()
    • Method Detail

      • checkPermission

        public void checkPermission​(tigase.xmpp.jid.BareJID serviceJid,
                                    java.lang.String nodeName,
                                    tigase.xmpp.jid.JID senderJid,
                                    PubSubLogic.Action action)
                             throws PubSubException,
                                    tigase.component.exceptions.RepositoryException
        Specified by:
        checkPermission in interface PubSubLogic
        Throws:
        PubSubException
        tigase.component.exceptions.RepositoryException
      • prepareNotificationMessage

        public tigase.xml.Element prepareNotificationMessage​(tigase.xmpp.jid.JID from,
                                                             java.lang.String id,
                                                             java.lang.String uuid,
                                                             java.lang.String nodeName,
                                                             tigase.xml.Element items,
                                                             java.lang.String expireAt,
                                                             java.util.Map<java.lang.String,​java.lang.String> headers,
                                                             tigase.xmpp.StanzaType stanzaType)
        Specified by:
        prepareNotificationMessage in interface PubSubLogic
      • hasSenderSubscription

        public boolean hasSenderSubscription​(tigase.xmpp.jid.BareJID bareJid,
                                             IAffiliations affiliations)
                                      throws tigase.component.exceptions.RepositoryException
        Specified by:
        hasSenderSubscription in interface PubSubLogic
        Throws:
        tigase.component.exceptions.RepositoryException
      • getActiveSubscribers

        protected java.util.stream.Stream<tigase.xmpp.jid.JID> getActiveSubscribers​(ISubscriptions subscriptions,
                                                                                    IAffiliations affiliations)
      • subscribersOfNotifications

        public java.util.stream.Stream<tigase.xmpp.jid.JID> subscribersOfNotifications​(tigase.xmpp.jid.BareJID serviceJid,
                                                                                       java.lang.String nodeName)
                                                                                throws tigase.component.exceptions.RepositoryException
        Specified by:
        subscribersOfNotifications in interface PubSubLogic
        Throws:
        tigase.component.exceptions.RepositoryException
      • isMAMEnabled

        public boolean isMAMEnabled​(tigase.xmpp.jid.BareJID serviceJid,
                                    java.lang.String node)
                             throws tigase.component.exceptions.RepositoryException
        Specified by:
        isMAMEnabled in interface PubSubLogic
        Throws:
        tigase.component.exceptions.RepositoryException
      • isServiceJidPEP

        public boolean isServiceJidPEP​(tigase.xmpp.jid.BareJID serivceJid)
        Specified by:
        isServiceJidPEP in interface PubSubLogic
      • validateItemId

        public java.lang.String validateItemId​(tigase.xmpp.jid.BareJID toJid,
                                               java.lang.String nodeName,
                                               java.lang.String id)
        Specified by:
        validateItemId in interface PubSubLogic