001/* 002 * Copyright 2016 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.plugins.explorer.threads; 017 018import java.util.Date; 019 020import org.ametys.core.user.UserIdentity; 021import org.ametys.plugins.explorer.ExplorerNode; 022import org.ametys.plugins.repository.TraversableAmetysObject; 023 024/** 025 * Common interface for thread 026 * 027 */ 028public interface Thread extends ExplorerNode, TraversableAmetysObject 029{ 030 /** 031 * Get the title of the thread 032 * @return The thread's title 033 */ 034 public String getTitle(); 035 036 /** 037 * Get the author of the thread 038 * @return The thread's author 039 */ 040 public UserIdentity getAuthor(); 041 042 /** 043 * Get the thread's creation date. 044 * @return the thread's creation date. 045 */ 046 public Date getCreationDate(); 047 048 /** 049 * Get the number of unread post in this thread for a user 050 * @param user The user 051 * @return The number of unread post 052 */ 053 public long getUnreadPosts(UserIdentity user); 054}