--- nfo/perl/libs/OEF/Component/WebCache.pm 2003/02/11 09:46:09 1.1 +++ nfo/perl/libs/OEF/Component/WebCache.pm 2003/07/01 18:11:15 1.4 @@ -1,14 +1,23 @@ ## ------------------------------------------------------------------------ -## $Id: WebCache.pm,v 1.1 2003/02/11 09:46:09 joko Exp $ +## $Id: WebCache.pm,v 1.4 2003/07/01 18:11:15 joko Exp $ ## ------------------------------------------------------------------------ ## $Log: WebCache.pm,v $ +## Revision 1.4 2003/07/01 18:11:15 joko +## fixed: renamed package name according to new filenames +## +## Revision 1.3 2003/06/25 23:37:04 joko +## + sub clearProxyCache +## +## Revision 1.2 2003/02/20 21:09:59 joko +## modified runtime namespace hierarchy +## ## Revision 1.1 2003/02/11 09:46:09 joko ## + initial commit ## ## ------------------------------------------------------------------------ -package OEF::Component::WebProxy; +package OEF::Component::WebCache; use strict; use warnings; @@ -58,8 +67,8 @@ #print Dumper($self); #exit; - my $proxyObj = $self->{app}->{import}->remote('HttpProxy'); - my @results = $self->{app}->{import}->select($proxyObj, $proxyObj->{url} eq $url); + my $proxyObj = $self->{app}->{storage}->{import}->remote('HttpProxy'); + my @results = $self->{app}->{storage}->{import}->select($proxyObj, $proxyObj->{url} eq $url); my $content = $results[0]->{content} if $results[0]->{content}; my $oktxt = "no"; if ($content) { @@ -85,7 +94,7 @@ age => $response->current_age(), ); my $oktxt = "no"; - if ($self->{app}->{import}->insert($proxyObj)) { + if ($self->{app}->{storage}->{import}->insert($proxyObj)) { $oktxt = "ok"; } $logger->debug( __PACKAGE__ . "->savePageToProxy ...$oktxt" ); @@ -119,4 +128,13 @@ return $content; } +sub clearProxyCache { + my $self = shift; + my $proxyObj = $self->{app}->{storage}->{import}->remote('HttpProxy'); + #my @results = $self->{app}->{storage}->{import}->select($proxyObj, $proxyObj->{url} eq $url); + my @results = $self->{app}->{storage}->{import}->select($proxyObj); + $self->{app}->{storage}->{import}->erase( @results ); +} + 1; +__END__