org.apache.shindig.social.core.model
Class ActivityImpl

java.lang.Object
  extended by org.apache.shindig.social.core.model.ActivityImpl
All Implemented Interfaces:
Activity

public class ActivityImpl
extends Object
implements Activity

Default implementation of an Activity


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.shindig.social.opensocial.model.Activity
Activity.Field
 
Constructor Summary
ActivityImpl()
           
ActivityImpl(String id, String userId)
           
 
Method Summary
 String getAppId()
          Get a string specifying the application that this activity is associated with.
 String getBody()
          Get a string specifying an optional expanded version of an activity.
 String getBodyId()
          Get a string specifying the body template message ID in the gadget spec.
 String getExternalId()
          Get an optional string ID generated by the posting application.
 String getId()
          Get a string ID that is permanently associated with this activity.
 List<MediaItem> getMediaItems()
          Get any photos, videos, or images that should be associated with the activity.
 Long getPostedTime()
          Get the time at which this activity took place in milliseconds since the epoch.
 Float getPriority()
          Get the priority, a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source.
 String getStreamFaviconUrl()
          Get a string specifying the URL for the stream's favicon.
 String getStreamSourceUrl()
          Get a string specifying the stream's source URL.
 String getStreamTitle()
          Get a string specifing the title of the stream.
 String getStreamUrl()
          Get a string specifying the stream's URL.
 Map<String,String> getTemplateParams()
          Get a map of custom key/value pairs associated with this activity.
 String getTitle()
          Get a string specifying the primary text of an activity.
 String getTitleId()
          Get a string specifying the title template message ID in the gadget spec.
 Date getUpdated()
          Get the last updated date of the Activity, additional to the Opensocial specification for the REST-API.
 String getUrl()
          Get a string specifying the URL that represents this activity.
 String getUserId()
          Get a string ID of the user who this activity is for.
 void setAppId(String appId)
          Set a string specifying the application that this activity is associated with.
 void setBody(String body)
          Set a string specifying an optional expanded version of an activity.
 void setBodyId(String bodyId)
          Set a string specifying the body template message ID in the gadget spec.
 void setExternalId(String externalId)
          Set an optional string ID generated by the posting application.
 void setId(String id)
          Set a string ID that is permanently associated with this activity.
 void setMediaItems(List<MediaItem> mediaItems)
          Set any photos, videos, or images that should be associated with the activity.
 void setPostedTime(Long postedTime)
          Set the time at which this activity took place in milliseconds since the epoch Container support for this field is OPTIONAL.
 void setPriority(Float priority)
          Set the priority, a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source.
 void setStreamFaviconUrl(String streamFaviconUrl)
          Set a string specifying the URL for the stream's favicon.
 void setStreamSourceUrl(String streamSourceUrl)
          Set a string specifying the stream's source URL.
 void setStreamTitle(String streamTitle)
          Set a string specifing the title of the stream.
 void setStreamUrl(String streamUrl)
          Set a string specifying the stream's URL.
 void setTemplateParams(Map<String,String> templateParams)
          Set a map of custom key/value pairs associated with this activity.
 void setTitle(String title)
          Set a string specifying the primary text of an activity.
 void setTitleId(String titleId)
          Set a string specifying the title template message ID in the gadget spec.
 void setUpdated(Date updated)
          .
 void setUrl(String url)
          Set a string specifying the URL that represents this activity.
 void setUserId(String userId)
          Get a string ID of the user who this activity is for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityImpl

public ActivityImpl()

ActivityImpl

public ActivityImpl(String id,
                    String userId)
Method Detail

getAppId

public String getAppId()
Description copied from interface: Activity
Get a string specifying the application that this activity is associated with. Container support for this field is REQUIRED.

Specified by:
getAppId in interface Activity
Returns:
A string specifying the application that this activity is associated with

setAppId

public void setAppId(String appId)
Description copied from interface: Activity
Set a string specifying the application that this activity is associated with. Container support for this field is REQUIRED.

Specified by:
setAppId in interface Activity
Parameters:
appId - A string specifying the application that this activity is associated with

getBody

public String getBody()
Description copied from interface: Activity
Get a string specifying an optional expanded version of an activity. Container support for this field is OPTIONAL.

Specified by:
getBody in interface Activity
Returns:
a string specifying an optional expanded version of an activity.

setBody

public void setBody(String body)
Description copied from interface: Activity
Set a string specifying an optional expanded version of an activity. Container support for this field is OPTIONAL. Bodies may only have the following HTML tags:<b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Specified by:
setBody in interface Activity
Parameters:
body - a string specifying an optional expanded version of an activity.

