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 *     Thomas Roger <troger@nuxeo.com>
016 */
017
018package org.nuxeo.ecm.activity;
019
020import java.io.Serializable;
021import java.util.Date;
022import java.util.List;
023import java.util.Map;
024
025/**
026 * Representation of an Activity.
027 *
028 * @author <a href="mailto:troger@nuxeo.com">Thomas Roger</a>
029 * @since 5.5
030 */
031public interface Activity {
032
033    Serializable getId();
034
035    String getActor();
036
037    void setActor(String actor);
038
039    String getDisplayActor();
040
041    void setDisplayActor(String displayActor);
042
043    String getVerb();
044
045    void setVerb(String verb);
046
047    String getObject();
048
049    void setObject(String object);
050
051    String getDisplayObject();
052
053    void setDisplayObject(String displayObject);
054
055    String getTarget();
056
057    void setTarget(String target);
058
059    String getDisplayTarget();
060
061    void setDisplayTarget(String displayTarget);
062
063    /**
064     * Returns the context of this {@code Activity}.
065     *
066     * @since 5.6
067     */
068    String getContext();
069
070    /**
071     * Sets the context of this {@code Activity}.
072     *
073     * @since 5.6
074     */
075    void setContext(String context);
076
077    Date getPublishedDate();
078
079    void setPublishedDate(Date publishedDate);
080
081    /**
082     * Returns the last updated date of this {@code Activity}.
083     *
084     * @since 5.6
085     */
086    Date getLastUpdatedDate();
087
088    /**
089     * Sets the last updated date of this {@code Activity}.
090     *
091     * @since 5.6
092     */
093    void setLastUpdatedDate(Date lastUpdatedDate);
094
095    /**
096     * Returns the replies of this {@code Activity}.
097     * <p>
098     * The replies are stored as a JSON string.
099     *
100     * @since 5.6
101     */
102    String getReplies();
103
104    /**
105     * Sets the replies of this {@code Activity}.
106     *
107     * @since 5.6
108     */
109    void setReplies(String replies);
110
111    /**
112     * Returns the list of {@link ActivityReply} of this {@code Activity}.
113     *
114     * @since 5.6
115     */
116    List<ActivityReply> getActivityReplies();
117
118    /**
119     * Sets the replies of this {@code Activity}.
120     *
121     * @since 5.6
122     */
123    void setActivityReplies(List<ActivityReply> activityReplies);
124
125    Map<String, String> toMap();
126
127}