Class EventCommentDatabaseServiceImpl
java.lang.Object
org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
org.opencastproject.event.comment.persistence.EventCommentDatabaseServiceImpl
- All Implemented Interfaces:
org.opencastproject.elasticsearch.index.rebuild.IndexProducer,EventCommentDatabaseService
public class EventCommentDatabaseServiceImpl
extends org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
implements EventCommentDatabaseService
Implements permanent storage for event comments.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) OSGi component activation callbackintvoiddeleteComment(long commentId) Delete a comment from an event.voiddeleteComments(String eventId) Delete all comments from an event.getComment(long commentId) Get a comment for a particular event.getComments(String eventId) Get all of the comments for an event.Return all known event ID's with existing comments, grouped by organization IDGet the available reasons for commenting on an event.org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Servicevoidrepopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type) voidsetDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) voidsetEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DIvoidsetIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index) OSgi callback for the Elasticsearch index.voidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService) OSGi callback to set the organization directory service.voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security context to run with.voidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) OSGi callback to set the user directory service.updateComment(EventComment comment) Update a comment.Methods inherited from class org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
logIndexRebuildBegin, logIndexRebuildBegin, logIndexRebuildError, logIndexRebuildError, logIndexRebuildError, logIndexRebuildProgress, logIndexRebuildProgress, logIndexRebuildProgress, logIndexRebuildProgress, logSkippingElement, logSkippingElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
dataTypeSupported, getSupportedDataTypes
-
Field Details
-
PERSISTENCE_UNIT
- See Also:
-
-
Constructor Details
-
EventCommentDatabaseServiceImpl
public EventCommentDatabaseServiceImpl()
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) OSGi component activation callback -
setEntityManagerFactory
public void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DI -
setDBSessionFactory
public void setDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) -
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security context to run with.- Parameters:
securityService- The security service
-
setUserDirectoryService
public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) OSGi callback to set the user directory service.- Parameters:
userDirectoryService- the user directory service
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService) OSGi callback to set the organization directory service.- Parameters:
organizationDirectoryService- the organization directory service
-
setIndex
public void setIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index) OSgi callback for the Elasticsearch index.- Parameters:
index- the Elasticsearch index.
-
getReasons
Description copied from interface:EventCommentDatabaseServiceGet the available reasons for commenting on an event.- Specified by:
getReasonsin interfaceEventCommentDatabaseService- Returns:
- A list of reasons of why a comment was made.
- Throws:
EventCommentDatabaseException- Thrown if there was an issue getting the comment reasons.
-
getComment
public EventComment getComment(long commentId) throws org.opencastproject.util.NotFoundException, EventCommentDatabaseException Description copied from interface:EventCommentDatabaseServiceGet a comment for a particular event.- Specified by:
getCommentin interfaceEventCommentDatabaseService- Parameters:
commentId- The id for the comment.- Returns:
- The comment
- Throws:
org.opencastproject.util.NotFoundException- Thrown if the comment cannot be found.EventCommentDatabaseException- Thrown if there was an issue getting the comment from the database.
-
deleteComment
public void deleteComment(long commentId) throws org.opencastproject.util.NotFoundException, EventCommentDatabaseException Description copied from interface:EventCommentDatabaseServiceDelete a comment from an event.- Specified by:
deleteCommentin interfaceEventCommentDatabaseService- Parameters:
commentId- The id of the comment.- Throws:
org.opencastproject.util.NotFoundException- Thrown if cannot find the event / comment.EventCommentDatabaseException- Thrown if there is a problem deleting the comment.
-
deleteComments
public void deleteComments(String eventId) throws org.opencastproject.util.NotFoundException, EventCommentDatabaseException Description copied from interface:EventCommentDatabaseServiceDelete all comments from an event.- Specified by:
deleteCommentsin interfaceEventCommentDatabaseService- Parameters:
eventId- The id of the event.- Throws:
org.opencastproject.util.NotFoundException- Thrown if cannot find the event.EventCommentDatabaseException- Thrown if there is a problem deleting the comments.
-
updateComment
Description copied from interface:EventCommentDatabaseServiceUpdate a comment.- Specified by:
updateCommentin interfaceEventCommentDatabaseService- Parameters:
comment- The new comment status to update to.- Returns:
- The comment updated.
- Throws:
EventCommentDatabaseException- Thrown if there is a problem updating the comment.
-
getComments
Description copied from interface:EventCommentDatabaseServiceGet all of the comments for an event.- Specified by:
getCommentsin interfaceEventCommentDatabaseService- Parameters:
eventId- The id of the event to get the comments for (mediapackage id).- Returns:
- The
Listof comments. - Throws:
EventCommentDatabaseException- Thrown if there was a problem getting the comments from the database.
-
getComments
- Throws:
EventCommentDatabaseException
-
countComments
- Throws:
EventCommentDatabaseException
-
getEventsWithComments
Return all known event ID's with existing comments, grouped by organization ID- Returns:
- a list of all event ID's grouped by organization ID
-
repopulate
public void repopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type) throws org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException - Specified by:
repopulatein interfaceorg.opencastproject.elasticsearch.index.rebuild.IndexProducer- Throws:
org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
-
getService
public org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service getService()- Specified by:
getServicein interfaceorg.opencastproject.elasticsearch.index.rebuild.IndexProducer
-