Class SearchServiceImpl

java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.search.impl.SearchServiceImpl
All Implemented Interfaces:
org.opencastproject.job.api.JobProducer, org.opencastproject.search.api.SearchService, org.opencastproject.security.api.StaticFileAuthorization

public final class SearchServiceImpl extends org.opencastproject.job.api.AbstractJobProducer implements org.opencastproject.search.api.SearchService, org.opencastproject.security.api.StaticFileAuthorization
An Opensearch-based SearchService implementation.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.opencastproject.search.api.SearchService

    org.opencastproject.search.api.SearchService.IndexEntryType
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The key to look for in the service configuration file to override the DEFAULT_ADD_JOB_LOAD
    static final float
    The load introduced on the system by creating an add job
    static final float
    The load introduced on the system by creating a delete job
    static final String
    The key to look for in the service configuration file to override the DEFAULT_DELETE_JOB_LOAD
    static final String
    The job type
    protected org.opencastproject.security.api.OrganizationDirectoryService
    The organization directory service
    protected org.opencastproject.security.api.UserDirectoryService
    The user directory service

    Fields inherited from class org.opencastproject.job.api.AbstractJobProducer

    ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobType
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of the search service.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(org.osgi.service.component.ComponentContext cc)
    Service activator, called via declarative services configuration.
    org.opencastproject.job.api.Job
    add(org.opencastproject.mediapackage.MediaPackage mediaPackage)
    void
    addSynchronously(org.opencastproject.mediapackage.MediaPackage mediaPackage)
     
    org.opencastproject.job.api.Job
    delete(String mediaPackageId)
    org.opencastproject.job.api.Job
    deleteSeries(String seriesId)
    boolean
    deleteSynchronously(String mediaPackageId)
     
    org.opencastproject.mediapackage.MediaPackage
    get(String mediaPackageId)
     
    protected org.opencastproject.security.api.OrganizationDirectoryService
     
     
    protected org.opencastproject.security.api.SecurityService
     
    Collection<org.apache.commons.lang3.tuple.Pair<org.opencastproject.security.api.Organization,org.opencastproject.mediapackage.MediaPackage>>
    getSeries(String seriesId)
     
    protected org.opencastproject.serviceregistry.api.ServiceRegistry
     
    protected org.opencastproject.security.api.UserDirectoryService
     
    void
    modified(Map<String,Object> properties)
     
    protected String
    process(org.opencastproject.job.api.Job job)
     
    org.opencastproject.search.api.SearchResultList
    search(org.elasticsearch.search.builder.SearchSourceBuilder searchSource)
     
    void
    setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory)
    Sets a reference to the organization directory service.
    void
     
    void
     
    void
    setSecurityService(org.opencastproject.security.api.SecurityService securityService)
    Callback for setting the security service.
    void
    setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
     
    void
    setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
    Callback for setting the user directory service.
    boolean
     

    Methods inherited from class org.opencastproject.job.api.AbstractJobProducer

    acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • JOB_TYPE

      public static final String JOB_TYPE
      The job type
      See Also:
    • DEFAULT_ADD_JOB_LOAD

      public static final float DEFAULT_ADD_JOB_LOAD
      The load introduced on the system by creating an add job
      See Also:
    • DEFAULT_DELETE_JOB_LOAD

      public static final float DEFAULT_DELETE_JOB_LOAD
      The load introduced on the system by creating a delete job
      See Also:
    • ADD_JOB_LOAD_KEY

      public static final String ADD_JOB_LOAD_KEY
      The key to look for in the service configuration file to override the DEFAULT_ADD_JOB_LOAD
      See Also:
    • DELETE_JOB_LOAD_KEY

      public static final String DELETE_JOB_LOAD_KEY
      The key to look for in the service configuration file to override the DEFAULT_DELETE_JOB_LOAD
      See Also:
    • userDirectoryService

      protected org.opencastproject.security.api.UserDirectoryService userDirectoryService
      The user directory service
    • organizationDirectory

      protected org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory
      The organization directory service
  • Constructor Details

    • SearchServiceImpl

      public SearchServiceImpl()
      Creates a new instance of the search service.
  • Method Details

    • activate

      public void activate(org.osgi.service.component.ComponentContext cc) throws IllegalStateException
      Service activator, called via declarative services configuration.
      Overrides:
      activate in class org.opencastproject.job.api.AbstractJobProducer
      Parameters:
      cc - the component context
      Throws:
      IllegalStateException
    • add

      public org.opencastproject.job.api.Job add(org.opencastproject.mediapackage.MediaPackage mediaPackage) throws org.opencastproject.search.api.SearchException, IllegalArgumentException
      Specified by:
      add in interface org.opencastproject.search.api.SearchService
      Throws:
      org.opencastproject.search.api.SearchException
      IllegalArgumentException
      See Also:
      • SearchService.add(org.opencastproject.mediapackage.MediaPackage)
    • addSynchronously

      public void addSynchronously(org.opencastproject.mediapackage.MediaPackage mediaPackage) throws org.opencastproject.search.api.SearchException, IllegalArgumentException, org.opencastproject.security.api.UnauthorizedException
      Specified by:
      addSynchronously in interface org.opencastproject.search.api.SearchService
      Throws:
      org.opencastproject.search.api.SearchException
      IllegalArgumentException
      org.opencastproject.security.api.UnauthorizedException
    • getSeries

      public Collection<org.apache.commons.lang3.tuple.Pair<org.opencastproject.security.api.Organization,org.opencastproject.mediapackage.MediaPackage>> getSeries(String seriesId)
      Specified by:
      getSeries in interface org.opencastproject.search.api.SearchService
    • delete

      public org.opencastproject.job.api.Job delete(String mediaPackageId) throws org.opencastproject.search.api.SearchException
      Specified by:
      delete in interface org.opencastproject.search.api.SearchService
      Throws:
      org.opencastproject.search.api.SearchException
      See Also:
      • SearchService.delete(java.lang.String)
    • deleteSynchronously

      public boolean deleteSynchronously(String mediaPackageId) throws org.opencastproject.search.api.SearchException
      Specified by:
      deleteSynchronously in interface org.opencastproject.search.api.SearchService
      Throws:
      org.opencastproject.search.api.SearchException
    • deleteSeries

      public org.opencastproject.job.api.Job deleteSeries(String seriesId) throws org.opencastproject.search.api.SearchException
      Specified by:
      deleteSeries in interface org.opencastproject.search.api.SearchService
      Throws:
      org.opencastproject.search.api.SearchException
      See Also:
      • SearchService.deleteSeries(java.lang.String)
    • get

      public org.opencastproject.mediapackage.MediaPackage get(String mediaPackageId) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException
      Specified by:
      get in interface org.opencastproject.search.api.SearchService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.security.api.UnauthorizedException
    • search

      public org.opencastproject.search.api.SearchResultList search(org.elasticsearch.search.builder.SearchSourceBuilder searchSource) throws org.opencastproject.search.api.SearchException
      Specified by:
      search in interface org.opencastproject.search.api.SearchService
      Throws:
      org.opencastproject.search.api.SearchException
    • process

      protected String process(org.opencastproject.job.api.Job job) throws Exception
      Specified by:
      process in class org.opencastproject.job.api.AbstractJobProducer
      Throws:
      Exception
      See Also:
      • AbstractJobProducer.process(org.opencastproject.job.api.Job)
    • setSearchIndex

      public void setSearchIndex(SearchServiceIndex ssi)
    • setPersistence

      public void setPersistence(SearchServiceDatabase persistence)
    • setServiceRegistry

      public void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
    • setSecurityService

      public void setSecurityService(org.opencastproject.security.api.SecurityService securityService)
      Callback for setting the security service.
      Parameters:
      securityService - the securityService to set
    • setUserDirectoryService

      public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
      Callback for setting the user directory service.
      Parameters:
      userDirectoryService - the userDirectoryService to set
    • setOrganizationDirectoryService

      public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory)
      Sets a reference to the organization directory service.
      Parameters:
      organizationDirectory - the organization directory
    • getOrganizationDirectoryService

      protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()
      Specified by:
      getOrganizationDirectoryService in class org.opencastproject.job.api.AbstractJobProducer
      See Also:
      • AbstractJobProducer.getOrganizationDirectoryService()
    • getSecurityService

      protected org.opencastproject.security.api.SecurityService getSecurityService()
      Specified by:
      getSecurityService in class org.opencastproject.job.api.AbstractJobProducer
      See Also:
      • AbstractJobProducer.getSecurityService()
    • getServiceRegistry

      protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()
      Specified by:
      getServiceRegistry in class org.opencastproject.job.api.AbstractJobProducer
      See Also:
      • AbstractJobProducer.getServiceRegistry()
    • getUserDirectoryService

      protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()
      Specified by:
      getUserDirectoryService in class org.opencastproject.job.api.AbstractJobProducer
      See Also:
      • AbstractJobProducer.getUserDirectoryService()
    • modified

      public void modified(Map<String,Object> properties)
    • getProtectedUrlPattern

      public List<Pattern> getProtectedUrlPattern()
      Specified by:
      getProtectedUrlPattern in interface org.opencastproject.security.api.StaticFileAuthorization
    • verifyUrlAccess

      public boolean verifyUrlAccess(String path)
      Specified by:
      verifyUrlAccess in interface org.opencastproject.security.api.StaticFileAuthorization