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

com.kaltura.client.services.MetadataService 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.FileHolder;
import com.kaltura.client.Files;
import com.kaltura.client.enums.MetadataObjectType;
import com.kaltura.client.types.FilterPager;
import com.kaltura.client.types.Metadata;
import com.kaltura.client.types.MetadataFilter;
import com.kaltura.client.utils.request.ListResponseRequestBuilder;
import com.kaltura.client.utils.request.NullRequestBuilder;
import com.kaltura.client.utils.request.RequestBuilder;
import com.kaltura.client.utils.request.ServeRequestBuilder;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

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

/**
 * Metadata service
 * 
 * @param metadataProfileId 
 * @param objectType 
 * @param objectId 
 * @param xmlData XML metadata
 * @param metadataProfileId 
 * @param objectType 
 * @param objectId 
 * @param url XML metadata remote url
 * @param metadataProfileId 
 * @param objectType 
 * @param objectId 
 * @param xmlFile XML metadata
 * @param metadataProfileId 
 * @param objectType 
 * @param objectId 
 * @param url XML metadata remote url
 * @param id 
 * @param id 
 * @param id 
 * @param shouldUpdate 
 * @param id 
 * @param version Enable update only if the metadata object version did not change by other
 * process
 * @param filter 
 * @param pager 
 * @param id 
 * @param id 
 * @param xmlData XML metadata
 * @param version Enable update only if the metadata object version did not change by other
 * process
 * @param id 
 * @param xmlFile XML metadata
 * @param id 
 * @param xslFile 
 */
public class MetadataService {
	
	public static class AddMetadataBuilder extends RequestBuilder {
		
		public AddMetadataBuilder(int metadataProfileId, MetadataObjectType objectType, String objectId, String xmlData) {
			super(Metadata.class, "metadata_metadata", "add");
			params.add("metadataProfileId", metadataProfileId);
			params.add("objectType", objectType);
			params.add("objectId", objectId);
			params.add("xmlData", xmlData);
		}
		
		public void metadataProfileId(String multirequestToken) {
			params.add("metadataProfileId", multirequestToken);
		}
		
		public void objectType(String multirequestToken) {
			params.add("objectType", multirequestToken);
		}
		
		public void objectId(String multirequestToken) {
			params.add("objectId", multirequestToken);
		}
		
		public void xmlData(String multirequestToken) {
			params.add("xmlData", multirequestToken);
		}
	}

	/**
	 * Allows you to add a metadata object and metadata content associated with Kaltura
	  object
	 * 
	 * @param metadataProfileId 
	 * @param objectType 
	 * @param objectId 
	 * @param xmlData XML metadata
	 */
    public static AddMetadataBuilder add(int metadataProfileId, MetadataObjectType objectType, String objectId, String xmlData)  {
		return new AddMetadataBuilder(metadataProfileId, objectType, objectId, xmlData);
	}
	
	public static class AddFromBulkMetadataBuilder extends RequestBuilder {
		
		public AddFromBulkMetadataBuilder(int metadataProfileId, MetadataObjectType objectType, String objectId, String url) {
			super(Metadata.class, "metadata_metadata", "addFromBulk");
			params.add("metadataProfileId", metadataProfileId);
			params.add("objectType", objectType);
			params.add("objectId", objectId);
			params.add("url", url);
		}
		
		public void metadataProfileId(String multirequestToken) {
			params.add("metadataProfileId", multirequestToken);
		}
		
		public void objectType(String multirequestToken) {
			params.add("objectType", multirequestToken);
		}
		
		public void objectId(String multirequestToken) {
			params.add("objectId", multirequestToken);
		}
		
		public void url(String multirequestToken) {
			params.add("url", multirequestToken);
		}
	}

	/**
	 * Allows you to add a metadata xml data from remote URL.   Enables different
	  permissions than addFromUrl action.
	 * 
	 * @param metadataProfileId 
	 * @param objectType 
	 * @param objectId 
	 * @param url XML metadata remote url
	 */
    public static AddFromBulkMetadataBuilder addFromBulk(int metadataProfileId, MetadataObjectType objectType, String objectId, String url)  {
		return new AddFromBulkMetadataBuilder(metadataProfileId, objectType, objectId, url);
	}
	
	public static class AddFromFileMetadataBuilder extends RequestBuilder {
		
		public AddFromFileMetadataBuilder(int metadataProfileId, MetadataObjectType objectType, String objectId, FileHolder xmlFile) {
			super(Metadata.class, "metadata_metadata", "addFromFile");
			params.add("metadataProfileId", metadataProfileId);
			params.add("objectType", objectType);
			params.add("objectId", objectId);
			files = new Files();
			files.add("xmlFile", xmlFile);
		}
		
		public void metadataProfileId(String multirequestToken) {
			params.add("metadataProfileId", multirequestToken);
		}
		
		public void objectType(String multirequestToken) {
			params.add("objectType", multirequestToken);
		}
		
		public void objectId(String multirequestToken) {
			params.add("objectId", multirequestToken);
		}
	}

