Class EventCommentDatabaseServiceImpl
java.lang.Object
org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
org.opencastproject.event.comment.persistence.EventCommentDatabaseServiceImpl
- All Implemented Interfaces:
IndexProducer,EventCommentDatabaseService
public class EventCommentDatabaseServiceImpl
extends 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.Get the service that implements IndexProducer.voidRe-add the data of this service to the index.voidsetDBSessionFactory(DBSessionFactory dbSessionFactory) voidsetEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DIvoidsetIndex(ElasticsearchIndex index) OSgi callback for the Elasticsearch index.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) OSGi callback to set the organization directory service.voidsetSecurityService(SecurityService securityService) OSGi callback to set the security context to run with.voidsetUserDirectoryService(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
-
setSecurityService
OSGi callback to set the security context to run with.- Parameters:
securityService- The security service
-
setUserDirectoryService
OSGi callback to set the user directory service.- Parameters:
userDirectoryService- the user directory service
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) OSGi callback to set the organization directory service.- Parameters:
organizationDirectoryService- the organization directory service
-
setIndex
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 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:
NotFoundException- Thrown if the comment cannot be found.EventCommentDatabaseException- Thrown if there was an issue getting the comment from the database.
-
deleteComment
Description copied from interface:EventCommentDatabaseServiceDelete a comment from an event.- Specified by:
deleteCommentin interfaceEventCommentDatabaseService- Parameters:
commentId- The id of the comment.- Throws:
NotFoundException- Thrown if cannot find the event / comment.EventCommentDatabaseException- Thrown if there is a problem deleting the comment.
-
deleteComments
Description copied from interface:EventCommentDatabaseServiceDelete all comments from an event.- Specified by:
deleteCommentsin interfaceEventCommentDatabaseService- Parameters:
eventId- The id of the event.- Throws:
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
Description copied from interface:IndexProducerRe-add the data of this service to the index.- Specified by:
repopulatein interfaceIndexProducer- Parameters:
type- Limit the data added to the index. Use ALL to re-index all data.- Throws:
IndexRebuildException
-
getService
Description copied from interface:IndexProducerGet the service that implements IndexProducer.- Specified by:
getServicein interfaceIndexProducer- Returns:
- service The service that implements IndexProducer.
-