Specification of package Corba.Transport.Ssl
Writing a new transport for OpenFusion RTORB Ada Edition library :
We strongly recommand to implement in a child package of Corba.Transport
for visibility rules. Package Corba.Transport define base classes for both
connected (ex IIOP/TCP) and non connected transports (ex. MIOP/UDP).
Step 1
Give a 3 character name to transport (mandatory ) :
Name : Protocol_Name := "SSL" ;
Give an Id to transport (mandatory ) :
A free Id can be obtained from OMG following the above procedure :
xxx
Id : constant := Corba.Iop.Tag_Memory_Iop ;
Step 2
Define the new transport object and a class wide access :
For a connected transport use :
type Object is new Corba.Transport.Connected with null record ;
type Object_Ptr is access all Object'class ;
For a non connected transport use :
type Object is new Corba.Transport.Connection_Less with null record ;
type Object_Ptr is access all Object'class ;
Step 3
Add transport primitives (mandatory). These primitives are declared abstract for base classes :
Create a data connection corresponding to the given URL
function Connection ( Self : access Object ;
Url : in Standard.String) return Tgx.Ios.Io_Connection_Access ;
Build the transport IOR profile header for the given URL
It is aligned on a four-bytes boundary and contains only the transport
information (e.g. host name and TCP port number for IIOP profile)
function Get_Profile_Header
( Self : access Object ;
Url : in Standard.String ) return Corba_Ios.Stream_Element_Array ;
Extract the URL from the IOR stream
Index is aligned on a four-bytes boundary and points at the beginning
of the transport information
(e.g. host name and TCP port number for IIOP profile)
Index is updated to the last byte index of the transport information
function Get_Url ( Self : access Object ;
Swap : in Boolean ; -- Indicate the need to swap bytes
Data : in Corba_Ios.Stream_Element_Array ;
Index : access Corba_Ios.Stream_Element_Offset) return Standard.String ;
For connected transport :
Create a server connection corresponding to the given URL
function Create_Server ( Self : access Object ;
Url : in Standard.String) return Tgx.Ios.Io_Server_Access ;
For non connected transport :
Create a server connection corresponding to the given URL
function Create_Receiver ( Self : access Object ;
Url : in Standard.String) return Tgx.Ios.Io_Connection_Access ;
Step 4
Provide a function to compute URLs for this transport (optionnal but useful for body implementation)
Step 5
Optionnally define useful procedures for transport paramerization from application level
Step 6
Implement the body
First declare a transport Object
This_Transport : Object_Ptr := new Object'( Protocol => Name,
Profile => Id,
Is_Oneway => False) ;
Finally
Register transport at elaboration :
begin
Register (Corba.Transport.Object_Ptr (This_Transport)) ;
Make transport available for your POA (see mettre le lien)
========================================================================= --
=== === --
=== Top Graph'X CORBA Implementation === --
=== === --
=== Copyright (c) 2004, Top Graph'X. === --
=== === --
=== --- Copyright Notice --- === --
=== === --
=== This software is protected as an unpublished work under the === --
=== Copyright Act of 1976. All rights reserved. Top Graph'X. === --
=== === --
========================================================================= --
with Tgx.Ios.File_Ios.Socket_Ios.Ssl_Socket_Ios ;
package Corba.Transport.Ssl is
Name : Protocol_Name := "SSL" ;
Id : constant := Corba.Iop.Tag_SSL_Iop ;
package Socket_Ios renames Tgx.Ios.File_Ios.Socket_Ios.Ssl_Socket_Ios ;
type Object is new Corba.Transport.Connected with null record ;
type Object_Ptr is access all Object'class ;
To get the IP address string of a host name
Same as TCP transport but redefined to make transport independant
function Ip_Name (Host_Name : in Standard.String) return Standard.String ;
Build the URL from host and port
function Url ( Host_Name : in Standard.String ;
Port : in Socket_Ios.Port ) return Standard.String ;
Create a data connection corresponding to the given URL
function Connection ( Self : access Object ;
Url : in Standard.String) return Tgx.Ios.Io_Connection_Access ;
Build the transport IOR profile header for the given URL
It is aligned on a four-bytes boundary and contains only the transport
information (e.g. host name and TCP port number for IIOP profile)
function Get_Profile_Header
( Self : access Object ;
Url : in Standard.String ) return Corba_Ios.Stream_Element_Array ;
Extract the URL from the IOR stream
Index is aligned on a four-bytes boundary and points at the beginning
of the transport information
(e.g. host name and TCP port number for IIOP profile)
Index is updated to the last byte index of the transport information
function Get_Url ( Self : access Object ;
Swap : in Boolean ; Indicate the need to swap bytes
Data : in Corba_Ios.Stream_Element_Array ;
Index : access Corba_Ios.Stream_Element_Offset) return Standard.String ;
Create a server connection corresponding to the given URL
function Create_Server ( Self : access Object ;
Url : in Standard.String) return Tgx.Ios.Io_Server_Access ;
end Corba.Transport.Ssl ;
List of definition uses
This page was generated by PrismTech's ada2html on Friday Mai 12 2006 16:18