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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkNodeConfig
(AbstractNodeConfig nodeConfig) void
checkPermission
(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 IPubSubConfig
protected IPubSubRepository
boolean
hasSenderSubscription
(tigase.xmpp.jid.BareJID bareJid, IAffiliations affiliations) boolean
isMAMEnabled
(tigase.xmpp.jid.BareJID serviceJid, String node) boolean
isSenderInRosterGroup
(tigase.xmpp.jid.BareJID bareJid, AbstractNodeConfig nodeConfig, IAffiliations affiliations, ISubscriptions subscriptions) boolean
boolean
isServiceJidPEP
(tigase.xmpp.jid.BareJID serivceJid) 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) 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:
checkPermission
in interfacePubSubLogic
- Throws:
PubSubException
tigase.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:
prepareNotificationMessage
in interfacePubSubLogic
-
isServiceAutoCreated
public boolean isServiceAutoCreated()- Specified by:
isServiceAutoCreated
in interfacePubSubLogic
-
checkNodeConfig
- Specified by:
checkNodeConfig
in interfacePubSubLogic
- Throws:
PubSubException
-
hasSenderSubscription
public boolean hasSenderSubscription(tigase.xmpp.jid.BareJID bareJid, IAffiliations affiliations) throws tigase.component.exceptions.RepositoryException - Specified by:
hasSenderSubscription
in 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:
isSenderInRosterGroup
in 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:
subscribersOfNotifications
in interfacePubSubLogic
- Throws:
tigase.component.exceptions.RepositoryException
-
isMAMEnabled
public boolean isMAMEnabled(tigase.xmpp.jid.BareJID serviceJid, String node) throws tigase.component.exceptions.RepositoryException - Specified by:
isMAMEnabled
in interfacePubSubLogic
- Throws:
tigase.component.exceptions.RepositoryException
-
getPubSubConfig
-
getRepository
-
isServiceJidPEP
public boolean isServiceJidPEP(tigase.xmpp.jid.BareJID serivceJid) - Specified by:
isServiceJidPEP
in interfacePubSubLogic
-
validateItemId
- Specified by:
validateItemId
in interfacePubSubLogic
-