001    /**
002     * Copyright (c) 2000-present 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.notifications.UserNotificationFeedEntry;
019    import com.liferay.portal.kernel.notifications.UserNotificationHandler;
020    import com.liferay.portal.model.UserNotificationEvent;
021    import com.liferay.portal.service.ServiceContext;
022    
023    /**
024     * @author Jonathan Lee
025     */
026    public class UserNotificationHandlerImpl implements UserNotificationHandler {
027    
028            public UserNotificationHandlerImpl(
029                    UserNotificationHandler userNotificationHandler) {
030    
031                    _userNotificationHandler = userNotificationHandler;
032            }
033    
034            @Override
035            public String getPortletId() {
036                    return _userNotificationHandler.getPortletId();
037            }
038    
039            @Override
040            public String getSelector() {
041                    return _userNotificationHandler.getSelector();
042            }
043    
044            @Override
045            public UserNotificationFeedEntry interpret(
046                            UserNotificationEvent userNotificationEvent,
047                            ServiceContext serviceContext)
048                    throws PortalException {
049    
050                    return _userNotificationHandler.interpret(
051                            userNotificationEvent, serviceContext);
052            }
053    
054            @Override
055            public boolean isDeliver(
056                            long userId, long classNameId, int notificationType,
057                            int deliveryType, ServiceContext serviceContext)
058                    throws PortalException {
059    
060                    return _userNotificationHandler.isDeliver(
061                            userId, classNameId, notificationType, deliveryType,
062                            serviceContext);
063            }
064    
065            @Override
066            public boolean isOpenDialog() {
067                    return _userNotificationHandler.isOpenDialog();
068            }
069    
070            private final UserNotificationHandler _userNotificationHandler;
071    
072    }