001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.notifications;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.notifications.UserNotificationFeedEntry;
020    import com.liferay.portal.kernel.notifications.UserNotificationHandler;
021    import com.liferay.portal.model.UserNotificationEvent;
022    import com.liferay.portal.service.ServiceContext;
023    
024    /**
025     * @author Jonathan Lee
026     */
027    public class UserNotificationHandlerImpl implements UserNotificationHandler {
028    
029            public UserNotificationHandlerImpl(
030                    UserNotificationHandler userNotificationHandler) {
031    
032                    _userNotificationHandler = userNotificationHandler;
033            }
034    
035            @Override
036            public String getPortletId() {
037                    return _userNotificationHandler.getPortletId();
038            }
039    
040            @Override
041            public String getSelector() {
042                    return _userNotificationHandler.getSelector();
043            }
044    
045            @Override
046            public UserNotificationFeedEntry interpret(
047                            UserNotificationEvent userNotificationEvent,
048                            ServiceContext serviceContext)
049                    throws PortalException {
050    
051                    return _userNotificationHandler.interpret(
052                            userNotificationEvent, serviceContext);
053            }
054    
055            @Override
056            public boolean isDeliver(
057                            long userId, long classNameId, int notificationType,
058                            int deliveryType, ServiceContext serviceContext)
059                    throws PortalException, SystemException {
060    
061                    return _userNotificationHandler.isDeliver(
062                            userId, classNameId, notificationType, deliveryType,
063                            serviceContext);
064            }
065    
066            private UserNotificationHandler _userNotificationHandler;
067    
068    }