	public static AddFromFileMetadataBuilder addFromFile(int metadataProfileId, MetadataObjectType objectType, String objectId, File xmlFile)  {
		return addFromFile(metadataProfileId, objectType, objectId, new FileHolder(xmlFile));
	}

	public static AddFromFileMetadataBuilder addFromFile(int metadataProfileId, MetadataObjectType objectType, String objectId, InputStream xmlFile, String xmlFileMimeType, String xmlFileName, long xmlFileSize)  {
		return addFromFile(metadataProfileId, objectType, objectId, new FileHolder(xmlFile, xmlFileMimeType, xmlFileName, xmlFileSize));
	}

	public static AddFromFileMetadataBuilder addFromFile(int metadataProfileId, MetadataObjectType objectType, String objectId, FileInputStream xmlFile, String xmlFileMimeType, String xmlFileName)  {
		return addFromFile(metadataProfileId, objectType, objectId, new FileHolder(xmlFile, xmlFileMimeType, xmlFileName));
	}

	/**
	 * Allows you to add a metadata object and metadata file associated with Kaltura
	  object
	 * 
	 * @param metadataProfileId 
	 * @param objectType 
	 * @param objectId 
	 * @param xmlFile XML metadata
	 */
    public static AddFromFileMetadataBuilder addFromFile(int metadataProfileId, MetadataObjectType objectType, String objectId, FileHolder xmlFile)  {
		return new AddFromFileMetadataBuilder(metadataProfileId, objectType, objectId, xmlFile);
	}
	
	public static class AddFromUrlMetadataBuilder extends RequestBuilder {
		
		public AddFromUrlMetadataBuilder(int metadataProfileId, MetadataObjectType objectType, String objectId, String url) {
			super(Metadata.class, "metadata_metadata", "addFromUrl");
			params.add("metadataProfileId", metadataProfileId);
			params.add("objectType", objectType);
			params.add("objectId", objectId);
			params.add("url", url);
		}
		
		public void metadataProfileId(String multirequestToken) {
			params.add("metadataProfileId", multirequestToken);
		}
		
		public void objectType(String multirequestToken) {
			params.add("objectType", multirequestToken);
		}
		
		public void objectId(String multirequestToken) {
			params.add("objectId", multirequestToken);
		}
		
		public void url(String multirequestToken) {
			params.add("url", multirequestToken);
		}
	}

	/**
	 * Allows you to add a metadata xml data from remote URL
	 * 
	 * @param metadataProfileId 
	 * @param objectType 
	 * @param objectId 
	 * @param url XML metadata remote url
	 */
    public static AddFromUrlMetadataBuilder addFromUrl(int metadataProfileId, MetadataObjectType objectType, String objectId, String url)  {
		return new AddFromUrlMetadataBuilder(metadataProfileId, objectType, objectId, url);
	}
	
	public static class DeleteMetadataBuilder extends NullRequestBuilder {
		
		public DeleteMetadataBuilder(int id) {
			super("metadata_metadata", "delete");
			params.add("id", id);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
	}

	/**
	 * Delete an existing metadata
	 * 
	 * @param id 
	 */
    public static DeleteMetadataBuilder delete(int id)  {
		return new DeleteMetadataBuilder(id);
	}
	
	public static class GetMetadataBuilder extends RequestBuilder {
		
		public GetMetadataBuilder(int id) {
			super(Metadata.class, "metadata_metadata", "get");
			params.add("id", id);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
	}

	/**
	 * Retrieve a metadata object by id
	 * 
	 * @param id 
	 */
    public static GetMetadataBuilder get(int id)  {
		return new GetMetadataBuilder(id);
	}
	
	public static class IndexMetadataBuilder extends RequestBuilder {
		
		public IndexMetadataBuilder(String id, boolean shouldUpdate) {
			super(Integer.class, "metadata_metadata", "index");
			params.add("id", id);
			params.add("shouldUpdate", shouldUpdate);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
		
		public void shouldUpdate(String multirequestToken) {
			params.add("shouldUpdate", multirequestToken);
		}
	}

	/**
	 * Index metadata by id, will also index the related object
	 * 
	 * @param id 
	 * @param shouldUpdate 
	 */
    public static IndexMetadataBuilder index(String id, boolean shouldUpdate)  {
		return new IndexMetadataBuilder(id, shouldUpdate);
	}
	
	public static class InvalidateMetadataBuilder extends NullRequestBuilder {
		
		public InvalidateMetadataBuilder(int id, int version) {
			super("metadata_metadata", "invalidate");
			params.add("id", id);
			params.add("version", version);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
		
		public void version(String multirequestToken) {
			params.add("version", multirequestToken);
		}
	}

	public static InvalidateMetadataBuilder invalidate(int id)  {
		return invalidate(id, Integer.MIN_VALUE);
	}

	/**
	 * Mark existing metadata as invalid   Used by batch metadata transform
	 * 
	 * @param id 
	 * @param version Enable update only if the metadata object version did not change by other
	 * process
	 */
    public static InvalidateMetadataBuilder invalidate(int id, int version)  {
		return new InvalidateMetadataBuilder(id, version);
	}
	
	public static class ListMetadataBuilder extends ListResponseRequestBuilder {
		
