Interface Activity


  • public interface Activity
    Representation of an activity.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Activity.Field
      The fields that represent the activity object in json form.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
    • Method Detail

      • getAppId

        String getAppId()
        Get a string specifying the application that this activity is associated with. Container support for this field is REQUIRED.
        Returns:
        A string specifying the application that this activity is associated with
      • setAppId

        void setAppId​(String appId)
        Set a string specifying the application that this activity is associated with. Container support for this field is REQUIRED.
        Parameters:
        appId - A string specifying the application that this activity is associated with
      • getBody

        String getBody()
        Get a string specifying an optional expanded version of an activity. Container support for this field is OPTIONAL.
        Returns:
        a string specifying an optional expanded version of an activity.
      • setBody

        void setBody​(String body)
        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.

        Parameters:
        body - a string specifying an optional expanded version of an activity.
      • getBodyId

        String getBodyId()
        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.

        Returns:
        a string specifying the body template message ID in the gadget spec.
      • setBodyId

        void setBodyId​(String bodyId)
        Set a string specifying the body template message ID in the gadget spec. Container support for this field is OPTIONAL.
        Parameters:
        bodyId - a string specifying the body template message ID in the gadget spec.
      • getExternalId

        String getExternalId()
        Get an optional string ID generated by the posting application. Container support for this field is OPTIONAL.
        Returns:
        An optional string ID generated by the posting application.
      • setExternalId

        void setExternalId​(String externalId)
        Set an optional string ID generated by the posting application. Container support for this field is OPTIONAL.
        Parameters:
        externalId - An optional string ID generated by the posting application.
      • getId

        String getId()
        Get a string ID that is permanently associated with this activity. Container support for this field is OPTIONAL.
        Returns:
        a string ID that is permanently associated with this activity.
      • setId

        void setId​(String id)
        Set a string ID that is permanently associated with this activity. Container support for this field is OPTIONAL.
        Parameters:
        id - a string ID that is permanently associated with this activity.
      • getUpdated

        Date getUpdated()
        Get the last updated date of the Activity, additional to the Opensocial specification for the REST-API. Container support for this field is OPTIONAL.
        Returns:
        the last updated date
      • setUpdated

        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.
        Parameters:
        updated - the last updated date
      • getMediaItems

        List<MediaItem> getMediaItems()
        Get any photos, videos, or images that should be associated with the activity.

        Container support for this field is OPTIONAL.

        Returns:
        A List of MediaItem containing any photos, videos, or images that should be associated with the activity.
      • setMediaItems

        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.

        Parameters:
        mediaItems - a list of MediaItem to be associated with the activity
      • getPostedTime

        Long getPostedTime()
        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.

        Returns:
        The time at which this activity took place in milliseconds since the epoch
      • setPostedTime

        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.

        Parameters:
        postedTime - the time at which this activity took place in milliseconds since the epoch
      • getPriority

        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. Container support for this field is OPTIONAL.
        Returns:
        a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source
      • setPriority

        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.
        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

        String getStreamFaviconUrl()
        Get a string specifying the URL for the stream's favicon. Container support for this field is OPTIONAL.
        Returns:
        a string specifying the URL for the stream's favicon.
      • setStreamFaviconUrl

        void setStreamFaviconUrl​(String streamFaviconUrl)
        Set a string specifying the URL for the stream's favicon. Container support for this field is OPTIONAL.
        Parameters:
        streamFaviconUrl - a string specifying the URL for the stream's favicon.
      • getStreamSourceUrl

        String getStreamSourceUrl()
        Get a string specifying the stream's source URL. Container support for this field is OPTIONAL.
        Returns:
        a string specifying the stream's source URL.
      • setStreamSourceUrl

        void setStreamSourceUrl​(String streamSourceUrl)
        Set a string specifying the stream's source URL. Container support for this field is OPTIONAL.
        Parameters:
        streamSourceUrl - a string specifying the stream's source URL.
      • getStreamTitle

        String getStreamTitle()
        Get a string specifing the title of the stream. Container support for this field is OPTIONAL.
        Returns:
        a string specifing the title of the stream.
      • setStreamTitle

        void setStreamTitle​(String streamTitle)
        Set a string specifing the title of the stream. Container support for this field is OPTIONAL.
        Parameters:
        streamTitle - a string specifing the title of the stream.
      • getStreamUrl

        String getStreamUrl()
        Get a string specifying the stream's URL. Container support for this field is OPTIONAL.
        Returns:
        a string specifying the stream's URL.
      • setStreamUrl

        void setStreamUrl​(String streamUrl)
        Set a string specifying the stream's URL. Container support for this field is OPTIONAL.
        Parameters:
        streamUrl - a string specifying the stream's URL.
      • getTemplateParams

        Map<String,​String> getTemplateParams()
        Get a map of custom key/value pairs associated with this activity. Container support for this field is OPTIONAL.
        Returns:
        a map of custom key/value pairs associated with this activity.
      • setTemplateParams

        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:
        • PersonKey.DisplayName - Display name for the person
        • PersonKey.ProfileUrl. URL of the person's profile
        • PersonKey.Id - The ID of the person
        • PersonKey - Container may replace with DisplayName, but may also optionally link to the user.
        Container support for this field is OPTIONAL.
        Parameters:
        templateParams - a map of custom key/value pairs associated with this activity.
      • getTitle

        String getTitle()
        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.

        Returns:
        a string specifying the primary text of an activity.
      • setTitle

        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.

        Parameters:
        title - a string specifying the primary text of an activity.
      • getTitleId

        String getTitleId()
        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.

        Returns:
        a string specifying the title template message ID in the gadget spec.
      • setTitleId

        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.

        Parameters:
        titleId - a string specifying the title template message ID in the gadget spec.
      • getUrl

        String getUrl()
        Get a string specifying the URL that represents this activity. Container support for this field is OPTIONAL.
        Returns:
        a string specifying the URL that represents this activity.
      • setUrl

        void setUrl​(String url)
        Set a string specifying the URL that represents this activity. Container support for this field is OPTIONAL.
        Parameters:
        url - a string specifying the URL that represents this activity.
      • getUserId

        String getUserId()
        Get a string ID of the user who this activity is for. Container support for this field is OPTIONAL.
        Returns:
        a string ID of the user who this activity is for.
      • setUserId

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