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