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:
Resource

public class Comment
extends ResourceImpl

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, dataSource, 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(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, removeAspect, removeProperty, removePropertyValue, setAuthorUserName, setContent, setContentModified, setContentStream, setContentStreamWithNoUpdate, setContentWithNoUpdate, setDataSource, 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
 

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
Method Detail

getText

public String getText()
Get the comment text.

Returns:
the text

setText

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

Parameters:
text - the text

getUser

public String getUser()
Get the commenting user.

Returns:
the comment user

setUser

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

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 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 Resource
Overrides:
getDescription in class ResourceImpl
Returns:
the description.

getCommentPath

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

Returns:
the comment path

setCommentPath

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

Parameters:
commentPath - the comment path

getAuthorUserName

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

Specified by:
getAuthorUserName in interface Resource
Overrides:
getAuthorUserName in class ResourceImpl
Returns:
the author user name

getCommentID

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

Returns:
the comment id.

setCommentID

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

Parameters:
commentID - the comment id.


Copyright © 2010. All Rights Reserved.