001
014
015 package com.liferay.portal.kernel.notifications;
016
017 import java.util.HashMap;
018 import java.util.Map;
019
020
023 public class UserNotificationDefinition {
024
025 public static final int NOTIFICATION_TYPE_ADD_ENTRY = 0;
026
027 public static final int NOTIFICATION_TYPE_UPDATE_ENTRY = 1;
028
029 public UserNotificationDefinition(
030 String portletId, long classNameId, int notificationType,
031 String description) {
032
033 _portletId = portletId;
034 _classNameId = classNameId;
035 _notificationType = notificationType;
036 _description = description;
037 }
038
039 public void addUserNotificationDeliveryType(
040 UserNotificationDeliveryType userNotificationDeliveryType) {
041
042 _userNotificationDeliveryTypes.put(
043 userNotificationDeliveryType.getType(),
044 userNotificationDeliveryType);
045 }
046
047 public long getClassNameId() {
048 return _classNameId;
049 }
050
051 public String getDescription() {
052 return _description;
053 }
054
055 public int getNotificationType() {
056 return _notificationType;
057 }
058
059 public String getPortletId() {
060 return _portletId;
061 }
062
063 public UserNotificationDeliveryType getUserNotificationDeliveryType(
064 int deliveryType) {
065
066 return _userNotificationDeliveryTypes.get(deliveryType);
067 }
068
069 public Map<Integer, UserNotificationDeliveryType>
070 getUserNotificationDeliveryTypes() {
071
072 return _userNotificationDeliveryTypes;
073 }
074
075 private final long _classNameId;
076 private final String _description;
077 private final int _notificationType;
078 private final String _portletId;
079 private final Map<Integer, UserNotificationDeliveryType>
080 _userNotificationDeliveryTypes =
081 new HashMap<Integer, UserNotificationDeliveryType>();
082
083 }