Class: Conversant::V3::Services::LMS
- Includes:
- Authorization
- Defined in:
- lib/conversant/v3/services/lms.rb,
lib/conversant/v3/services/lms/job.rb,
lib/conversant/v3/services/lms/domain.rb,
lib/conversant/v3/services/lms/preset.rb,
lib/conversant/v3/services/lms/partner.rb,
lib/conversant/v3/services/lms/dashboard.rb,
lib/conversant/v3/services/lms/partner/report.rb,
lib/conversant/v3/services/lms/partner/business.rb,
lib/conversant/v3/services/lms/partner/analytics.rb,
sig/conversant/v3/services/lms.rbs
Overview
LMS (Live Media Streaming) service
Defined Under Namespace
Classes: Dashboard, Domain, Job, Partner, Preset
Constant Summary
Constants included from HttpClient
HttpClient::PORTAL_SESSION_REDIS_KEY, HttpClient::SSO_GW_SESSION2_REDIS_KEY
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #build_reporting_url ⇒ String
- #build_request_headers ⇒ Hash[String | Symbol, untyped]
- #cache_jsessionid ⇒ void
-
#dashboard ⇒ Dashboard
Get dashboard metrics service instance.
-
#domain ⇒ Domain
Get domain management service instance.
- #extract_and_cache_jsessionid ⇒ String?
- #fetch_new_session ⇒ String?
-
#job ⇒ Job
Service accessors.
- #log_and_return_nil ⇒ nil
-
#partner ⇒ Partner
Get partner service instance.
-
#partner_analytics ⇒ LMS::Partner::Analytics
deprecated
Deprecated.
Use #partner instead
-
#preset ⇒ Preset
Get preset service instance.
- #request_jsessionid ⇒ Object
- #requires_session? ⇒ Boolean
- #service_endpoint ⇒ String
- #session_cookie_name ⇒ String
- #valid_sessions? ⇒ Boolean
Methods included from Authorization
#authorize, #authorized_headers, #base_headers, #build_cookie_hash, #build_headers_with_cookies, #cached_session, #fetch_session_cookie, #fetch_sso_session, #format_cookies, #log_missing_session, #session_cache_key, #sso_cache_key
Methods inherited from Base
#configuration, #identifier, #initialize, #logger, #portal_endpoint, #redis, #sso_endpoint, #validate_configuration!
Methods included from HttpClient
#add_cookies_to_headers, #authenticate, #configuration, #cookie_jar, #cookie_jar=, #debug_log, #extract_form_action, #http_get, #http_post, #login_url, #parse_cookie_to_jar, #redis, #request, #sso_login, #update_cookie_jar
Constructor Details
This class inherits a constructor from Conversant::V3::Base
Instance Method Details
#build_reporting_url ⇒ String
67 |
# File 'sig/conversant/v3/services/lms.rbs', line 67
def build_reporting_url: () -> String
|
#build_request_headers ⇒ Hash[String | Symbol, untyped]
68 |
# File 'sig/conversant/v3/services/lms.rbs', line 68
def build_request_headers: (Hash[Symbol, String] sessions) -> Hash[String | Symbol, untyped]
|
#cache_jsessionid ⇒ void
This method returns an undefined value.
70 |
# File 'sig/conversant/v3/services/lms.rbs', line 70
def cache_jsessionid: (String jsessionid) -> void
|
#dashboard ⇒ Dashboard
Get dashboard metrics service instance
47 48 49 |
# File 'lib/conversant/v3/services/lms.rb', line 47 def dashboard @dashboard ||= Dashboard.new(self) end |
#domain ⇒ Domain
Get domain management service instance
39 40 41 |
# File 'lib/conversant/v3/services/lms.rb', line 39 def domain @domain ||= Domain.new(self) end |
#extract_and_cache_jsessionid ⇒ String?
69 |
# File 'sig/conversant/v3/services/lms.rbs', line 69
def extract_and_cache_jsessionid: (untyped response) -> String?
|
#fetch_new_session ⇒ String?
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/conversant/v3/services/lms.rb', line 121 def fetch_new_session sessions = authenticate return nil unless sessions && sessions[:session] && sessions[:sso_gw_session2] = (Time.now.to_f * 1000).to_i reporting_url = "#{configuration.private_lms_endpoint}/?customerId=#{customer_id}&isHideMenu=f&t=#{}" logger.debug "#{identifier}.METHOD:authorize.REQUESTING_JSESSIONID" response = RestClient.get( reporting_url, { authority: URI.parse(configuration.private_lms_endpoint).hostname, referer: portal_endpoint, user_agent: configuration.default_ua, cookies: { 'SESSION': sessions[:session], 'SSO_GW_SESSION2': sessions[:sso_gw_session2] }, timeout: 30, open_timeout: 30 } ) if response.['JSESSIONID'] jsessionid = response.['JSESSIONID'] redis.set(session_cache_key, jsessionid, ex: configuration.cache_ttl) logger.debug "#{identifier}.METHOD:authorize.JSESSIONID_OBTAINED" jsessionid else logger.error "#{identifier}.METHOD:authorize.NO_JSESSIONID_IN_RESPONSE" nil end rescue RestClient::Unauthorized, RestClient::Forbidden => e logger.error "#{identifier}.METHOD:authorize.AUTH_ERROR:#{e.}" nil rescue StandardError => e logger.error "#{identifier}.METHOD:authorize.ERROR:#{e.}" nil end |
#job ⇒ Job
Service accessors
31 32 33 |
# File 'lib/conversant/v3/services/lms.rb', line 31 def job @job ||= Job.new(self) end |
#log_and_return_nil ⇒ nil
71 |
# File 'sig/conversant/v3/services/lms.rbs', line 71
def log_and_return_nil: (String message) -> nil
|
#partner ⇒ Partner
Get partner service instance
Provides access to partner-level analytics for Live Media Streaming that aggregate data across multiple customer accounts.
70 71 72 |
# File 'lib/conversant/v3/services/lms.rb', line 70 def partner @partner ||= Partner.new(self) end |
#partner_analytics ⇒ LMS::Partner::Analytics
Use #partner instead
Get partner analytics service instance (deprecated)
80 81 82 |
# File 'lib/conversant/v3/services/lms.rb', line 80 def partner_analytics @partner_analytics ||= Partner::Analytics.new(self) end |
#preset ⇒ Preset
Get preset service instance
55 56 57 |
# File 'lib/conversant/v3/services/lms.rb', line 55 def preset @preset ||= Preset.new(self) end |
#request_jsessionid ⇒ Object
66 |
# File 'sig/conversant/v3/services/lms.rbs', line 66
def request_jsessionid: (Hash[Symbol, String] sessions) -> untyped
|
#requires_session? ⇒ Boolean
115 116 117 |
# File 'lib/conversant/v3/services/lms.rb', line 115 def requires_session? true end |
#service_endpoint ⇒ String
107 108 109 |
# File 'lib/conversant/v3/services/lms.rb', line 107 def service_endpoint configuration.private_lms_endpoint end |
#session_cookie_name ⇒ String
111 112 113 |
# File 'lib/conversant/v3/services/lms.rb', line 111 def 'JSESSIONID' end |
#valid_sessions? ⇒ Boolean
65 |
# File 'sig/conversant/v3/services/lms.rbs', line 65
def valid_sessions?: (Hash[Symbol, String]? sessions) -> bool
|