This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | FROM maven:3.9.3-eclipse-temurin-11-alpine as builder | |
| LABEL authors="Developer Relations" | |
| WORKDIR /app | |
| COPY pom.xml . | |
| RUN mvn dependency:go-offline -B | |
| COPY src ./src | |
| RUN mvn clean -e -B package | |
| FROM openjdk:11-jre-slim-bullseye | |
| #FROM openjdk:17.0.2-slim-bullseye | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class AppClient : OmmConsumerClient { | |
| private val _loginRefresh: LoginRefresh = EmaFactory.Domain.createLoginRefresh() | |
| private val _loginStatus: LoginStatus = EmaFactory.Domain.createLoginStatus() | |
| override fun onRefreshMsg(refreshMsg: RefreshMsg, event: OmmConsumerEvent) { | |
| .... | |
| if (refreshMsg.domainType() == EmaRdm.MMT_LOGIN) { | |
| _loginRefresh.clear() | |
| println(_loginRefresh.message(refreshMsg).toString()) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class AppClient : OmmConsumerClient { | |
| private val _loginRefresh: LoginRefresh = EmaFactory.Domain.createLoginRefresh() | |
| private val _loginStatus: LoginStatus = EmaFactory.Domain.createLoginStatus() | |
| override fun onRefreshMsg(refreshMsg: RefreshMsg, event: OmmConsumerEvent) { | |
| ... | |
| if (refreshMsg.dataType() == EmaRdm.MMT_LOGIN) { | |
| _loginRefresh.clear() | |
| println(_loginRefresh.message(refreshMsg).toString()) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class AppClient : OmmConsumerClient { | |
| override fun onRefreshMsg(refreshMsg: RefreshMsg, event: OmmConsumerEvent) { | |
| println("Received Refresh. Item Handle: ${event.handle()} Closure: ${event.closure()}") | |
| println("Item Name: ${if (refreshMsg.hasName()) refreshMsg.name() else "<not set>"}") | |
| println("Service Name: ${if (refreshMsg.hasServiceName()) refreshMsg.serviceName() else "<not set>"}") | |
| println("Item State: ${refreshMsg.state()}") | |
| println(refreshMsg) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fun run(clientId: String, clientSecret: String, serviceName: String = "ELEKTRON_DD") { | |
| ... | |
| private val itemName = "EUR=" | |
| try { | |
| val appClient = AppClient() | |
| val config: OmmConsumerConfig = EmaFactory.createOmmConsumerConfig() | |
| ... | |
| // --------------------------------- View --------------------------- | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fun run(clientId: String, clientSecret: String, serviceName: String = "ELEKTRON_DD") { | |
| var consumer: OmmConsumer? = null | |
| val oAuthCallback = OAuthcallback() | |
| val credentials = CredentialStore(clientId, clientSecret, consumer) | |
| try { | |
| val appClient = AppClient() | |
| val config: OmmConsumerConfig = EmaFactory.createOmmConsumerConfig() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fun run(clientId: String, clientSecret: String, serviceName: String = "ELEKTRON_DD") { | |
| var consumer: OmmConsumer? = null | |
| val oAuthCallback = OAuthcallback() | |
| val credentials = CredentialStore(clientId, clientSecret, consumer) | |
| try { | |
| val appClient = AppClient() | |
| val config: OmmConsumerConfig = EmaFactory.createOmmConsumerConfig() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* This is for example purposes, For best security, please use a proper credential store. */ | |
| data class CredentialStore(var clientSecret: String, var clientId: String, var consumer: OmmConsumer?) | |
| /* Implementation of OmmOAuth2ConsumerClient. This is a very basic callback that uses the closure to obtain | |
| * the OmmConsumer and call submitOAuthCredentialRenewal. | |
| * | |
| * This is intended to show functionality, so this example does not implement or use secure credential storage. | |
| */ | |
| class OAuthcallback : OmmOAuth2ConsumerClient { | |
| override fun onOAuth2CredentialRenewal(event: OmmConsumerEvent?) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <Channel> | |
| <Name value="Channel_4"/> | |
| <ChannelType value="ChannelType::RSSL_ENCRYPTED"/> | |
| <CompressionType value="CompressionType::None"/> | |
| <GuaranteedOutputBuffers value="5000"/> | |
| <!-- EMA discovers a host and a port from RDP service discovery for the specified location | |
| when both of them are not set and the session management is enable. --> | |
| <Location value="ap-southeast"/> | |
| <EnableSessionManagement value="1"/> | |
| <ObjectName value=""/> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class KonsumerRTO { | |
| private val tokenUrlV2 = "https://api.refinitiv.com/auth/oauth2/v2/token" | |
| private val itemName = "EUR=" | |
| fun run(clientId: String, clientSecret: String, serviceName: String = "ELEKTRON_DD") { | |
| var consumer: OmmConsumer? = null | |
| try { | 
NewerOlder