]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/perlmods/OpenSRF/Application/Settings.pm
providing option to connect to memcache at general connect time
[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 __PACKAGE__->register_method( method => 'get_default_config', api_name => 'opensrf.settings.default_config.get' );
20 sub get_default_config {
21         my( $self, $client ) = @_;
22         my $parser = OpenSRF::Utils::SettingsParser->new();
23         return $parser->get_default_config();
24 }
25
26
27
28
29 __PACKAGE__->register_method( method => 'xpath_get', api_name => 'opensrf.settings.xpath.get' );
30
31 __PACKAGE__->register_method( 
32                 method  => 'xpath_get', 
33                 api_name => 'opensrf.settings.xpath.get.raw' );
34
35 sub xpath_get {
36         my($self, $client, $xpath) = @_;
37         warn "*************** Received XPATH $xpath\n";
38         return  OpenSRF::Utils::SettingsParser->new()->_get_all( $xpath );
39 }
40
41
42 1;