appswitch-commits Mailing List for Application Switch (Page 2)
Status: Pre-Alpha
Brought to you by:
jgsmith
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(34) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <app...@li...> - 2001-07-22 00:35:55
|
jgsmith 01/07/21 17:35:55 Added: perl/lib/AppSwitch Config.pm Log: Initial commit - no filters yet Revision Changes Path 1.1 daemon/perl/lib/AppSwitch/Config.pm Index: Config.pm =================================================================== package AppSwitch::Config; use 5.006; use Carp; use XML::Parser; use XML::Parser::EasyTree; =head1 NAME AppSwitch::Config =head1 SYNOPSIS my $config = get AppSwitch::Config q(filename); put $config q(filename); $config -> put(); =head1 DESCRIPTION AppSwitch::Config will read and write XML configuration files for the AppSwitch daemon. An example configuration file: <configuration> <echo> <url>http://echo.jamesmith.com/rpc/echo.php</url> <filter type=accept> <content>^Help!</content> </filter> </echo> <echo> <url>http://echo.ookook.org/rpc/echo.php</url> <filter type=reject> <content>me!$</content> </filter> </echo> </configuration> Note that filters are not yet supported by AppSwitch::Config. =head1 METHODS =over 4 =item get AppSwitch::Config q(filename) This will parse the named file and return a hash structure with with the service names as keys pointing to hashes indexed by the URL of the service provider. =item $config -> put([q(filename)]); This will output an XML configuration either to STDOUT (if no filename is given) or to the named file. The output is suitable for reading with the C<get> method. =back =head1 SEE ALSO L<AppSwitch::Daemon>, L<AppSwitch::Services>. =head1 AUTHOR James Smith <jg...@ja...> =head1 COPYRIGHT Copyright (C) 2001 James Smith Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. =cut sub get { my $class = shift; my $file = shift; local($XML::Parser::EasyTree::Noempty) = 1; my $parser = new XML::Parser(Style => 'EasyTree'); my $config = $parser -> parsefile($file); my $self = bless { }, (ref $class || $class); foreach my $s (@{$config}) { next unless $s->{name} eq "configuration"; $config = $s -> {content}; last; } foreach my $s (@{$config}) { my $type = $s -> {name}; my $info = { }; foreach my $t (@{$s -> {content}}) { next unless @{$t -> {content}} == 1 && $t -> {content}[0]{type} eq "t"; $info->{$t -> {name}} = $t -> {content}[0]{content}; } next unless $info -> {url}; my $url = $info -> {url}; delete $info -> {url}; $self -> {$type} -> {$url} = $info; } return $self; } sub put { my $self = shift; my $file = shift; my $fh; if($file) { open $fh, "> $file" or croak "Unable to open $file: $!"; } else { $fh = *STDOUT; } my($service, $config, $url, $info); print $fh "<configuration>\n"; while(($service, $config) = each %{$self}) { while(($url, $info) = each %{$config}) { print $fh " <$service>\n <url>$url</url>\n", join "", map { " <$_>$$info{$_}</$_>\n" } keys %{$info}; print $fh " </$service>\n"; } } print $fh "</configuration>\n"; close $fh; } 1; |
From: <app...@li...> - 2001-07-22 00:25:11
|
jgsmith 01/07/21 17:25:10 Modified: . COPYING Log: Added the section on warranties. Revision Changes Path 1.2 +13 -1 COPYING Index: COPYING =================================================================== RCS file: /cvsroot/appswitch/COPYING,v retrieving revision 1.1 retrieving revision 1.2 diff -b -u -r1.1 -r1.2 --- COPYING 2001/07/20 02:47:58 1.1 +++ COPYING 2001/07/22 00:25:10 1.2 @@ -14,3 +14,15 @@ 3. Neither the name of the Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTERS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENT- +AL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
From: <app...@li...> - 2001-07-20 20:58:01
|
jgsmith 01/07/20 13:58:01 Added: perl/lib/AppSwitch/Echo Client.pm Log: Initial commit Revision Changes Path 1.1 services/perl/lib/AppSwitch/Echo/Client.pm Index: Client.pm =================================================================== package AppSwitch::Echo::Client; use base q(AppSwitch::Base::Client); our $VERSION = q(0.01); our $RPC_SERVICE = "echo"; sub echo { my($self) = shift; my($string) = $_ return $self -> request("echo", content => $string); } 1; __END__ =head1 NAME AppSwitch::Echo::Client =head1 SYNOPSIS use AppSwitch::Echo::Client; my $client = new AppSwitch::Echo::Client; print $client -> echo('Hello, World!'); =head1 DESCRIPTION The echo client and server provide a simple example of a service enabled for the application switch. See L<AppSwitch::Base::Client> for more information on writing a client. =head1 METHODS =over 4 =item echo(string) Uses an echo service to return the string sent to the service. This can be useful for testing connections or making sure the daemon is up and running. =back =head1 AUTHOR James Smith <jg...@ja...> =head1 COPYRIGHT Copyright (C) 2001 James Smith Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
From: <app...@li...> - 2001-07-20 20:54:12
|
jgsmith 01/07/20 13:54:09 Added: perl/lib/AppSwitch/Base Client.pm Log: Initial checkin Revision Changes Path 1.1 services/perl/lib/AppSwitch/Base/Client.pm Index: Client.pm =================================================================== package AppSwitch::Base::Client; our $VERSION = 0.01; use Carp; use SOAP::Transport::UNIX; # $ Id: $ =head1 NAME AppSwitch::Base::Client =head1 SYNOPSIS package AppSwitch::MyService; use base q(AppSwitch::Base::Client); our $RPC_SERVICE = q(x-myservice); =head1 DESCRIPTION This base class contains most of the code common across service clients. =head1 METHODS The following methods are provided. =over 4 =item new This is a basic constructor for the client object. If overriding this method, use it to construct the object and then modify the resulting object. sub new { my $self = shift -> SUPER::new(@_); # process @_ here if needed return $self; } =cut sub new { my $class = shift; $class = ref $class || $class; my $self = bless { }, $class; return $self; } =item service This will return the service name of the client. If an argument is provided, it sets the service name of the client and returns the previous service name. Be careful with this as it changes how requests are sent to the service providers. The default value is defined by the C<RPC_SERVICE> package global. The <@ISA> array is searched if needed. =cut sub service { my $self = shift; if(@_) { my $o = $self -> service(); $self -> {_service} = $_[0]; return $o; } return $self -> {_service} if defined $self -> {_service}; my $class = ref $self || $self; return($self -> {_service} = ${$class . "::RPC_SERVICE"}) if(defined ${$class . "::RPC_SERVICE"}); croak "Service class undefined by $class" unless defined @{$class . "::ISA"}; my @classes = @{$class . "::ISA"}; while(@classes) { $class = shift @classes; return($self -> {_service} = ${$class . "::RPC_SERVICE"}) if(defined ${$class . "::RPC_SERVICE"}); push @classes, @{$class . "::ISA"} if defined @{$class . "::ISA"}; } $class = ref $self || $self; croak "Service class undefined by $class"; } =item request This actually does the request. The first argument is the method name without the service name. All subsequent arguments are considered part of a hash that is sent to the daemon as a C<struct>. The return value is the result of the request (if synchronous) or an object from which to fetch the result at a later time (if asynchronous). Note that asynchronous requests are not supported yet. =cut sub request { my($self) = shift; my $method = shift; my(%args) = @_; $method = $self -> service() . ".$method"; # now we need to dispatch via the SOAP/XML-RPC client object... which is global... our $_transport; if(!defined $_client) { $_client = SOAP::Lite -> proxy("unix:$ENV{APPSWITCH_SOCKET}") or croak "Unable to connect to AppSwitch daemon: $!"; } if(@_) { return $_client -> $method({ %args }) -> result; } else { return $_client -> $method() -> result; } } =item version This will return the version of the service provider. If multiple service providers are configured for a service, it will return the lowest version. =cut sub version { my($self) = shift; return $self -> request("version"); } =back =head1 AUTHOR James Smith <jg...@ja...> =head1 SEE ALSO L<AppSwitch::Daemon>, L<AppSwitch::Server> =head1 COPYRIGHT =cut 1; |
From: <app...@li...> - 2001-07-20 14:45:25
|
jgsmith 01/07/20 07:45:24 Added: perl/lib/AppSwitch Echo.pm Services.pm Log: Initial documentation for general services and the echo service Revision Changes Path 1.1 services/perl/lib/AppSwitch/Echo.pm Index: Echo.pm =================================================================== package AppSwitch::Echo; our $VERSION = q(0.01); # $Id: Echo.pm,v 1.1 2001/07/20 14:45:24 jgsmith Exp $ __END__ =head1 NAME AppSwitch::Echo =head1 SYNOPSIS use AppSwitch::Echo::Client; use AppSwitch::Echo::Server; =head1 DESCRIPTION AppSwitch::Echo provides the client and service interfaces for the C<echo> service. =head1 SERVICE DEFINITION The following methods are defined by the C<echo> service. =over 4 =item echo.version This method requires no arguments and returns a string representing the version of the interface supported by the service. =item echo.echo This method returns the value of its single argument (C<content>). =back =head1 AUTHOR James Smith <jg...@ja...> =head1 SEE ALSO L<AppSwitch::Echo::Client>, L<AppSwitch::Echo::Server> =head1 COPYRIGHT Copyright (C) 2001 James Smith Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. =cut 1.1 services/perl/lib/AppSwitch/Services.pm Index: Services.pm =================================================================== package AppSwitch::Services; our $VERSION = q(0.01); __END__ =head1 NAME AppSwitch::Services =head1 DESCRIPTION The Perl modules distributed with this package provide easy to use client and service provider interfaces for the full range of Application Switch enabled services. A typical client use of a service is as follows. my $client = new AppSwitch::Echo::Client; print $client -> echo("A string"); Each service has a well-defined interface independent of the service provider. This allows applications to work with any service provider that the user selects in the Application Switch daemon (L<AppSwitch::Daemon>). =head1 SERVICES See the documentation for each service for a full description of the interface. =over 4 =item echo This is an echo service provided by the AppSwitch::Echo packages. =back =head1 COPYRIGHT Copyright (C) 2001 James Smith Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. =cut |
From: <app...@li...> - 2001-07-20 14:44:49
|
jgsmith 01/07/20 07:44:48 services/perl/lib/AppSwitch/Echo - New directory |
From: <app...@li...> - 2001-07-20 14:44:49
|
jgsmith 01/07/20 07:44:48 services/perl/lib/AppSwitch/Base - New directory |
From: <app...@li...> - 2001-07-20 04:04:31
|
jgsmith 01/07/19 21:04:31 Added: perl Makefile.PL Log: Initial checkin Revision Changes Path 1.1 services/perl/Makefile.PL Index: Makefile.PL =================================================================== use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'AppSwitch::Services', 'VERSION_FROM' => 'lib/AppSwitch/Services.pm', # finds $VERSION 'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" }, ); |
From: <app...@li...> - 2001-07-20 04:03:55
|
jgsmith 01/07/19 21:03:55 Added: perl Makefile.PL Log: Initial checkin Revision Changes Path 1.1 daemon/perl/Makefile.PL Index: Makefile.PL =================================================================== use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'AppSwitch::Daemon', 'VERSION_FROM' => 'lib/AppSwitch/Daemon.pm', # finds $VERSION 'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" }, ); |
From: <app...@li...> - 2001-07-20 02:47:58
|
jgsmith 01/07/19 19:47:58 Added: . COPYING Log: Initial checkin - nothing glamorous Revision Changes Path 1.1 COPYING Index: COPYING =================================================================== This license governs all files in this repository unless otherwise specified in a file (in which case, only that file is an exception). Copyright (C) 2001 James Smith Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
From: <app...@li...> - 2001-07-20 02:38:19
|
jgsmith 01/07/19 19:38:18 services/perl/lib/AppSwitch - New directory |
From: <app...@li...> - 2001-07-20 02:36:35
|
jgsmith 01/07/19 19:36:32 services/perl/lib - New directory |