22//| This source code is provided under the Apache 2.0 license --
33//| and is provided AS IS with no warranty or guarantee of fit for purpose. --
44//| See the project's LICENSE.md for details. --
5- //| Copyright (C) 2018-2021 Refinitiv . All rights reserved. --
5+ //| Copyright (C) 2018-2025 LSEG . All rights reserved. --
66//|-----------------------------------------------------------------------------
77
88package com .refinitiv .ws .cloud ;
4343import io .github .cdimascio .dotenv .Dotenv ;
4444
4545/*
46- * This example demonstrates authenticating via Refinitiv Data Platform, using an
47- * authentication token to discover Refinitiv Real-Time service endpoint, and
48- * using the endpoint and authentitcation to retrieve market content.
46+ * This example demonstrates authenticating via Delivery Platform (RDP) , using an
47+ * authentication token to discover the Real-Time service endpoint, and
48+ * using the endpoint and authentication to retrieve market content.
4949 *
5050 * This example maintains a session by proactively renewing the authentication
5151 * token before expiration.
5656 * each of the hosts.
5757 *
5858 * It performs the following steps:
59- * - Authenticating via HTTP Post request to Refinitiv Data Platform
59+ * - Authenticating via HTTP Post request to Delivery Platform (RDP)
6060 * - Retrieving service endpoints from Service Discovery via HTTP Get request,
61- * using the token retrieved from Refinitiv Data Platform
61+ * using the token retrieved from RDP
6262 * - Opening a WebSocket (or two, if the --hotstandby option is specified) to
63- * a Refinitiv Real-Time Service endpoint, as retrieved from Service Discovery
63+ * a Real-Time Service endpoint, as retrieved from Service Discovery
6464 * - Sending Login into the Real-Time Service using the token retrieved
65- * from Refinitiv Data Platform .
65+ * from RDP .
6666 * - Requesting market-price content.
6767 * - Printing the response content.
68- * - Periodically proactively re-authenticating to Refinitiv Data Platform , and
68+ * - Periodically proactively re-authenticating to RDP , and
6969 * providing the updated token to the Real-Time endpoint before token expiration.
7070 */
7171
@@ -458,7 +458,7 @@ public static void main(String[] args) {
458458 }
459459 try {
460460
461- // Connect to Refinitiv Data Platform and authenticate (using our username and password)
461+ // Connect to RDP and authenticate (using our username and password)
462462 authJson = getAuthenticationInfo (null );
463463 if (authJson == null )
464464 System .exit (1 );
@@ -536,7 +536,7 @@ else if(region.equals("apac"))
536536 // Continue using current token until 90% of initial time before it expires.
537537 Thread .sleep (expireTime * 900 ); // The value 900 means 90% of expireTime in milliseconds
538538
539- // Connect to Refinitiv Data Platform and re-authenticate, using the refresh token provided in the previous response
539+ // Connect to RDP and re-authenticate, using the refresh token provided in the previous response
540540 authJson = getAuthenticationInfo (authJson );
541541 if (authJson == null )
542542 System .exit (1 );
@@ -697,7 +697,7 @@ public static boolean changePassword(String authServer) {
697697
698698
699699 /**
700- * Authenticate to Refinitiv Data Platform via an HTTP post request.
700+ * Authenticate to RDP via an HTTP post request.
701701 * Initially authenticates using the specified password. If information from a previous authentication response is provided, it instead authenticates using
702702 * the refresh token from that response. Uses authUrl as url.
703703 * @param previousAuthResponseJson Information from a previous authentication, if available
@@ -709,7 +709,7 @@ public static JSONObject getAuthenticationInfo(JSONObject previousAuthResponseJs
709709 }
710710
711711 /**
712- * Authenticate to Refinitiv Data Platform via an HTTP post request.
712+ * Authenticate to RDP via an HTTP post request.
713713 * Initially authenticates using the specified password. If information from a previous authentication response is provided, it instead authenticates using
714714 * the refresh token from that response.
715715 * @param previousAuthResponseJson Information from a previous authentication, if available
@@ -763,15 +763,15 @@ public static JSONObject getAuthenticationInfo(JSONObject previousAuthResponseJs
763763 case HttpStatus .SC_OK : // 200
764764 // Authentication was successful. Deserialize the response and return it.
765765 JSONObject responseJson = new JSONObject (EntityUtils .toString (response .getEntity ()));
766- System .out .println ("Refinitiv Data Platform Authentication succeeded. RECEIVED:" );
766+ System .out .println ("RDP Authentication succeeded. RECEIVED:" );
767767 System .out .println (responseJson .toString (2 ));
768768 return responseJson ;
769769 case HttpStatus .SC_MOVED_PERMANENTLY : // 301
770770 case HttpStatus .SC_MOVED_TEMPORARILY : // 302
771771 case HttpStatus .SC_TEMPORARY_REDIRECT : // 307
772772 case 308 : // 308 HttpStatus.SC_PERMANENT_REDIRECT
773773 // Perform URL redirect
774- System .out .println ("Refinitiv Data Platform authentication HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
774+ System .out .println ("RDP authentication HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
775775 Header header = response .getFirstHeader ("Location" );
776776 if ( header != null )
777777 {
@@ -786,7 +786,7 @@ public static JSONObject getAuthenticationInfo(JSONObject previousAuthResponseJs
786786 case HttpStatus .SC_BAD_REQUEST : // 400
787787 case HttpStatus .SC_UNAUTHORIZED : // 401
788788 // Retry with username and password
789- System .out .println ("Refinitiv Data Platform authentication HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
789+ System .out .println ("RDP authentication HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
790790 if (previousAuthResponseJson != null )
791791 {
792792 System .out .println ("Retry with username and password" );
@@ -796,17 +796,17 @@ public static JSONObject getAuthenticationInfo(JSONObject previousAuthResponseJs
796796 case HttpStatus .SC_FORBIDDEN : // 403
797797 case 451 : // 451 Unavailable For Legal Reasons
798798 // Stop retrying with the request
799- System .out .println ("Refinitiv Data Platform authentication HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
799+ System .out .println ("RDP authentication HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
800800 System .out .println ("Stop retrying with the request" );
801801 return null ;
802802 default :
803- // Retry the request to Refinitiv Data Platform
804- System .out .println ("Refinitiv Data Platform authentication HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
805- System .out .println ("Retry the request to Refinitiv Data Platform " );
803+ // Retry the request to RDP
804+ System .out .println ("RDP authentication HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
805+ System .out .println ("Retry the request to RDP " );
806806 return getAuthenticationInfo (previousAuthResponseJson );
807807 }
808808 } catch (Exception e ) {
809- System .out .println ("Refinitiv Data Platform authentication failure:" );
809+ System .out .println ("RDP authentication failure:" );
810810 e .printStackTrace ();
811811 return null ;
812812 }
@@ -855,7 +855,7 @@ public static JSONObject queryServiceDiscovery( String url ) {
855855 case HttpStatus .SC_OK : // 200
856856 // Service discovery was successful. Deserialize the response and return it.
857857 JSONObject responseJson = new JSONObject (EntityUtils .toString (response .getEntity ()));
858- System .out .println ("Refinitiv Data Platform service discovery succeeded. RECEIVED:" );
858+ System .out .println ("RDP service discovery succeeded. RECEIVED:" );
859859 System .out .println (responseJson .toString (2 ));
860860 return responseJson ;
861861 case HttpStatus .SC_MOVED_PERMANENTLY : // 301
@@ -864,7 +864,7 @@ public static JSONObject queryServiceDiscovery( String url ) {
864864 case HttpStatus .SC_TEMPORARY_REDIRECT : // 307
865865 case 308 : // 308 HttpStatus.SC_PERMANENT_REDIRECT
866866 // Perform URL redirect
867- System .out .println ("Refinitiv Data Platform service discovery HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
867+ System .out .println ("RDP service discovery HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
868868 Header header = response .getFirstHeader ("Location" );
869869 if ( header != null )
870870 {
@@ -879,17 +879,17 @@ public static JSONObject queryServiceDiscovery( String url ) {
879879 case HttpStatus .SC_FORBIDDEN : // 403
880880 case 451 : // 451 Unavailable For Legal Reasons
881881 // Stop retrying with the request
882- System .out .println (" Refinitiv Data Platform service discovery HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
882+ System .out .println ("RDP service discovery HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
883883 System .out .println ("Stop retrying with the request" );
884884 return null ;
885885 default :
886886 // Retry the service discovery request
887- System .out .println ("Refinitiv Data Platform service discovery HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
887+ System .out .println ("RDP service discovery HTTP code: " + response .getStatusLine ().getStatusCode () + " " + response .getStatusLine ().getReasonPhrase ());
888888 System .out .println ("Retry the service discovery request" );
889889 return queryServiceDiscovery ();
890890 }
891891 } catch (Exception e ) {
892- System .out .println ("Refinitiv Data Platform service discovery failure:" );
892+ System .out .println ("RDP service discovery failure:" );
893893 e .printStackTrace ();
894894 return null ;
895895 }
0 commit comments