All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kaltura.client.services.SearchService Maven / Gradle / Ivy

Go to download

KalturaClient is a library of Java classes that can be used to interact with the Kaltura REST API. More information about the REST API can be found at http://corp.kaltura.com/Products/Kaltura-API Many of the Java classes in this library are auto-generated from a schema that defines the objects that are used to interect with the API. The current schema can be found at http://www.kaltura.com/api_v3/api_schema.php

There is a newer version: 19.3.0
Show newest version
// ===================================================================================================
//                           _  __     _ _
//                          | |/ /__ _| | |_ _  _ _ _ __ _
//                          | ' .
//
// @ignore
// ===================================================================================================
package com.kaltura.client.services;

import com.kaltura.client.enums.MediaType;
import com.kaltura.client.enums.SearchProviderType;
import com.kaltura.client.types.FilterPager;
import com.kaltura.client.types.Search;
import com.kaltura.client.types.SearchAuthData;
import com.kaltura.client.types.SearchResult;
import com.kaltura.client.types.SearchResultResponse;
import com.kaltura.client.utils.request.RequestBuilder;

/**
 * This class was generated using generate.php
 * against an XML schema provided by Kaltura.
 * 
 * MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN.
 */

/**
 * Search service allows you to search for media in various media providers  This
  service is being used mostly by the CW component
 * 
 * @param searchSource 
 * @param userName 
 * @param password 
 * @param searchResult KalturaSearchResult object extends KalturaSearch and has all fields required for
 * media:add
 * @param search A KalturaSearch object contains the search keywords, media provider and media
 * type
 * @param pager 
 * @param mediaType 
 * @param url 
 */
public class SearchService {
	
	public static class ExternalLoginSearchBuilder extends RequestBuilder {
		
		public ExternalLoginSearchBuilder(SearchProviderType searchSource, String userName, String password) {
			super(SearchAuthData.class, "search", "externalLogin");
			params.add("searchSource", searchSource);
			params.add("userName", userName);
			params.add("password", password);
		}
		
		public void searchSource(String multirequestToken) {
			params.add("searchSource", multirequestToken);
		}
		
		public void userName(String multirequestToken) {
			params.add("userName", multirequestToken);
		}
		
		public void password(String multirequestToken) {
			params.add("password", multirequestToken);
		}
	}

    public static ExternalLoginSearchBuilder externalLogin(SearchProviderType searchSource, String userName, String password)  {
		return new ExternalLoginSearchBuilder(searchSource, userName, password);
	}
	
	public static class GetMediaInfoSearchBuilder extends RequestBuilder {
		
		public GetMediaInfoSearchBuilder(SearchResult searchResult) {
			super(SearchResult.class, "search", "getMediaInfo");
			params.add("searchResult", searchResult);
		}
	}

	/**
	 * Retrieve extra information about media found in search action   Some providers
	  return only part of the fields needed to create entry from, use this action to
	  get the rest of the fields.
	 * 
	 * @param searchResult KalturaSearchResult object extends KalturaSearch and has all fields required for
	 * media:add
	 */
    public static GetMediaInfoSearchBuilder getMediaInfo(SearchResult searchResult)  {
		return new GetMediaInfoSearchBuilder(searchResult);
	}
	
	public static class SearchSearchBuilder extends RequestBuilder {
		
		public SearchSearchBuilder(Search search, FilterPager pager) {
			super(SearchResultResponse.class, "search", "search");
			params.add("search", search);
			params.add("pager", pager);
		}
	}

	public static SearchSearchBuilder search(Search search)  {
		return search(search, null);
	}

	/**
	 * Search for media in one of the supported media providers
	 * 
	 * @param search A KalturaSearch object contains the search keywords, media provider and media
	 * type
	 * @param pager 
	 */
    public static SearchSearchBuilder search(Search search, FilterPager pager)  {
		return new SearchSearchBuilder(search, pager);
	}
	
	public static class SearchUrlSearchBuilder extends RequestBuilder {
		
		public SearchUrlSearchBuilder(MediaType mediaType, String url) {
			super(SearchResult.class, "search", "searchUrl");
			params.add("mediaType", mediaType);
			params.add("url", url);
		}
		
		public void mediaType(String multirequestToken) {
			params.add("mediaType", multirequestToken);
		}
		
		public void url(String multirequestToken) {
			params.add("url", multirequestToken);
		}
	}

	/**
	 * Search for media given a specific URL   Kaltura supports a searchURL action on
	  some of the media providers.   This action will return a KalturaSearchResult
	  object based on a given URL (assuming the media provider is supported)
	 * 
	 * @param mediaType 
	 * @param url 
	 */
    public static SearchUrlSearchBuilder searchUrl(MediaType mediaType, String url)  {
		return new SearchUrlSearchBuilder(mediaType, url);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy