[saga-rg] Final Call Issue 15: The URL Problem

Andre Merzky andre at merzky.net
Thu Feb 16 15:11:06 CST 2006


Hi group(s), 

We discussed issue 15 in Athens, but could not come to
consensus.  I further discussed the issue with Thilo,
Wolfgang Ziegler, and some Unicore guys (Philip and Achim).

In order to settle the issue for the SAGA-CORE-API (NOT
forever), I want to propose the following solution.  If no
reply comes within a week, I assume its accepted :-)


  - A URL utility class seems useful, but would increase
    the syntactic load on the current set of methods (either
    allow all methods with strings _and_ urls, or require
    transformation from strings to urls _always_ - both
    seems suboptimal).

  - hence NO URL utility class is mandated.

  - a NSEntry utility call is introduced:

      convert (in  string target, 
               out string new_url);

    Usage examples:

    saga::file  f ("ftp://ftp.net.org/pub/data/file.txt");
    std::string n1 = f.convert ("ftp://ftp.net.org:123/");
    std::string n2 = f.convert ("ftp://alias.net.org/data/");
    std::string n3 = f.convert ("http://www.net.org");

  - that call tries to translate URLs, and if unsuccessfull
    returns an empty string.

I know that is 'somewhat' of a compromise.  A full fledged
URL class certainly would be useful, and Java for example
already has it.  I would expect that most SAGA
implementations will provide one anyway.  But as we could
not reach consensus on that, the topic seems to need more
discussion, and more time which I wthink we don't have for
stabilizing the API.

The convert method could be implemented as follows (all
services hosted on same resource):

  Known: 1  host:  ftp.net.org
            proto: ftp
            root:  /var/www/htdocs/ftp_store/

         2  host:  ftp.net.org
            proto: ftp:123
            root:  /var/ftp_test/

         3  host:  www.net.org
            proto: http
            root:  /var/www/htdocs/

  input: url: ftp://ftp.net.org/pub/data/file.txt
         tgt: http
  with 1 translates into absolute path
         abs: /var/www/htdocs/ftp_store/pub/data/file.txt
  with 3 translates into 
         out: http://www.net.org/ftp_store/pub/data/file.txt

Cheers, Andre.

-- 
"So much time, so little to do..."  -- Garfield





More information about the saga-rg mailing list