1 package OpenSRF::Application::Demo::MathDB;
2 use base qw/OpenSRF::Application/;
3 use OpenSRF::Application;
4 use OpenSRF::DomainObject::oilsResponse qw/:status/;
5 use OpenSRF::DomainObject::oilsPrimitive;
6 use OpenSRF::Utils::Logger qw/:level/;
10 our $log = 'OpenSRF::Utils::Logger';
14 # my( $class, $method_name, $method_proto ) = @_;
16 # if( $method_name eq "add" ) {
20 # if( $method_name eq "sub" ) {
24 # if( $method_name eq "mult" ) {
28 # if( $method_name eq "div" ) {
39 $log->debug("Adding @args", INTERNAL);
40 $log->debug("AppRequest is $client", INTERNAL);
41 my $n1 = shift; my $n2 = shift;
42 $n1 =~ s/\s+//; $n2 =~ s/\s+//;
44 my $result = new OpenSRF::DomainObject::oilsResult;
45 $result->content( OpenSRF::DomainObject::oilsScalar->new($a) );
47 $client->respond($result);
53 $log->debug("Subbing @args", INTERNAL);
54 $log->debug("AppRequest is $client", INTERNAL);
55 my $n1 = shift; my $n2 = shift;
56 $n1 =~ s/\s+//; $n2 =~ s/\s+//;
58 my $result = new OpenSRF::DomainObject::oilsResult;
59 $result->content( OpenSRF::DomainObject::oilsScalar->new($a) );
61 $client->respond($result);
68 $log->debug("Multiplying @args", INTERNAL);
69 $log->debug("AppRequest is $client", INTERNAL);
70 my $n1 = shift; my $n2 = shift;
71 $n1 =~ s/\s+//; $n2 =~ s/\s+//;
73 my $result = new OpenSRF::DomainObject::oilsResult;
74 $result->content( OpenSRF::DomainObject::oilsScalar->new($a) );
75 # $client->respond($result);
82 $log->debug("Dividing @args", INTERNAL);
83 $log->debug("AppRequest is $client", INTERNAL);
84 my $n1 = shift; my $n2 = shift;
85 $n1 =~ s/\s+//; $n2 =~ s/\s+//;
87 my $result = new OpenSRF::DomainObject::oilsResult;
88 $result->content( OpenSRF::DomainObject::oilsScalar->new($a) );
90 $client->respond($result);