Name
Data::Exchange - Exchange files and update issues from your colleagues via an S3 bucket.
Synopsis
Configure and run an exchanger:
use Data::Exchanger;
my $x = Data::Exchanger::new();
$x->user = q(phil);
$x->bucket = q(com.appaapps.exchange);
$x->exchange = q(/home/phil/exchange);
$x->start;
Files that end in .txt no matter where they are located below the exchange folder:
$x->exchange
will be merged with files of the same name from your colleagues whose files show up in other folders under the exchange folder, allowing you to share files and update issues with your colleagues.
Description
Exchange files and update issues via an S3 bucket.
The following sections describe the methods in each functional area of this module. For an alphabetic listing of all methods by name see Index.
Exchange files.
new(@)
New exchanger - see: Data::Exchange Definition for the attributes that can be set by this constructor.
Parameter Description
1 {my @parms = @_; Optional parameters
Example:
my $x = Data::Exchanger::new();
newService($)
Create a new service.
Parameter Description
1 $service Service name
Example:
if (1)
{my $s = newService("aaa");
eval {$s->check};
ok $@ =~ m(|Replaced by a newer version);
my $t = newService("aaa");
eval {$s->check};
ok $@ =~ m(Replaced by a newer version);
}
Data::Exchange::Service::check($)
Check that we are the current instance of the named service with details obtained from setService.
Parameter Description
1 $s Service details
Example:
if (1)
{my $s = newService("aaa");
eval {$s->check};
ok $@ =~ m(|Replaced by a newer version);
my $t = newService("aaa");
eval {$s->check};
ok $@ =~ m(Replaced by a newer version);
}
start()
Start a new exchanger as a service.
Example:
$x->start;
Hash Definitions
Data::Exchange Definition
Exchanger attributes.
bucket - Bucket used for exchanges
exchange - Folder containing files
ext - Extension of issue files
interval - Interval between exchanges
s3Parms - Additional S3 parms
user - User who owns this instance
Data::Exchange::Service Definition
Service details.
file - Service details file
service - Service name
start - Service start time
tests - Test number
Private Methods
exchangeFolder()
Folder containing files.
sep()
Time section separator
stampLength()
Length of stamp
stamp()
Gmt time stamp.
cutByTime($)
Cut a single file into time sections.
Parameter Description
1 $file File
assemble(@)
Assemble the time sections in multiple files into one file.
Parameter Description
1 @files Files
matchFiles($)
Match files that have the same file name.
Parameter Description
1 $x Exchanger
unBoldFiles($)
Make all issue files non bold.
Parameter Description
1 $x Exchanger
localFolder($)
The local folder containing the users own files.
Parameter Description
1 $x Exchanger
exchangeUp($)
Send one set of files.
Parameter Description
1 $x Exchanger
exchangeDown($)
Receive one set of files.
Parameter Description
1 $x Exchanger
exchangeOneSet($)
Exchange one set of files.
Parameter Description
1 $x Exchanger
go($)
Run until forcibly stopped.
Parameter Description
1 $x Exchanger
Index
1 assemble - Assemble the time sections in multiple files into one file.
2 cutByTime - Cut a single file into time sections.
3 Data::Exchange::Service::check - Check that we are the current instance of the named service with details obtained from setService.
4 exchangeDown - Receive one set of files.
5 exchangeFolder - Folder containing files.
6 exchangeOneSet - Exchange one set of files.
7 exchangeUp - Send one set of files.
8 go - Run until forcibly stopped.
9 localFolder - The local folder containing the users own files.
10 matchFiles - Match files that have the same file name.
11 new - New exchanger - see: Data::Exchange Definition for the attributes that can be set by this constructor.
12 newService - Create a new service.
13 sep - Time section separator
14 stamp - Gmt time stamp.
15 stampLength - Length of stamp
16 start - Start a new exchanger as a service.
17 unBoldFiles - Make all issue files non bold.
Installation
This module is written in 100% Pure Perl and, thus, it is easy to read, comprehend, use, modify and install via cpan:
sudo cpan install Data::Exchange
Author
Copyright
Copyright (c) 2016-2018 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.