public class JDBCCommentsVersionDAO extends JDBCCommentsDAO implements CommentsDAO
JDBCCommentsVersionDAO
implements JDBCCommentsDAO
to store
comments on a JDBC-based database, when versioning for comments has been enabled.ADD_COMMENT_LOCK
Constructor and Description |
---|
JDBCCommentsVersionDAO(DAOManager daoManager)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
int |
addComment(ResourceImpl resource,
String userID,
Comment comment)
Method to persist a comment.
|
void |
addComments(ResourceImpl resource,
CommentDO[] commentDOs)
Method to persist comments.
|
void |
copyComments(ResourceImpl sourceResource,
ResourceImpl targetResource)
Method to copy comments.
|
Comment[] |
getComments(ResourceImpl resource)
Method to get comments added to a given resource.
|
String[] |
getResourcePathsOfComments(Long[] commentIDs,
Connection conn)
Method to get resource paths of comments.
|
ResourceImpl |
getResourceWithMinimumData(String path)
Gets the resource with sufficient data to differentiate it from another resource.
|
void |
moveCommentPaths(ResourceIDImpl source,
ResourceIDImpl target)
Method to move comment paths.
|
void |
moveComments(ResourceIDImpl source,
ResourceIDImpl target)
Method to move comments.
|
deleteComment, getComment, removeComments, removeVersionComments, updateComment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteComment, getComment, removeComments, removeVersionComments, updateComment
public JDBCCommentsVersionDAO(DAOManager daoManager)
daoManager
- instance of the data access object manager.public int addComment(ResourceImpl resource, String userID, Comment comment) throws RegistryException
addComment
in interface CommentsDAO
addComment
in class JDBCCommentsDAO
resource
- the resourceuserID
- the id of the user who added the comment.comment
- the comment to be persisted.RegistryException
- if some error occurs while adding a commentpublic void copyComments(ResourceImpl sourceResource, ResourceImpl targetResource) throws RegistryException
copyComments
in interface CommentsDAO
copyComments
in class JDBCCommentsDAO
sourceResource
- the source resource.targetResource
- the target resource.RegistryException
- if some error occurs while copying commentspublic void addComments(ResourceImpl resource, CommentDO[] commentDOs) throws RegistryException
addComments
in interface CommentsDAO
addComments
in class JDBCCommentsDAO
resource
- the resourcecommentDOs
- the comments to be persisted.RegistryException
- if some error occurs while adding commentspublic Comment[] getComments(ResourceImpl resource) throws RegistryException
getComments
in interface CommentsDAO
getComments
in class JDBCCommentsDAO
resource
- the resource.RegistryException
- if an error occurs while getting comments.public String[] getResourcePathsOfComments(Long[] commentIDs, Connection conn) throws RegistryException
getResourcePathsOfComments
in class JDBCCommentsDAO
commentIDs
- the comment id.conn
- the connection to use.RegistryException
- if an error occurs.public ResourceImpl getResourceWithMinimumData(String path) throws RegistryException
ResourceImpl
with the path, name and path identifier
of a resource.getResourceWithMinimumData
in interface CommentsDAO
getResourceWithMinimumData
in class JDBCCommentsDAO
path
- the path of the resource.RegistryException
- if an error occurs while retrieving resource data.public void moveComments(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
moveComments
in interface CommentsDAO
moveComments
in class JDBCCommentsDAO
source
- the source resource.target
- the target resource.RegistryException
- if some error occurs while moving commentspublic void moveCommentPaths(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
moveCommentPaths
in interface CommentsDAO
moveCommentPaths
in class JDBCCommentsDAO
source
- the source resource.target
- the target resource.RegistryException
- if some error occurs while moving comment pathsCopyright © 2016 WSO2 Inc. All Rights Reserved.