001/*
002 * (C) Copyright 2006-2015 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     dmetzler
016 */
017package org.nuxeo.ecm.user.center.notification;
018
019/**
020 * Simple bean to store subscription the way it used to
021 * be when JPA was used for persistence.
022 *
023 * @since 7.3
024 */
025public class UserSubscription {
026
027    private final String docid;
028    private final String notification;
029    private final String username;
030
031    public UserSubscription(String id, String notification, String prefixedUserName) {
032        this.docid = id;
033        this.notification = notification;
034        this.username = prefixedUserName;
035    }
036
037    public String getDocId() {
038        return docid;
039    }
040
041    public String getNotification() {
042        return notification;
043    }
044
045    /**
046     * Returns a prefixed principal id. It means it can be a group.
047     * <ul>
048     *   <li>user:myusername</li>
049     *   <li>group:mygroupname</li>
050     * </ul>
051     * @return
052     */
053    public String getUserId() {
054        return username;
055    }
056
057}