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.kernel.comment;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.util.Function;
019    import com.liferay.portal.service.ServiceContext;
020    
021    /**
022     * @author Andr?? de Oliveira
023     */
024    public interface CommentManager {
025    
026            public void addComment(
027                            long userId, long groupId, String className, long classPK,
028                            String body, ServiceContext serviceContext)
029                    throws PortalException;
030    
031            public long addComment(
032                            long userId, long groupId, String className, long classPK,
033                            String userName, String subject, String body,
034                            Function<String, ServiceContext> serviceContextFunction)
035                    throws PortalException;
036    
037            public void addDiscussion(
038                            long userId, long groupId, String className, long classPK,
039                            String userName)
040                    throws PortalException;
041    
042            public void deleteComment(long commentId) throws PortalException;
043    
044            public void deleteDiscussion(String className, long classPK)
045                    throws PortalException;
046    
047            public int getCommentsCount(String className, long classPK);
048    
049    }