Class Post

java.lang.Object
org.gcube.portal.databook.shared.Post
All Implemented Interfaces:
Serializable, Comparable<Post>

public class Post extends Object implements Serializable, Comparable<Post>
Author:
Massimiliano Assante, ISTI-CNR
See Also:
  • Constructor Details

    • Post

      public Post()
      Default constructor.
    • Post

      public Post(String key, PostType type, String entityId, Date time, String vreid, String uri, String uriThumbnail, String description, PrivacyLevel privacy, String fullName, String email, String thumbnailURL, String linkTitle, String linkDescription, String linkHost)
      Constructor for user feeds.
      Parameters:
      key - The unique identifier of the post (e.g., a UUID).
      type - The type of the post, instance of PostType.
      entityId - The unique identifier of the user or application.
      time - The timestamp when the post was created.
      vreid - The unique identifier of the VRE (Virtual Research Environment).
      uri - An optional URI associated with the post.
      uriThumbnail - The thumbnail for the linked URI.
      description - An optional description or content of the post.
      privacy - The privacy level, instance of PrivacyLevel.
      fullName - The full name of the entity (user/application) that created the post.
      email - The email of the entity that created the post.
      thumbnailURL - The URL of the thumbnail image for the entity (user/application).
      linkTitle - An optional title for a shared link.
      linkDescription - An optional description for a shared link.
      linkHost - An optional host for a shared link.
    • Post

      public Post(String key, PostType type, String entityId, Date time, String vreid, String uri, String uriThumbnail, String description, PrivacyLevel privacy, String fullName, String email, String thumbnailURL, String linkTitle, String linkDescription, String linkHost, boolean applicationFeed)
      Constructor for user and application profile feeds.
      Parameters:
      key - The unique identifier of the post (e.g., a UUID).
      type - The type of the post, instance of PostType.
      entityId - The unique identifier of the user or application.
      time - The timestamp when the post was created.
      vreid - The unique identifier of the VRE (Virtual Research Environment).
      uri - An optional URI associated with the post.
      uriThumbnail - The thumbnail for the linked URI.
      description - An optional description or content of the post.
      privacy - The privacy level, instance of PrivacyLevel.
      fullName - The full name of the entity (user/application) that created the post.
      email - The email of the entity that created the post.
      thumbnailURL - The URL of the thumbnail image for the entity (user/application).
      linkTitle - An optional title for a shared link.
      linkDescription - An optional description for a shared link.
      linkHost - An optional host for a shared link.
      applicationFeed - A boolean indicating if this is an application feed (true) or a user feed (false).
    • Post

      public Post(String key, PostType type, String entityId, Date time, String vreid, String uri, String uriThumbnail, String description, PrivacyLevel privacy, String fullName, String email, String thumbnailURL, String commentsNo, String likesNo, String linkTitle, String linkDescription, String linkHost, boolean applicationFeed, boolean multiFileUpload)
      Constructor for serialization purposes, including all fields.
      Parameters:
      key - The unique identifier of the post (e.g., a UUID).
      type - The type of the post, instance of PostType.
      entityId - The unique identifier of the user or application.
      time - The timestamp when the post was created.
      vreid - The unique identifier of the VRE (Virtual Research Environment).
      uri - An optional URI associated with the post.
      uriThumbnail - The thumbnail for the linked URI.
      description - An optional description or content of the post.
      privacy - The privacy level, instance of PrivacyLevel.
      fullName - The full name of the entity (user/application) that created the post.
      email - The email of the entity that created the post.
      thumbnailURL - The URL of the thumbnail image for the entity (user/application).
      commentsNo - The number of comments on the post.
      likesNo - The number of likes on the post.
      linkTitle - An optional title for a shared link.
      linkDescription - An optional description for a shared link.
      linkHost - An optional host for a shared link.
      applicationFeed - A boolean indicating if this is an application feed (true) or a user feed (false).
      multiFileUpload - A boolean indicating if the post has multiple file uploads.
  • Method Details

    • getKey

      public String getKey()
      Gets the unique identifier of the post.
      Returns:
      The post key (UUID).
    • setKey

      public void setKey(String key)
    • getType

      public PostType getType()
      Gets the type of the post.
      Returns:
      The post type.
    • setType

      public void setType(PostType type)
    • getEntityId

      public String getEntityId()
      Gets the unique identifier of the user or application that created the post.
      Returns:
      The entity identifier (user or application ID).
    • setEntityId

      public void setEntityId(String entityId)
      Sets the unique identifier of the user or application that created the post.
      Parameters:
      entityId - The entity identifier (user or application ID).
    • getTime

      public Date getTime()
      Gets the creation timestamp of the post.
      Returns:
      The creation time.
    • setTime

      public void setTime(Date time)
    • getVreid

      public String getVreid()
      Gets the unique identifier of the VRE associated with this post.
      Returns:
      The VRE ID.
    • setVreid

      public void setVreid(String vreid)
    • getUri

      public String getUri()
      Gets the optional URI associated with the post.
      Returns:
      The URI.
    • setUri

      public void setUri(String uri)
    • getDescription

      public String getDescription()
      Gets the description or content of the post.
      Returns:
      The post description.
    • setDescription

      public void setDescription(String description)
    • getPrivacy

      public PrivacyLevel getPrivacy()
      Gets the privacy level of the post.
      Returns:
      The privacy level.
    • setPrivacy

      public void setPrivacy(PrivacyLevel privacy)
    • getFullName

      public String getFullName()
      Gets the full name of the entity (user/application) that created the post.
      Returns:
      The full name.
    • setFullName

      public void setFullName(String fullName)
    • getEmail

      public String getEmail()
      Gets the email of the entity that created the post.
      Returns:
      The email address.
    • setEmail

      public void setEmail(String email)
    • getThumbnailURL

      public String getThumbnailURL()
      Gets the URL of the thumbnail image for the entity (user/application).
      Returns:
      The thumbnail URL.
    • setThumbnailURL

      public void setThumbnailURL(String thumbnailURL)
    • getCommentsNo

      public String getCommentsNo()
      Gets the number of comments on the post.
      Returns:
      The number of comments as a String.
    • setCommentsNo

      public void setCommentsNo(String commentsNo)
    • getLikesNo

      public String getLikesNo()
      Gets the number of likes on the post.
      Returns:
      The number of likes as a String.
    • setLikesNo

      public void setLikesNo(String likesNo)
    • getUriThumbnail

      public String getUriThumbnail()
      Gets the thumbnail URI for a shared link.
      Returns:
      The URI of the link thumbnail.
    • setUriThumbnail

      public void setUriThumbnail(String uriThumbnail)
    • getLinkTitle

      public String getLinkTitle()
      Gets the title of a shared link.
      Returns:
      The link title.
    • setLinkTitle

      public void setLinkTitle(String linkTitle)
    • getLinkDescription

      public String getLinkDescription()
      Gets the description of a shared link.
      Returns:
      The link description.
    • setLinkDescription

      public void setLinkDescription(String linkDescription)
    • compareTo

      public int compareTo(Post toCompare)
      Compares this post with another post based on their creation time.
      Specified by:
      compareTo in interface Comparable<Post>
      Parameters:
      toCompare - The post to be compared.
      Returns:
      1 if this post's time is after the other post's time, -1 if this post's time is before the other post's time, 0 if they have the same time.
    • getLinkHost

      public String getLinkHost()
      Gets the host of a shared link.
      Returns:
      The link host.
    • setLinkHost

      public void setLinkHost(String linkHost)
    • isApplicationFeed

      public boolean isApplicationFeed()
      Checks if this post is an application feed.
      Returns:
      True if it is an application feed, false otherwise.
    • setApplicationFeed

      public void setApplicationFeed(boolean applicationFeed)
    • isMultiFileUpload

      public boolean isMultiFileUpload()
      Checks if this post has multiple file uploads.
      Returns:
      True if it has multiple file uploads, false otherwise.
    • setMultiFileUpload

      public void setMultiFileUpload(boolean multiFileUpload)
    • toString

      public String toString()
      Overrides:
      toString in class Object