Server Reference Guide : ASOLib--OpenROAD Server Library : ASOLib User Classes : uc_name_server_client Class
 
Share this page          
uc_name_server_client Class
Use uc_name_server_client from an OpenROAD client only. Use this user class to connect the OpenROAD client to an OpenROAD Server application that is registered with the OpenROAD Server Name Server. A system variable of this class, ASONameServer, is available.
To connect to an OpenROAD Server application, the full RemoteServer.Initiate() connection signature (imagefilename, flags, type, location) could be specified. This user class simplifies the process of connecting to a registered OpenROAD Server application and means that client programmers need not specify the full connection signature. The client program requests a connection to an application by name rather than by its connection signature. When multiple ASOs are registered with the same name, connection balancing is attempted.
Name Server details are registered and maintained using the Server Manager.
Use this class to make a connection in a single step, or obtain the connection signature and check or amend it before using it to make a connection.
By default, system variables CurRemoteServer and OSCA are used, and can be overridden.
Attributes
Rs Attribute
UCAkaDetail Attribute
UCOSCA Attribute
v_name Attribute
Methods
Connect Method
GetConnectionDetails Method
Rs Attribute
Data Type: RemoteServer default null
This attribute is a reference variable pointing to the instance of RemoteServer that was used to make the connection. If no RemoteServer reference variable was passed to the Connect() or GetConnectionDetails() methods, this attribute will point to the same RemoteServer instance as the system variable CurRemoteServer points to. CurRemoteServer is a 4GL system variable of class RemoteServer.
UCAkaDetail Attribute
Data Type: uc_aka_detail default system
This attribute is a reference variable pointing to an instance of user class uc_aka_detail. When uc_name_server_client methods Connect() or GetConnectionDetails() are invoked, this object contains the connection signature obtained from the Name Server.
UCOSCA Attribute
Data Type: uc_osca default null
This attribute is a reference variable pointing to the instance of user class uc_osca that was used to make the connection. If no uc_osca reference variable was passed to the Connect() or GetConnectionDetails() methods, it will point to the same uc_osca instance as pointed to by system variable OSCA.
v_name Attribute
Data Type: varchar(32) not null
This attribute contains the name of the requested application. When uc_name_server_client methods Connect() or GetConnectionDetails() are invoked, this attribute contains the value of the parameter p_v_name.
Connect Method
This method connects to the Name Server on the default target machine (as specified in DCOMCNFG) and requests a connection signature for the application named in parameter p_v_name. After the connection signature has been returned, it will be used to make a connection. Typically, p_rs and p_UCOsca are not passed. If multiple Name Server registrations share the same name, connection load balancing is attempted.
Optional parameters p_v_serverlocation and p_v_routing are used in the RemoteServer.Initiate call to the Name Server. These parameters can be used to override the client's default DCOM settings. For more information, see OpenROAD Client 4GL RemoteServer System Class.
Depending on the configuration of the Name Server, it is possible that a second Name Server location may be returned instead of a connection signature. If this is the case then the same request will be made of the second Name Server (a third Name Server location will not be returned). This can assist with connection load balancing over multiple machines running the same application.
Parameters:
(p_v_name = varchar(32),
p_rs = REMOTESERVER default CurRemoteServer,
p_UCOsca = uc_osca default OSCA,
p_v_serverlocation = varchar(256),
p_v_routing = varchar(256))
Return Data Type: None
Examples:
1.
/* use the defaults OSCA and CurRemoteServer */
   ASONameServer.Connect (p_v_name = 'Demo App 1');
   . . .
2.
/* override the default uc_osca and REMOTESERVER instances */
   MyOtherRemoteServer = REMOTESERVER.Create();
   MyOtherOsca = uc_osca.Create();
   ASONameServer.Connect (p_v_name = 'Demo App 2',
                          p_rs     = MyOtherRemoteServer,
                          p_UCOsca = MyOtherOsca);
GetConnectionDetails Method
This method connects to the Name Server on the default target machine (as specified in DCOMCNFG) and will request a connection signature for the application named in mandatory parameter p_v_name. The final connection to the named application will not be made. (To make the final connection, the Connect method can then be invoked, passing no parameters). If multiple Name Server registrations share the same name, connection load balancing is attempted.
Optional parameters p_v_serverlocation and p_v_routing are used in the RemoteServer.Initiate call to the Name Server. These parameters can be used to override the client's default DCOM settings. For more information, see OpenROAD Client 4GL RemoteServer System Class.
Depending on the configuration of the Name Server, it is possible that a second Name Server location may be returned instead of a connection signature. If this is the case, the same request will be made of the second Name Server (a third Name Server location will not be returned). This can assist with connection load balancing over multiple machines running the same application.
Parameters:
(p_v_name = varchar(32),
 p_rs = REMOTESERVER default CurRemoteServer,
 p_UCOsca = uc_osca default OSCA,
 p_v_serverlocation = varchar(256),
 p_v_routing = varchar(256))
Return Data Type: None
Examples:
1.
/* use the defaults OSCA and CurRemoteServer */
ASONameServer.GetConnectionDetails (p_v_name = 'Demo App 1');
ASONameServer.Connect();
2.
/* override the default uc_osca and REMOTESERVER instances */
MyOtherRemoteServer = REMOTESERVER.Create();
MyOtherOsca = uc_osca.Create();
ASONameServer.GetConnectionDetails (p_v_name = 'Demo App 2',
                                    p_rs     = MyOtherRemoteServer,
                                    p_UCOsca = MyOtherOsca);
ASONameServer.Connect();