]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/perlmods/OpenSRF/Application/Settings.pm
added child exit handling code and example
[OpenSRF.git] / src / perlmods / OpenSRF / Application / Settings.pm
1 package OpenSRF::Application::Settings;
2 use OpenSRF::Application;
3 use OpenSRF::Utils::SettingsParser;
4 use OpenSRF::Utils::Logger qw/$logger/;
5 use base 'OpenSRF::Application';
6
7 sub child_exit {
8     $logger->debug("settings server child exiting...$$");
9 }
10
11
12 __PACKAGE__->register_method( method => 'get_host_config', api_name => 'opensrf.settings.host_config.get' );
13 sub get_host_config {
14         my( $self, $client, $host ) = @_;
15         my $parser = OpenSRF::Utils::SettingsParser->new();
16         return $parser->get_server_config($host);
17 }
18
19
20
21
22 __PACKAGE__->register_method( method => 'xpath_get', api_name => 'opensrf.settings.xpath.get' );
23
24 __PACKAGE__->register_method( 
25                 method  => 'xpath_get', 
26                 api_name => 'opensrf.settings.xpath.get.raw' );
27
28 sub xpath_get {
29         my($self, $client, $xpath) = @_;
30         warn "*************** Received XPATH $xpath\n";
31         return  OpenSRF::Utils::SettingsParser->new()->_get_all( $xpath );
32 }
33
34
35 1;