getBodyId

public String getBodyId()
Description copied from interface: Activity
Get a string specifying the body template message ID in the gadget spec. Container support for this field is OPTIONAL. Bodies may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Specified by:
getBodyId in interface Activity
Returns:
a string specifying the body template message ID in the gadget spec.

setBodyId

public void setBodyId(String bodyId)
Description copied from interface: Activity
Set a string specifying the body template message ID in the gadget spec. Container support for this field is OPTIONAL.

Specified by:
setBodyId in interface Activity
Parameters:
bodyId - a string specifying the body template message ID in the gadget spec.

getExternalId

public String getExternalId()
Description copied from interface: Activity
Get an optional string ID generated by the posting application. Container support for this field is OPTIONAL.

Specified by:
getExternalId in interface Activity
Returns:
An optional string ID generated by the posting application.

setExternalId

public void setExternalId(String externalId)
Description copied from interface: Activity
Set an optional string ID generated by the posting application. Container support for this field is OPTIONAL.

Specified by:
setExternalId in interface Activity
Parameters:
externalId - An optional string ID generated by the posting application.

getId

public String getId()
Description copied from interface: Activity
Get a string ID that is permanently associated with this activity. Container support for this field is OPTIONAL.

Specified by:
getId in interface Activity
Returns:
a string ID that is permanently associated with this activity.

setId

public void setId(String id)
Description copied from interface: Activity
Set a string ID that is permanently associated with this activity. Container support for this field is OPTIONAL.

Specified by:
setId in interface Activity
Parameters:
id - a string ID that is permanently associated with this activity.

getUpdated

public Date getUpdated()
Description copied from interface: Activity
Get the last updated date of the Activity, additional to the Opensocial specification for the REST-API. Container support for this field is OPTIONAL.

Specified by:
getUpdated in interface Activity
Returns:
the last updated date

setUpdated

public void setUpdated(Date updated)
. Set the last updated date of the Activity, additional to the Opensocial specification for the REST-API. Container support for this field is OPTIONAL.

Specified by:
setUpdated in interface Activity
Parameters:
updated - the last updated date

getMediaItems

public List<MediaItem> getMediaItems()
Description copied from interface: Activity
Get any photos, videos, or images that should be associated with the activity. Container support for this field is OPTIONAL.

Specified by:
getMediaItems in interface Activity
Returns:
A List of MediaItem containing any photos, videos, or images that should be associated with the activity.

setMediaItems

public void setMediaItems(List<MediaItem> mediaItems)
Set any photos, videos, or images that should be associated with the activity. Container support for this field is OPTIONAL. Higher priority ones are higher in the list.

Specified by:
setMediaItems in interface Activity
Parameters:
mediaItems - a list of MediaItem to be associated with the activity

getPostedTime

public Long getPostedTime()
Description copied from interface: Activity
Get the time at which this activity took place in milliseconds since the epoch. Container support for this field is OPTIONAL. Higher priority ones are higher in the list.

Specified by:
getPostedTime in interface Activity
Returns:
The time at which this activity took place in milliseconds since the epoch

setPostedTime

public void setPostedTime(Long postedTime)
Set the time at which this activity took place in milliseconds since the epoch Container support for this field is OPTIONAL. This value can not be set by the end user.

Specified by:
setPostedTime in interface Activity
Parameters:
postedTime - the time at which this activity took place in milliseconds since the epoch

getPriority

public Float getPriority()
Description copied from interface: Activity
Get the priority, a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source. Container support for this field is OPTIONAL.

Specified by:
getPriority in interface Activity
Returns:
a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source

setPriority

public void setPriority(Float priority)
Set the priority, a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source. Container support for this field is OPTIONAL.

Specified by:
setPriority in interface Activity
Parameters:
priority - a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source.

getStreamFaviconUrl

public String getStreamFaviconUrl()
Description copied from interface: Activity
Get a string specifying the URL for the stream's favicon. Container support for this field is OPTIONAL.

Specified by:
getStreamFaviconUrl in interface Activity
Returns:
a string specifying the URL for the stream's favicon.

setStreamFaviconUrl

public void setStreamFaviconUrl(String streamFaviconUrl)
Set a string specifying the URL for the stream's favicon. Container support for this field is OPTIONAL.

Specified by:
setStreamFaviconUrl in interface Activity
Parameters:
streamFaviconUrl - a string specifying the URL for the stream's favicon.

