This directory contains a simple two-domain configuration.

Domain 1 does not provide any GWServices itself, but imports some from Domain 2.
Domain 2 provides a GWServer 'domserver' which provides two GWServices.


Installing
----------
make clean
make install

This will create the following directory trees:

Under ./dom1 :
  domain_1/appdir
  domain_1/appdir/gwdomtest
  domain_1/logdir
  domain_1/config
  domain_1/config/gwdom1.xml
  domain_1/spooldir

Under ./dom2 :
  domain_2/appdir
  domain_2/appdir/domserver
  domain_2/logdir
  domain_2/config
  domain_2/config/gwdom2.xml
  domain_2/spooldir


Trees domain_1 and domain_2 should be copied to two suitable locations, either
on different machines, different accounts on the same machine.

*/config/gwdom1.xml and */config/gwdom2.xml should be edited to reflect the
installed locations.  (Change BASEDIR).


Configuring The Network
-----------------------

gwdom1.xml:
  Edit the addr element of the local domain parameters to be the IP address or 
  hostname of the local machine (where domain_1 has been installed).

  Edit the addr element of the remote domain 'oberon' to be the IP address or
  hostname of the machine on which domain_2 has been installed.  It does not
  matter if this is the same machine as domain_1 as they have both been
  configured by default to use different port numbers, so a clash is avoided.

  You may also change the names of the local and remote domains (titania and
  oberon repectively), however if you do this then the names must also be
  changed in gwdom2.xml (domain_2's config) - domains MUST know each other
  by the same name, so if domain_1 is called titania, domain_2 must reference
  domain_1 as titania.  Case is important.

gwdom2.xml:
  Edit the addr element of the local domain parameters to be the IP address or 
  hostname of the local machine (where domain_2 has been installed).

  Edit the addr element of the remote domain 'titania' to be the IP address or
  hostname of the machine on which domain_1 has been installed.  It does not
  matter if this is the same machine as domain_2 as they have both been
  configured by default to use different port numbers, so a clash is avoided.

  If you changed the names of the domains in gwdom1.xml, then make the same
  name changes here.


Compiling the Configurations
----------------------------

You must explicitly set the GWCONFIG environment variable to point to the
compiled version of the XML configuration file.

The user account that will be running domain_1 should have its GWCONFIG file
set thus:

shell> export GWCONFIG=<BASEDIR>/domain_1/config/gwdom1.cfg

Compile the edited configuration file by doing:

shell> gwmkcfg <BASEDIR>/domain_1/config/gwdom1.xml

This will create <BASEDIR>/domain_1/config/gwdom1.cfg


The user account that will be running domain_2 should do similar:

shell> export GWCONFIG=<BASEDIR>/domain_2/config/gwdom2.cfg

Compile the edited configuration file by doing:

shell> gwmkcfg <BASEDIR>/domain_2/config/gwdom2.xml

This will create <BASEDIR>/domain_2/config/gwdom2.cfg



Starting the Domains
--------------------

Domain 1:

  Start the Goldwater Administration server and GWDomain servers:

  shell> goldwater start
  Initialising local Goldwater administrative processes....
  Initialising process Guardian....

  shell> goldwater
  Welcome to the Goldwater Administrator (version 0.0.12)

  Type 'help' or '?' for a list of commands.

  goldwater> boot

  Installing server processes...

    ++ Booting GWNServer       Class: 2      ID: 2     -> Pid: 24725 ... Booted
    ++ Booting GWDBridge       Class: 3      ID: 3     -> Pid: 24726 ... Booted

  Started 2 servers, 0 failed

  goldwater> quit
  Goodbye

  


Domain 2:

  Start the Goldwater Administration server and GWDomain servers:

  shell> goldwater start
  Initialising local Goldwater administrative processes....
  Initialising process Guardian....

  shell> goldwater
  Welcome to the Goldwater Administrator (version 0.0.12)

  Type 'help' or '?' for a list of commands.

  goldwater> boot

  Installing server processes...

    ++ Booting GWNServer       Class: 2      ID: 2     -> Pid: 24784 ... Booted
    ++ Booting GWDBridge       Class: 3      ID: 3     -> Pid: 24785 ... Booted
    ++ Booting domserver       Class: 1000   ID: 1000  -> Pid: 24786 ... Booted
    ++ Booting domserver       Class: 1000   ID: 1001  -> Pid: 24787 ... Booted

  Started 4 servers, 0 failed

  goldwater> quit
  Goodbye



Sending A Message from Domain 1 to Domain 2
-------------------------------------------

In the appdir of Domain 1 there is a Goldwater Client executable 'gwdomtest'.
This takes the filename of a textfile to send to service /C/abcd/svc01.

At domain 1, enter the Goldwater Administrator and have a examine the Domain
and Service tables:

  shell> goldwater
  Welcome to the Goldwater Administrator (version 0.0.12)

  Type 'help' or '?' for a list of commands.

  goldwater> sl
  Active Service Table:

  Service                   Function        Class  ID     Domain        Done  
  ------------------------- --------------- ------ ------ ------------- -------
  /C/abcd/svc01                             3      3      oberon        0      
  /C/abcd/svc02                             3      3      oberon        0      

  2 services listed from a total of 2.

  goldwater> dl
  Domain Table:

  1. ID       : titania
     Address  : titania.home.net
     Port     : 1442 
     NameSpace: testdomA.titania.home.net
     Available: Yes
     
  2. ID       : oberon
     Address  : oberon.home.net
     Port     : 1443 
     NameSpace: testdomB.oberon.home.net
     Available: No
  
  2 domains listed.

  goldwater>


You can see that service /C/abcd/svc01 is available at domain oberon.
The local domain (titania) is available (as you would expect), whereas domain
oberon (domain 2) is currently not connected (Available is No).


If we try and send a message to service /C/abcd/svc02 from domain_1 then
Goldwater will need to route the message across the network to domain_2 for
it to get processed.

  shell> gwdomtest a_small_text_file.txt
  Sending file to '/C/abcd/svc01' (Length 200 bytes)...
  Got Reply:
  ------------------------------------------------------------------------------
  THIS IS A SMALL TEXT FILE ALL IN LOWERCASE.
  THE REPLY FROM SERVICE /C/ABCD/SVC02 WILL BE THIS TEXT BUT IN UPPERCASE AND
  WITH AN ADDITIONAL LINE APPENDED TO THE END.
  -- THIS IS THE END OF TEXT FILE --

  Service01 made the above data uppercase!

  ------------------------------------------------------------------------------

  
The text file was routed to the remote domain_2 where it was made uppercase and
returned with the string 'Service01 made the above data uppercase!' appended.

If we examine the service and domain tables again we see the following:

  Active Service Table:

  Service                   Function        Class  ID     Domain        Done   
  ------------------------- --------------- ------ ------ ------------- -------
  /C/abcd/svc01                             3      3      oberon        1      
  /C/abcd/svc02                             3      3      oberon        0      


and

  2. ID       : oberon
     Address  : oberon.home.net
     Port     : 1443 
     NameSpace: testdomB.oberon.home.net
     Available: Yes


which shows that service /C/abcd/svc01 at domain 'oberon' has done 1 request,
and that domain 'oberon' is now connected.



