Class: Kaltura::KalturaSessionService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_client.rb

Overview

Session service

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaSessionService

Returns a new instance of KalturaSessionService.



4421
4422
4423
# File 'lib/kaltura_client.rb', line 4421

def initialize(client)
	super(client)
end

Instance Method Details

#endObject

End a session with the Kaltura server, making the current KS invalid.

Returns:



4427
4428
4429
4430
4431
4432
4433
4434
# File 'lib/kaltura_client.rb', line 4427

def end()
	kparams = {}
	client.queue_service_action_call('session', 'end', '', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#get(session = KalturaNotImplemented) ⇒ KalturaSessionInfo

Parse session key and return its info

Returns:



4438
4439
4440
4441
4442
4443
4444
4445
4446
# File 'lib/kaltura_client.rb', line 4438

def get(session=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'session', session)
	client.queue_service_action_call('session', 'get', 'KalturaSessionInfo', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#impersonate(secret, impersonated_partner_id, user_id = '', type = 0, partner_id = KalturaNotImplemented, expiry = 86400, privileges = KalturaNotImplemented) ⇒ string

Start an impersonated session with Kaltura’s server. The result KS is the session key that you should pass to all services that requires a ticket.

Returns:

  • (string)


4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
# File 'lib/kaltura_client.rb', line 4451

def impersonate(secret, impersonated_partner_id, user_id='', type=0, partner_id=KalturaNotImplemented, expiry=86400, privileges=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'secret', secret)
	client.add_param(kparams, 'impersonatedPartnerId', impersonated_partner_id)
	client.add_param(kparams, 'userId', user_id)
	client.add_param(kparams, 'type', type)
	client.add_param(kparams, 'partnerId', partner_id)
	client.add_param(kparams, 'expiry', expiry)
	client.add_param(kparams, 'privileges', privileges)
	client.queue_service_action_call('session', 'impersonate', 'string', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#impersonate_by_ks(session, type = KalturaNotImplemented, expiry = KalturaNotImplemented, privileges = KalturaNotImplemented) ⇒ KalturaSessionInfo

Start an impersonated session with Kaltura’s server. The result KS info contains the session key that you should pass to all services that requires a ticket. Type, expiry and privileges won’t be changed if they’re not set

Returns:



4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
# File 'lib/kaltura_client.rb', line 4471

def impersonate_by_ks(session, type=KalturaNotImplemented, expiry=KalturaNotImplemented, privileges=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'session', session)
	client.add_param(kparams, 'type', type)
	client.add_param(kparams, 'expiry', expiry)
	client.add_param(kparams, 'privileges', privileges)
	client.queue_service_action_call('session', 'impersonateByKs', 'KalturaSessionInfo', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#start(secret, user_id = '', type = 0, partner_id = KalturaNotImplemented, expiry = 86400, privileges = KalturaNotImplemented) ⇒ string

Start a session with Kaltura’s server. The result KS is the session key that you should pass to all services that requires a ticket.

Returns:

  • (string)


4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
# File 'lib/kaltura_client.rb', line 4487

def start(secret, user_id='', type=0, partner_id=KalturaNotImplemented, expiry=86400, privileges=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'secret', secret)
	client.add_param(kparams, 'userId', user_id)
	client.add_param(kparams, 'type', type)
	client.add_param(kparams, 'partnerId', partner_id)
	client.add_param(kparams, 'expiry', expiry)
	client.add_param(kparams, 'privileges', privileges)
	client.queue_service_action_call('session', 'start', 'string', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#start_widget_session(widget_id, expiry = 86400) ⇒ KalturaStartWidgetSessionResponse

Start a session for Kaltura’s flash widgets



4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
# File 'lib/kaltura_client.rb', line 4504

def start_widget_session(widget_id, expiry=86400)
	kparams = {}
	client.add_param(kparams, 'widgetId', widget_id)
	client.add_param(kparams, 'expiry', expiry)
	client.queue_service_action_call('session', 'startWidgetSession', 'KalturaStartWidgetSessionResponse', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end