org.wso2.carbon.registry.core
Class Comment

java.lang.Object
  extended by org.wso2.carbon.registry.core.ResourceImpl
      extended by org.wso2.carbon.registry.core.Comment
All Implemented Interfaces:
org.wso2.carbon.registry.api.Comment, org.wso2.carbon.registry.api.Resource

public class Comment
extends ResourceImpl
implements org.wso2.carbon.registry.api.Comment

Represents comments and its meta data. Note that only the Comment.text field needs to be filled when adding new comments. All other attributes are ignored and they are filled with appropriate values for the current context. Therefore, when constructing an instance of this class outside the Registry impl, it is recommended to use new Comment("my comment text") constructor.


Field Summary
 
Fields inherited from class org.wso2.carbon.registry.core.ResourceImpl
authorUserName, content, contentModified, createdTime, dataAccessManager, dbBasedContentID, description, directory, id, lastModified, lastUpdaterUserName, matchingSnapshotID, mediaType, name, parentPath, path, pathID, permanentPath, properties, propertiesModified, resourceDAO, snapshotID, state, tenantId, userName, userRealm, versionableChange, versionNumber
 
Constructor Summary
Comment()
          Default constructor to create an empty comment.
Comment(Comment comment)
          A copy constructor used to create a shallow-copy of this comment.
Comment(String commentText)
          Construct a comment with a text.
 
Method Summary
 String getAuthorUserName()
          Method to get the author user name.
 long getCommentID()
          Method to get the comment id.
 String getCommentPath()
          Method to get the comment path.
 Object getContent()
          Get the comment text.
 String getDescription()
          Get the description.
 String getResourcePath()
          Get the path of the resource of the comment.
 String getText()
          Get the comment text.
 Date getTime()
          Deprecated. please use ResourceImpl.getCreatedTime() instead
 String getUser()
          Get the commenting user.
 void setCommentID(long commentID)
          Method to set the comment id.
 void setCommentPath(String commentPath)
          Method to set the comment path.
 void setCreatedTime(Date createdTime)
          Method to set the created time.
 void setResourcePath(String resourcePath)
          Set the path of the resource of the comment.
 void setText(String text)
          Set the comment text.
 void setTime(Date time)
          Deprecated. please use setCreatedTime(java.util.Date) instead
 void setUser(String user)
          Set the commenting user.
 
Methods inherited from class org.wso2.carbon.registry.core.ResourceImpl
addAspect, addProperty, addPropertyWithNoUpdate, clearSessionInformation, discard, editPropertyValue, fillResourceCopy, getAspects, getContentStream, getCreatedTime, getDbBasedContentID, getId, getLastModified, getLastUpdaterUserName, getMatchingSnapshotID, getMediaType, getName, getParentPath, getPath, getPathID, getPermanentPath, getProperties, getProperty, getPropertyValues, getResourceDO, getResourceIDImpl, getShallowCopy, getSnapshotID, getState, getVersionNumber, isContentModified, isPropertiesModified, isVersionableChange, prepareContentForPut, pullContentFromOriginal, removeAspect, removeProperty, removePropertyValue, removePropertyWithNoUpdate, setAuthorUserName, setContent, setContentModified, setContentStream, setContentStreamWithNoUpdate, setContentWithNoUpdate, setDataAccessManager, setDbBasedContentID, setDescription, setId, setLastModified, setLastUpdaterUserName, setMatchingSnapshotID, setMediaType, setName, setParentPath, setPath, setPathID, setProperties, setPropertiesModified, setPropertiesModifiedWithNoUpdate, setProperty, setProperty, setSessionInformation, setSnapshotID, setState, setTenantId, setUserName, setUserRealm, setVersionableChange, setVersionNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.wso2.carbon.registry.api.Resource
addAspect, addProperty, discard, editPropertyValue, getAspects, getContentStream, getCreatedTime, getId, getLastModified, getLastUpdaterUserName, getMediaType, getParentPath, getPath, getPermanentPath, getProperties, getProperty, getPropertyValues, getState, removeAspect, removeProperty, removePropertyValue, setContent, setContentStream, setDescription, setMediaType, setProperties, setProperty, setProperty
 

Constructor Detail

Comment

public Comment()
Default constructor to create an empty comment.


Comment

public Comment(String commentText)
Construct a comment with a text.

Parameters:
commentText - the comment text

Comment

public Comment(Comment comment)
A copy constructor used to create a shallow-copy of this comment.

Parameters:
comment - the comment of which the copy is created.
Method Detail

getText

public String getText()
Get the comment text.

Specified by:
getText in interface org.wso2.carbon.registry.api.Comment
Returns:
the text

setText

public void setText(String text)
Set the comment text.

Specified by:
setText in interface org.wso2.carbon.registry.api.Comment
Parameters:
text - the text

getUser

public String getUser()
Get the commenting user.

Specified by:
getUser in interface org.wso2.carbon.registry.api.Comment
Returns:
the comment user

setUser

public void setUser(String user)
Set the commenting user.

Specified by:
setUser in interface org.wso2.carbon.registry.api.Comment
Parameters:
user - the commenting user

getTime

@Deprecated
public Date getTime()
Deprecated. please use ResourceImpl.getCreatedTime() instead

Get the comment time.

Returns:
the time the comment was made.

setTime

@Deprecated
public void setTime(Date time)
Deprecated. please use setCreatedTime(java.util.Date) instead

Set the comment time

Parameters:
time - the time

setCreatedTime

public void setCreatedTime(Date createdTime)
Method to set the created time.

Overrides:
setCreatedTime in class ResourceImpl
Parameters:
createdTime - the created time.

getResourcePath

public String getResourcePath()
Get the path of the resource of the comment.

Returns:
the resource path.

setResourcePath

public void setResourcePath(String resourcePath)
Set the path of the resource of the comment.

Parameters:
resourcePath - the resource path.

getContent

public Object getContent()
                  throws RegistryException
Get the comment text.

Specified by:
getContent in interface org.wso2.carbon.registry.api.Resource
Overrides:
getContent in class ResourceImpl
Returns:
the comment text
Throws:
RegistryException - throws if the operation fail.

getDescription

public String getDescription()
Get the description.

Specified by:
getDescription in interface org.wso2.carbon.registry.api.Resource
Overrides:
getDescription in class ResourceImpl
Returns:
the description.

getCommentPath

public String getCommentPath()
Method to get the comment path.

Specified by:
getCommentPath in interface org.wso2.carbon.registry.api.Comment
Returns:
the comment path

setCommentPath

public void setCommentPath(String commentPath)
Method to set the comment path.

Specified by:
setCommentPath in interface org.wso2.carbon.registry.api.Comment
Parameters:
commentPath - the comment path

getAuthorUserName

public String getAuthorUserName()
Method to get the author user name.

Specified by:
getAuthorUserName in interface org.wso2.carbon.registry.api.Resource
Overrides:
getAuthorUserName in class ResourceImpl
Returns:
the author user name

getCommentID

public long getCommentID()
Method to get the comment id.

Specified by:
getCommentID in interface org.wso2.carbon.registry.api.Comment
Returns:
the comment id.

setCommentID

public void setCommentID(long commentID)
Method to set the comment id.

Specified by:
setCommentID in interface org.wso2.carbon.registry.api.Comment
Parameters:
commentID - the comment id.


Copyright © 2012 WSO2 Inc. All Rights Reserved.