		public ListMetadataBuilder(MetadataFilter filter, FilterPager pager) {
			super(Metadata.class, "metadata_metadata", "list");
			params.add("filter", filter);
			params.add("pager", pager);
		}
	}

	public static ListMetadataBuilder list()  {
		return list(null);
	}

	public static ListMetadataBuilder list(MetadataFilter filter)  {
		return list(filter, null);
	}

	/**
	 * List metadata objects by filter and pager
	 * 
	 * @param filter 
	 * @param pager 
	 */
    public static ListMetadataBuilder list(MetadataFilter filter, FilterPager pager)  {
		return new ListMetadataBuilder(filter, pager);
	}
	
	public static class ServeMetadataBuilder extends ServeRequestBuilder {
		
		public ServeMetadataBuilder(int id) {
			super("metadata_metadata", "serve");
			params.add("id", id);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
	}

	/**
	 * Serves metadata XML file
	 * 
	 * @param id 
	 */
    public static ServeMetadataBuilder serve(int id)  {
		return new ServeMetadataBuilder(id);
	}
	
	public static class UpdateMetadataBuilder extends RequestBuilder {
		
		public UpdateMetadataBuilder(int id, String xmlData, int version) {
			super(Metadata.class, "metadata_metadata", "update");
			params.add("id", id);
			params.add("xmlData", xmlData);
			params.add("version", version);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
		
		public void xmlData(String multirequestToken) {
			params.add("xmlData", multirequestToken);
		}
		
		public void version(String multirequestToken) {
			params.add("version", multirequestToken);
		}
	}

	public static UpdateMetadataBuilder update(int id)  {
		return update(id, null);
	}

	public static UpdateMetadataBuilder update(int id, String xmlData)  {
		return update(id, xmlData, Integer.MIN_VALUE);
	}

	/**
	 * Update an existing metadata object with new XML content
	 * 
	 * @param id 
	 * @param xmlData XML metadata
	 * @param version Enable update only if the metadata object version did not change by other
	 * process
	 */
    public static UpdateMetadataBuilder update(int id, String xmlData, int version)  {
		return new UpdateMetadataBuilder(id, xmlData, version);
	}
	
	public static class UpdateFromFileMetadataBuilder extends RequestBuilder {
		
		public UpdateFromFileMetadataBuilder(int id, FileHolder xmlFile) {
			super(Metadata.class, "metadata_metadata", "updateFromFile");
			params.add("id", id);
			files = new Files();
			files.add("xmlFile", xmlFile);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
	}

	public static UpdateFromFileMetadataBuilder updateFromFile(int id)  {
		return updateFromFile(id, (FileHolder)null);
	}

	public static UpdateFromFileMetadataBuilder updateFromFile(int id, File xmlFile)  {
		return updateFromFile(id, new FileHolder(xmlFile));
	}

	public static UpdateFromFileMetadataBuilder updateFromFile(int id, InputStream xmlFile, String xmlFileMimeType, String xmlFileName, long xmlFileSize)  {
		return updateFromFile(id, new FileHolder(xmlFile, xmlFileMimeType, xmlFileName, xmlFileSize));
	}

	public static UpdateFromFileMetadataBuilder updateFromFile(int id, FileInputStream xmlFile, String xmlFileMimeType, String xmlFileName)  {
		return updateFromFile(id, new FileHolder(xmlFile, xmlFileMimeType, xmlFileName));
	}

	/**
	 * Update an existing metadata object with new XML file
	 * 
	 * @param id 
	 * @param xmlFile XML metadata
	 */
    public static UpdateFromFileMetadataBuilder updateFromFile(int id, FileHolder xmlFile)  {
		return new UpdateFromFileMetadataBuilder(id, xmlFile);
	}
	
	public static class UpdateFromXSLMetadataBuilder extends RequestBuilder {
		
		public UpdateFromXSLMetadataBuilder(int id, FileHolder xslFile) {
			super(Metadata.class, "metadata_metadata", "updateFromXSL");
			params.add("id", id);
			files = new Files();
			files.add("xslFile", xslFile);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
	}

	public static UpdateFromXSLMetadataBuilder updateFromXSL(int id, File xslFile)  {
		return updateFromXSL(id, new FileHolder(xslFile));
	}

	public static UpdateFromXSLMetadataBuilder updateFromXSL(int id, InputStream xslFile, String xslFileMimeType, String xslFileName, long xslFileSize)  {
		return updateFromXSL(id, new FileHolder(xslFile, xslFileMimeType, xslFileName, xslFileSize));
	}

	public static UpdateFromXSLMetadataBuilder updateFromXSL(int id, FileInputStream xslFile, String xslFileMimeType, String xslFileName)  {
		return updateFromXSL(id, new FileHolder(xslFile, xslFileMimeType, xslFileName));
	}

	/**
	 * Action transforms current metadata object XML using a provided XSL.
	 * 
	 * @param id 
	 * @param xslFile 
	 */
    public static UpdateFromXSLMetadataBuilder updateFromXSL(int id, FileHolder xslFile)  {
		return new UpdateFromXSLMetadataBuilder(id, xslFile);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy