| 2 |
## $Id$ |
## $Id$ |
| 3 |
## ------------------------------------------------------------------------ |
## ------------------------------------------------------------------------ |
| 4 |
## $Log$ |
## $Log$ |
| 5 |
|
## Revision 1.4 2003/07/01 18:11:15 joko |
| 6 |
|
## fixed: renamed package name according to new filenames |
| 7 |
|
## |
| 8 |
|
## Revision 1.3 2003/06/25 23:37:04 joko |
| 9 |
|
## + sub clearProxyCache |
| 10 |
|
## |
| 11 |
|
## Revision 1.2 2003/02/20 21:09:59 joko |
| 12 |
|
## modified runtime namespace hierarchy |
| 13 |
|
## |
| 14 |
## Revision 1.1 2003/02/11 09:46:09 joko |
## Revision 1.1 2003/02/11 09:46:09 joko |
| 15 |
## + initial commit |
## + initial commit |
| 16 |
## |
## |
| 17 |
## ------------------------------------------------------------------------ |
## ------------------------------------------------------------------------ |
| 18 |
|
|
| 19 |
|
|
| 20 |
package OEF::Component::WebProxy; |
package OEF::Component::WebCache; |
| 21 |
|
|
| 22 |
use strict; |
use strict; |
| 23 |
use warnings; |
use warnings; |
| 67 |
#print Dumper($self); |
#print Dumper($self); |
| 68 |
#exit; |
#exit; |
| 69 |
|
|
| 70 |
my $proxyObj = $self->{app}->{import}->remote('HttpProxy'); |
my $proxyObj = $self->{app}->{storage}->{import}->remote('HttpProxy'); |
| 71 |
my @results = $self->{app}->{import}->select($proxyObj, $proxyObj->{url} eq $url); |
my @results = $self->{app}->{storage}->{import}->select($proxyObj, $proxyObj->{url} eq $url); |
| 72 |
my $content = $results[0]->{content} if $results[0]->{content}; |
my $content = $results[0]->{content} if $results[0]->{content}; |
| 73 |
my $oktxt = "no"; |
my $oktxt = "no"; |
| 74 |
if ($content) { |
if ($content) { |
| 94 |
age => $response->current_age(), |
age => $response->current_age(), |
| 95 |
); |
); |
| 96 |
my $oktxt = "no"; |
my $oktxt = "no"; |
| 97 |
if ($self->{app}->{import}->insert($proxyObj)) { |
if ($self->{app}->{storage}->{import}->insert($proxyObj)) { |
| 98 |
$oktxt = "ok"; |
$oktxt = "ok"; |
| 99 |
} |
} |
| 100 |
$logger->debug( __PACKAGE__ . "->savePageToProxy ...$oktxt" ); |
$logger->debug( __PACKAGE__ . "->savePageToProxy ...$oktxt" ); |
| 128 |
return $content; |
return $content; |
| 129 |
} |
} |
| 130 |
|
|
| 131 |
|
sub clearProxyCache { |
| 132 |
|
my $self = shift; |
| 133 |
|
my $proxyObj = $self->{app}->{storage}->{import}->remote('HttpProxy'); |
| 134 |
|
#my @results = $self->{app}->{storage}->{import}->select($proxyObj, $proxyObj->{url} eq $url); |
| 135 |
|
my @results = $self->{app}->{storage}->{import}->select($proxyObj); |
| 136 |
|
$self->{app}->{storage}->{import}->erase( @results ); |
| 137 |
|
} |
| 138 |
|
|
| 139 |
1; |
1; |
| 140 |
|
__END__ |