001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }