001/*
002 * (C) Copyright 2011 Nuxeo SA (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 *     Quentin Lamerand <qlamerand@nuxeo.com>
016 */
017
018package org.nuxeo.ecm.user.center.profile;
019
020import org.nuxeo.ecm.core.api.CoreSession;
021import org.nuxeo.ecm.core.api.DocumentModel;
022
023/**
024 * A service to manage user profiles
025 *
026 * @author <a href="mailto:qlamerand@nuxeo.com">Quentin Lamerand</a>
027 * @since 5.5
028 */
029public interface UserProfileService {
030
031    /**
032     * Get the current user profile. It's stored in its user workspace.
033     *
034     * @param the current CoreSession
035     * @return the user profile DocumentModel
036     */
037    DocumentModel getUserProfileDocument(CoreSession session);
038
039    /**
040     * Get the profile of a specific user. It's stored in its user workspace.
041     *
042     * @param the user name
043     * @param the current CoreSession
044     * @return the user profile DocumentModel
045     */
046    DocumentModel getUserProfileDocument(String userName, CoreSession session);
047
048    /**
049     * Get a DocumentModel containing both user and user profile schemas
050     *
051     * @param the user DocumentModel
052     * @param the current CoreSession
053     * @return a SimpleDocumentModel with the two schemas
054     */
055    DocumentModel getUserProfile(DocumentModel userModel, CoreSession session);
056
057    /**
058     * Clears the user profile cache.
059     */
060    void clearCache();
061
062    /**
063     * Get the user profile XMap descriptor for the importer config
064     *
065     * @return an XMap ImportConfig descriptor
066     */
067    ImporterConfig getImporterConfig();
068}