getStreamSourceUrl

public String getStreamSourceUrl()
Description copied from interface: Activity
Get a string specifying the stream's source URL. Container support for this field is OPTIONAL.

Specified by:
getStreamSourceUrl in interface Activity
Returns:
a string specifying the stream's source URL.

setStreamSourceUrl

public void setStreamSourceUrl(String streamSourceUrl)
Set a string specifying the stream's source URL. Container support for this field is OPTIONAL.

Specified by:
setStreamSourceUrl in interface Activity
Parameters:
streamSourceUrl - a string specifying the stream's source URL.

getStreamTitle

public String getStreamTitle()
Description copied from interface: Activity
Get a string specifing the title of the stream. Container support for this field is OPTIONAL.

Specified by:
getStreamTitle in interface Activity
Returns:
a string specifing the title of the stream.

setStreamTitle

public void setStreamTitle(String streamTitle)
Set a string specifing the title of the stream. Container support for this field is OPTIONAL.

Specified by:
setStreamTitle in interface Activity
Parameters:
streamTitle - a string specifing the title of the stream.

getStreamUrl

public String getStreamUrl()
Description copied from interface: Activity
Get a string specifying the stream's URL. Container support for this field is OPTIONAL.

Specified by:
getStreamUrl in interface Activity
Returns:
a string specifying the stream's URL.

setStreamUrl

public void setStreamUrl(String streamUrl)
Set a string specifying the stream's URL. Container support for this field is OPTIONAL.

Specified by:
setStreamUrl in interface Activity
Parameters:
streamUrl - a string specifying the stream's URL.

getTemplateParams

public Map<String,String> getTemplateParams()
Description copied from interface: Activity
Get a map of custom key/value pairs associated with this activity. Container support for this field is OPTIONAL.

Specified by:
getTemplateParams in interface Activity
Returns:
a map of custom key/value pairs associated with this activity.

setTemplateParams

public void setTemplateParams(Map<String,String> templateParams)
Set a map of custom key/value pairs associated with this activity. The data has type Map. The object may be either a String or an Person. When passing in a person with key PersonKey, can use the following replacement variables in the template: Container support for this field is OPTIONAL.

Specified by:
setTemplateParams in interface Activity
Parameters:
templateParams - a map of custom key/value pairs associated with this activity.

getTitle

public String getTitle()
Description copied from interface: Activity
Get a string specifying the primary text of an activity. Container support for this field is REQUIRED. Titles may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Specified by:
getTitle in interface Activity
Returns:
astring specifying the primary text of an activity.

setTitle

public void setTitle(String title)
Set a string specifying the primary text of an activity. Container support for this field is REQUIRED. Titles may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Specified by:
setTitle in interface Activity
Parameters:
title - a string specifying the primary text of an activity.

getTitleId

public String getTitleId()
Description copied from interface: Activity
Get a string specifying the title template message ID in the gadget spec. Container support for this field is REQUIRED. The title is the primary text of an activity. Titles may only have the following HTML tags: <<b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Specified by:
getTitleId in interface Activity
Returns:
a string specifying the title template message ID in the gadget spec.

setTitleId

public void setTitleId(String titleId)
Set a string specifying the title template message ID in the gadget spec. Container support for this field is REQUIRED. The title is the primary text of an activity. Titles may only have the following HTML tags: <<b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Specified by:
setTitleId in interface Activity
Parameters:
titleId - a string specifying the title template message ID in the gadget spec.

getUrl

public String getUrl()
Description copied from interface: Activity
Get a string specifying the URL that represents this activity. Container support for this field is OPTIONAL.

Specified by:
getUrl in interface Activity
Returns:
a string specifying the URL that represents this activity.

setUrl

public void setUrl(String url)
Set a string specifying the URL that represents this activity. Container support for this field is OPTIONAL.

Specified by:
setUrl in interface Activity
Parameters:
url - a string specifying the URL that represents this activity.

getUserId

public String getUserId()
Description copied from interface: Activity
Get a string ID of the user who this activity is for. Container support for this field is OPTIONAL.

Specified by:
getUserId in interface Activity
Returns:
a string ID of the user who this activity is for.

setUserId

public void setUserId(String userId)
Get a string ID of the user who this activity is for. Container support for this field is OPTIONAL.

Specified by:
setUserId in interface Activity
Parameters:
userId - a string ID of the user who this activity is for.


Copyright © 2007-2012. All Rights Reserved.