Package org.opencastproject.search.impl
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.StaticFileAuthorizationA Solr-basedSearchServiceimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description static StringADD_JOB_LOAD_KEYThe key to look for in the service configuration file to override theDEFAULT_ADD_JOB_LOADstatic floatDEFAULT_ADD_JOB_LOADThe load introduced on the system by creating an add jobstatic floatDEFAULT_DELETE_JOB_LOADThe load introduced on the system by creating a delete jobstatic StringDELETE_JOB_LOAD_KEYThe key to look for in the service configuration file to override theDEFAULT_DELETE_JOB_LOADstatic StringJOB_TYPEThe job typeprotected org.opencastproject.security.api.OrganizationDirectoryServiceorganizationDirectoryThe organization directory serviceprotected org.opencastproject.security.api.UserDirectoryServiceuserDirectoryServiceThe user directory service
-
Constructor Summary
Constructors Constructor Description SearchServiceImpl()Creates a new instance of the search service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.osgi.service.component.ComponentContext cc)Service activator, called via declarative services configuration.org.opencastproject.job.api.Jobadd(org.opencastproject.mediapackage.MediaPackage mediaPackage)voidaddSynchronously(org.opencastproject.mediapackage.MediaPackage mediaPackage)org.opencastproject.job.api.Jobdelete(String mediaPackageId)org.opencastproject.job.api.JobdeleteSeries(String seriesId)booleandeleteSynchronously(String mediaPackageId)org.opencastproject.mediapackage.MediaPackageget(String mediaPackageId)protected org.opencastproject.security.api.OrganizationDirectoryServicegetOrganizationDirectoryService()List<Pattern>getProtectedUrlPattern()protected org.opencastproject.security.api.SecurityServicegetSecurityService()Collection<org.apache.commons.lang3.tuple.Pair<org.opencastproject.security.api.Organization,org.opencastproject.mediapackage.MediaPackage>>getSeries(String seriesId)protected org.opencastproject.serviceregistry.api.ServiceRegistrygetServiceRegistry()protected org.opencastproject.security.api.UserDirectoryServicegetUserDirectoryService()voidmodified(Map<String,Object> properties)protected Stringprocess(org.opencastproject.job.api.Job job)org.opencastproject.search.api.SearchResultListsearch(org.elasticsearch.search.builder.SearchSourceBuilder searchSource)voidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory)Sets a reference to the organization directory service.voidsetPersistence(SearchServiceDatabase persistence)voidsetSearchIndex(SearchServiceIndex ssi)voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService)Callback for setting the security service.voidsetServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)voidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)Callback for setting the user directory service.booleanverifyUrlAccess(String path)
-
-
-
Field Detail
-
JOB_TYPE
public static final String JOB_TYPE
The job type- See Also:
- Constant Field Values
-
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
-
ADD_JOB_LOAD_KEY
public static final String ADD_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_ADD_JOB_LOAD- See Also:
- Constant Field Values
-
DELETE_JOB_LOAD_KEY
public static final String DELETE_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_DELETE_JOB_LOAD- 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
-
-
Method Detail
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) throws IllegalStateExceptionService 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:
activatein classorg.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:
addin interfaceorg.opencastproject.search.api.SearchService- Throws:
org.opencastproject.search.api.SearchExceptionIllegalArgumentException- 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:
addSynchronouslyin interfaceorg.opencastproject.search.api.SearchService- Throws:
org.opencastproject.search.api.SearchExceptionIllegalArgumentExceptionorg.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:
getSeriesin interfaceorg.opencastproject.search.api.SearchService
-
delete
public org.opencastproject.job.api.Job delete(String mediaPackageId) throws org.opencastproject.search.api.SearchException
- Specified by:
deletein interfaceorg.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:
deleteSynchronouslyin interfaceorg.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:
deleteSeriesin interfaceorg.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:
getin interfaceorg.opencastproject.search.api.SearchService- Throws:
org.opencastproject.util.NotFoundExceptionorg.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:
searchin interfaceorg.opencastproject.search.api.SearchService- Throws:
org.opencastproject.search.api.SearchException
-
process
protected String process(org.opencastproject.job.api.Job job) throws Exception
- Specified by:
processin classorg.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:
getOrganizationDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer- See Also:
AbstractJobProducer.getOrganizationDirectoryService()
-
getSecurityService
protected org.opencastproject.security.api.SecurityService getSecurityService()
- Specified by:
getSecurityServicein classorg.opencastproject.job.api.AbstractJobProducer- See Also:
AbstractJobProducer.getSecurityService()
-
getServiceRegistry
protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()
- Specified by:
getServiceRegistryin classorg.opencastproject.job.api.AbstractJobProducer- See Also:
AbstractJobProducer.getServiceRegistry()
-
getUserDirectoryService
protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()
- Specified by:
getUserDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer- See Also:
AbstractJobProducer.getUserDirectoryService()
-
getProtectedUrlPattern
public List<Pattern> getProtectedUrlPattern()
- Specified by:
getProtectedUrlPatternin interfaceorg.opencastproject.security.api.StaticFileAuthorization
-
verifyUrlAccess
public boolean verifyUrlAccess(String path)
- Specified by:
verifyUrlAccessin interfaceorg.opencastproject.security.api.StaticFileAuthorization
-
-