Package tigase.pubsub.utils
Class DefaultPubSubLogic
java.lang.Object
tigase.pubsub.utils.DefaultPubSubLogic
- All Implemented Interfaces:
PubSubLogic
@Bean(name="logic",
parent=PubSubComponent.class,
active=true)
public class DefaultPubSubLogic
extends Object
implements PubSubLogic
Helper bean containing PubSub logic
Created by andrzej on 25.12.2016.
-
Nested Class Summary
Nested classes/interfaces inherited from interface tigase.pubsub.utils.PubSubLogic
PubSubLogic.Action -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckNodeConfig(AbstractNodeConfig nodeConfig) voidcheckPermission(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.JID senderJid, PubSubLogic.Action action) protected Stream<tigase.xmpp.jid.JID> getActiveSubscribers(ISubscriptions subscriptions, IAffiliations affiliations) protected IPubSubConfigprotected IPubSubRepositorybooleanhasSenderSubscription(tigase.xmpp.jid.BareJID bareJid, IAffiliations affiliations) booleanisMAMEnabled(tigase.xmpp.jid.BareJID serviceJid, String node) booleanisSenderInRosterGroup(tigase.xmpp.jid.BareJID bareJid, AbstractNodeConfig nodeConfig, IAffiliations affiliations, ISubscriptions subscriptions) booleanbooleanisServiceJidPEP(tigase.xmpp.jid.BareJID serivceJid) tigase.xml.ElementprepareNotificationMessage(tigase.xmpp.jid.JID from, String id, String uuid, String nodeName, tigase.xml.Element items, String expireAt, Map<String, String> headers, tigase.xmpp.StanzaType stanzaType) Stream<tigase.xmpp.jid.JID> subscribersOfNotifications(tigase.xmpp.jid.BareJID serviceJid, String nodeName) validateItemId(tigase.xmpp.jid.BareJID toJid, String nodeName, String id)
-
Constructor Details
-
DefaultPubSubLogic
public DefaultPubSubLogic()
-
-
Method Details
-
checkPermission
public void checkPermission(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.JID senderJid, PubSubLogic.Action action) throws PubSubException, tigase.component.exceptions.RepositoryException - Specified by:
checkPermissionin interfacePubSubLogic- Throws:
PubSubExceptiontigase.component.exceptions.RepositoryException
-
prepareNotificationMessage
public tigase.xml.Element prepareNotificationMessage(tigase.xmpp.jid.JID from, String id, String uuid, String nodeName, tigase.xml.Element items, String expireAt, Map<String, String> headers, tigase.xmpp.StanzaType stanzaType) - Specified by:
prepareNotificationMessagein interfacePubSubLogic
-
isServiceAutoCreated
public boolean isServiceAutoCreated()- Specified by:
isServiceAutoCreatedin interfacePubSubLogic
-
checkNodeConfig
- Specified by:
checkNodeConfigin interfacePubSubLogic- Throws:
PubSubException
-
hasSenderSubscription
public boolean hasSenderSubscription(tigase.xmpp.jid.BareJID bareJid, IAffiliations affiliations) throws tigase.component.exceptions.RepositoryException - Specified by:
hasSenderSubscriptionin interfacePubSubLogic- Throws:
tigase.component.exceptions.RepositoryException
-
isSenderInRosterGroup
public boolean isSenderInRosterGroup(tigase.xmpp.jid.BareJID bareJid, AbstractNodeConfig nodeConfig, IAffiliations affiliations, ISubscriptions subscriptions) throws tigase.component.exceptions.RepositoryException - Specified by:
isSenderInRosterGroupin interfacePubSubLogic- Throws:
tigase.component.exceptions.RepositoryException
-
getActiveSubscribers
protected Stream<tigase.xmpp.jid.JID> getActiveSubscribers(ISubscriptions subscriptions, IAffiliations affiliations) -
subscribersOfNotifications
public Stream<tigase.xmpp.jid.JID> subscribersOfNotifications(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException - Specified by:
subscribersOfNotificationsin interfacePubSubLogic- Throws:
tigase.component.exceptions.RepositoryException
-
isMAMEnabled
public boolean isMAMEnabled(tigase.xmpp.jid.BareJID serviceJid, String node) throws tigase.component.exceptions.RepositoryException - Specified by:
isMAMEnabledin interfacePubSubLogic- Throws:
tigase.component.exceptions.RepositoryException
-
getPubSubConfig
-
getRepository
-
isServiceJidPEP
public boolean isServiceJidPEP(tigase.xmpp.jid.BareJID serivceJid) - Specified by:
isServiceJidPEPin interfacePubSubLogic
-
validateItemId
- Specified by:
validateItemIdin interfacePubSubLogic
-