19 package org.turro.publication.util;
21 import java.util.Collection;
22 import java.util.EnumSet;
23 import java.util.HashSet;
25 import java.util.stream.Collectors;
26 import org.turro.action.queue.IElephantNotification;
27 import org.turro.action.queue.NotificationCategory;
28 import org.turro.action.queue.NotificationConstraint;
29 import org.turro.action.queue.NotificationRole;
30 import org.turro.action.queue.QueuePeriod;
31 import org.turro.annotation.ElephantNotification;
32 import org.turro.elephant.entities.db.QueueOptions;
33 import org.turro.mail.queue.NotificationCategoryMap;
34 import org.turro.mail.queue.QueueManager;
35 import org.turro.plugin.contacts.IContact;
36 import org.turro.publication.entity.PublicationCategory;
77 return qo !=
null ? qo.
getPeriod() :
null;
123 public static final String
127 if(_categories ==
null) {
130 Set<NotificationConstraint> constraints = pc.getConstraints().stream()
132 .collect(Collectors.toCollection(HashSet::new));
134 pc.getName(), pc.getDescription(),
137 constraints, pc.isPublishable());
NotificationCategory addCategory(String id, String name, String description, EnumSet< QueuePeriod > allowedPeriods, boolean unique, QueuePeriod defaultPeriod, IElephantNotification notification, NotificationRole role, Set< NotificationConstraint > constraints, boolean publishable)
void setPeriod(IContact contact, String idCategory, QueuePeriod queuePeriod, boolean override)
QueueOptions getConfiguration(IContact contact, String idCategory)
void setPeriodToAll(String idCategory, QueuePeriod period)
void removeOptions(String idCategory)
void checkConstraints(String idCategory)
static List< PublicationCategory > getPublicationCategories()
void subscribe(String idCategory, IContact contact, QueuePeriod period)
void removeAll(String idCategory)
void checkConstraints(String idCategory)
Collection< NotificationCategory > getCategories()
Collection< String > getAllCategoryIds()
static final String PUBLICATION_NOTIFICATION
NotificationCategory getCategory(String id)
void subscribeIfNot(String idCategory, IContact contact, QueuePeriod period)
Collection< NotificationCategory > getAllCategories()
void periodToAll(String idCategory, QueuePeriod period)
Collection< String > getCategoryIds()
QueuePeriod period(String idCategory, IContact contact)
static String convertId(PublicationCategory category)