Class 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
    A Solr-based SearchService implementation.
    • Field Detail

      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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 Detail

      • SearchServiceImpl

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

      • activate

        public void activate​(org.osgi.service.component.ComponentContext cc)
                      throws IllegalStateException
        Service activator, called via declarative services configuration. If the solr server url is configured, we try to connect to it. If not, the solr data directory with an embedded Solr server is used.
        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)
      • 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()
      • 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