NAME

MultiSite::File::ShippingConf - A simple parser for the MultiSite store-and-forward config file

VERSION

This document describes version 0.06, released May, 2004.

SYNOPSIS

     use MultiSite::File::ShippingConf;

     $shipconf = new MultiSite::File::ShippingConf;

     @value = $shipconf->get('VARIABLE');
or   @value = $shipconf->get('VARIABLE', 'storage-class');
or   @value = $shipconf->get('VARIABLE', 'argument');

     print $shipconf->dump;

DESCRIPTION

This class is an object oriented wrapper for the 'Shipping.conf' file use to configure Rational Software's MultiSite (ClearCase) environment.

Objects of this class load the 'Shipping.conf' file into an 'INI' file format (Microsoft's Windowz '.INI' format). Currently this class provides read only access to the MultiSite shipping configuration file.

The Microsoft '.ini' format is as follows. If anyone can point me to official documentation or specifications, I'd appreciate it.

[section-tag1]
param1=value1
param2=value2

This Class is a strange use of the INI format, but the MultiSite shipping configuration file is strange, too. The VARIABLE names are turned into INI 'section tags,' and the values are stored within the INI sections using the storage-class values. Any VARIABLE names that don't use a storage-class will have values in the '-default' class. (This turns out to be a good thing, and will become clear below.)

Constructor

new ( ConfigFile )

Load the MultiSite shipping configuration file into memory. By default, this file is named shipping.conf. It's location depends on the installed version of ClearCase/MultiSite.

Through versions 5.x, this file is located in '/var/adm/atria/config/'. For versions 6 and later, this file is located in '/var/adm/rational/clearcase/config/'.

use MultiSite::File::ShippingConf;

$shipconf = new MultiSite::File::ShippingConf;
ConfigFile

Load a MultiSite shipping configuration file from an alternate location.

$shipconf = new MultiSite::File::ShippingConf( $altConfigFile );

Methods

get ( Variable [, StorageClass ] )

The get method used to return parameter values will return an array of any/all value(s) defined for any given parameter. This is different from 'normal' INI file usage, and it holds true for every Variable definition contained in objects of this class.

Variable

Valid Variable parameters and default values, if any, are as follows. (The value for $AtriaBin varies with the installed version of MultiSite.)

                      Storage
            Variable   Class   Value(s)              Default value
--------------------  -------  ------------------    -------------
       MAX-DATA-SIZE    no     size [ k | m | g ]    2097151 k 
NOTIFICATION-PROGRAM    no     program-pathname      $AtriaBin/notify
       ADMINISTRATOR    no     e-mail-address        root
         STORAGE-BAY    yes    directory-pathname
          RETURN-BAY    yes    directory-pathname
          EXPIRATION    yes    number-of-days        14
               ROUTE    no     next-hop  host...
  (*)  ROUTE-THROUGH    no     host  next-hop...
     RECEIPT-HANDLER    yes    program-pathname
  CLEARCASE_MIN_PORT    no     from 49151 to 65535
  CLEARCASE_MAX_PORT    no     from 49151 to 65535
    DOWNHOST-TIMEOUT    no     minutes

(*) Note the item 'ROUTE-THROUGH.' This is not stored in the Shipping.conf file. However, since the information necessary is already parsed while loading the data file, this variable is added for convenience. See Examples, below.

StorageClass

Multiple Variable parameters may be configured using a so-called StorageClass to define additional configuration values for some of the items in this data file.

To see a complete list of the values stored in any shipping.conf file, use the dump method. This is useful when testing and debugging scripts that create objects of this class.

Examples:

$dflt_route  = $shipconf->get('ROUTE');

$next_hop    = $shipconf->get('ROUTE', 'hostA');

(@host_list) = $shipconf->get('ROUTE-THROUGH', $next_hop);

print $shipconf->dump;

WARNING

This class supports but DOES NOT enforce syntax in the MultiSite shipping.conf file, and assumes that parameters are set correctly. Also, the default values set for any undefined Variable is accurate as of the modification date of this class. Take care to ensure that assumptions made herein remain accurate! Caveat Programmer.

INHERITANCE

This class inherits from PTools::SDF::INI which in turn inherits from PTools::SDF::File. Due to the strange format of the 'shipping.conf' file this class overrides some of the PTools::SDF::INI methods to correctly parse parameters in the data file.

SEE ALSO

For additional methods see PTools::SDF::INI and PTools::SDF::File.

AUTHOR

Chris Cobb, <chris@ccobb.net>

COPYRIGHT

Copyright (c) 2002-2004 by Hewlett-Packard. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.