--- nfo/perl/libs/Data/Transfer/Sync/StorageInterface.pm 2003/02/14 14:14:38 1.4 +++ nfo/perl/libs/Data/Transfer/Sync/StorageInterface.pm 2003/02/20 20:24:33 1.5 @@ -1,4 +1,4 @@ -## $Id: StorageInterface.pm,v 1.4 2003/02/14 14:14:38 joko Exp $ +## $Id: StorageInterface.pm,v 1.5 2003/02/20 20:24:33 joko Exp $ ## ## Copyright (c) 2002 Andreas Motl ## @@ -6,6 +6,9 @@ ## ## ---------------------------------------------------------------------------------------- ## $Log: StorageInterface.pm,v $ +## Revision 1.5 2003/02/20 20:24:33 joko +## + additional pre-flight checks +## ## Revision 1.4 2003/02/14 14:14:38 joko ## + new code refactored here ## @@ -130,6 +133,17 @@ my $ident = shift; my $force = shift; +=pod + #print "isa: ", UNIVERSAL::isa($self->{meta}->{$descent}->{storage}), "\n"; + + # this seems to be the first time we access this side, + # so just check (again) for a valid storage handle + if (! ref $self->{meta}->{$descent}->{storage}) { + $logger->critical( __PACKAGE__ . "->_statloadNode( descent=$descent ident=$ident ): Storage handle undefined!" ); + return; + } +=cut + #$logger->debug( __PACKAGE__ . "->_statloadNode( descent=$descent ident=$ident )" ); # fetch entry to retrieve checksum from @@ -237,6 +251,13 @@ next; } + # 2.b check storage handle type + my $dbType = $self->{meta}->{$descent}->{storage}->{locator}->{type}; + if (!$dbType) { + $logger->critical( __PACKAGE__ . "->touchNodeSet: Storage ( descent='$descent', dbKey='$dbkey' ) has no 'dbType' - configuration-error?" ); + next; + } + # 3. check if descents (and nodes?) are actually available.... # TODO: # eventually pre-check mode of access-attempt (read/write) here to provide an "early-croak" if possible @@ -245,7 +266,6 @@ # print Dumper($self->{meta}->{$descent}->{storage}->{locator}); - my $dbType = $self->{meta}->{$descent}->{storage}->{locator}->{type}; my $nodeName = $self->{meta}->{$descent}->{nodeName}; my $accessorType = $self->{meta}->{$descent}->{accessorType}; my $accessorName = $self->{meta}->{$descent}->{accessorName};