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

com.kaltura.client.services.AppTokenService 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.SessionType;
import com.kaltura.client.types.AppToken;
import com.kaltura.client.types.AppTokenFilter;
import com.kaltura.client.types.FilterPager;
import com.kaltura.client.types.SessionInfo;
import com.kaltura.client.utils.request.ListResponseRequestBuilder;
import com.kaltura.client.utils.request.NullRequestBuilder;
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.
 */

/**
 * Manage application authentication tokens
 * 
 * @param appToken 
 * @param id 
 * @param id 
 * @param filter 
 * @param pager 
 * @param id application token ID
 * @param tokenHash a hash [MD5, SHA1, SHA256 and SHA512 are supported] of the current KS
 * concatenated with the application token
 * @param userId session user ID, will be ignored if a different user ID already defined on the
 * application token
 * @param type session type, will be ignored if a different session type is already defined on
 * the application token
 * @param expiry session expiry (in seconds), could be overridden by shorter expiry of the
 * application token
 * @param sessionPrivileges session privileges, will be ignored if a similar privilege is already defined on
 * the application token or the privilege is server reserved
 * @param id 
 * @param appToken 
 */
public class AppTokenService {
	
	public static class AddAppTokenBuilder extends RequestBuilder {
		
		public AddAppTokenBuilder(AppToken appToken) {
			super(AppToken.class, "apptoken", "add");
			params.add("appToken", appToken);
		}
	}

	/**
	 * Add new application authentication token
	 * 
	 * @param appToken 
	 */
    public static AddAppTokenBuilder add(AppToken appToken)  {
		return new AddAppTokenBuilder(appToken);
	}
	
	public static class DeleteAppTokenBuilder extends NullRequestBuilder {
		
		public DeleteAppTokenBuilder(String id) {
			super("apptoken", "delete");
			params.add("id", id);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
	}

	/**
	 * Delete application authentication token by ID
	 * 
	 * @param id 
	 */
    public static DeleteAppTokenBuilder delete(String id)  {
		return new DeleteAppTokenBuilder(id);
	}
	
	public static class GetAppTokenBuilder extends RequestBuilder {
		
		public GetAppTokenBuilder(String id) {
			super(AppToken.class, "apptoken", "get");
			params.add("id", id);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
	}

	/**
	 * Get application authentication token by ID
	 * 
	 * @param id 
	 */
    public static GetAppTokenBuilder get(String id)  {
		return new GetAppTokenBuilder(id);
	}
	
	public static class ListAppTokenBuilder extends ListResponseRequestBuilder {
		
		public ListAppTokenBuilder(AppTokenFilter filter, FilterPager pager) {
			super(AppToken.class, "apptoken", "list");
			params.add("filter", filter);
			params.add("pager", pager);
		}
	}

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

	public static ListAppTokenBuilder list(AppTokenFilter filter)  {
		return list(filter, null);
	}

	/**
	 * List application authentication tokens by filter and pager
	 * 
	 * @param filter 
	 * @param pager 
	 */
    public static ListAppTokenBuilder list(AppTokenFilter filter, FilterPager pager)  {
		return new ListAppTokenBuilder(filter, pager);
	}
	
	public static class StartSessionAppTokenBuilder extends RequestBuilder {
		
		public StartSessionAppTokenBuilder(String id, String tokenHash, String userId, SessionType type, int expiry, String sessionPrivileges) {
			super(SessionInfo.class, "apptoken", "startSession");
			params.add("id", id);
			params.add("tokenHash", tokenHash);
			params.add("userId", userId);
			params.add("type", type);
			params.add("expiry", expiry);
			params.add("sessionPrivileges", sessionPrivileges);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
		
		public void tokenHash(String multirequestToken) {
			params.add("tokenHash", multirequestToken);
		}
		
		public void userId(String multirequestToken) {
			params.add("userId", multirequestToken);
		}
		
		public void type(String multirequestToken) {
			params.add("type", multirequestToken);
		}
		
		public void expiry(String multirequestToken) {
			params.add("expiry", multirequestToken);
		}
		
		public void sessionPrivileges(String multirequestToken) {
			params.add("sessionPrivileges", multirequestToken);
		}
	}

	public static StartSessionAppTokenBuilder startSession(String id, String tokenHash)  {
		return startSession(id, tokenHash, null);
	}

	public static StartSessionAppTokenBuilder startSession(String id, String tokenHash, String userId)  {
		return startSession(id, tokenHash, userId, SessionType.get(Integer.MIN_VALUE));
	}

	public static StartSessionAppTokenBuilder startSession(String id, String tokenHash, String userId, SessionType type)  {
		return startSession(id, tokenHash, userId, type, Integer.MIN_VALUE);
	}

	public static StartSessionAppTokenBuilder startSession(String id, String tokenHash, String userId, SessionType type, int expiry)  {
		return startSession(id, tokenHash, userId, type, expiry, null);
	}

	/**
	 * Starts a new KS (kaltura Session) based on an application authentication token
	  ID
	 * 
	 * @param id application token ID
	 * @param tokenHash a hash [MD5, SHA1, SHA256 and SHA512 are supported] of the current KS
	 * concatenated with the application token
	 * @param userId session user ID, will be ignored if a different user ID already defined on the
	 * application token
	 * @param type session type, will be ignored if a different session type is already defined on
	 * the application token
	 * @param expiry session expiry (in seconds), could be overridden by shorter expiry of the
	 * application token
	 * @param sessionPrivileges session privileges, will be ignored if a similar privilege is already defined on
	 * the application token or the privilege is server reserved
	 */
    public static StartSessionAppTokenBuilder startSession(String id, String tokenHash, String userId, SessionType type, int expiry, String sessionPrivileges)  {
		return new StartSessionAppTokenBuilder(id, tokenHash, userId, type, expiry, sessionPrivileges);
	}
	
	public static class UpdateAppTokenBuilder extends RequestBuilder {
		
		public UpdateAppTokenBuilder(String id, AppToken appToken) {
			super(AppToken.class, "apptoken", "update");
			params.add("id", id);
			params.add("appToken", appToken);
		}
		
		public void id(String multirequestToken) {
			params.add("id", multirequestToken);
		}
	}

	/**
	 * Update application authentication token by ID
	 * 
	 * @param id 
	 * @param appToken 
	 */
    public static UpdateAppTokenBuilder update(String id, AppToken appToken)  {
		return new UpdateAppTokenBuilder(id, appToken);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy