IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6601


Ignore:
Timestamp:
Mar 15, 2006, 4:47:09 PM (20 years ago)
Author:
jhoblitt
Message:

doc update

Location:
trunk/DataStore/lib/DataStore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/lib/DataStore/File.pm

    r6596 r6601  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: File.pm,v 1.5 2006-03-15 22:17:41 jhoblitt Exp $
     3# $Id: File.pm,v 1.6 2006-03-16 02:47:09 jhoblitt Exp $
    44
    55package DataStore::File;
     
    3636    use DataStore::file;
    3737
    38     my $dsf = DateStore::File->new(...);
     38    my $dsf = DateStore::File->new(
     39        uri         => 'http://example.org/foo',
     40        fileid      => '12buckelyourshoe',
     41        bytes       => 12345,
     42        md5sum      => 'fe6a2b6564c0d4cfb3bbf1db813824ba',
     43        type        => 'foo',
     44    );
     45
     46    my $uri     = $dsf->uri;
     47    my fileid   = $dsf->fileid;
     48    my $bytes   = $dsf-bytes;
     49    my $md5sum  = $dsf->md5sum;
     50    my $type    = $dsf-type;
     51    my DataStore::Response $response = $dsf->request( filename => "/foo/bar" );
    3952
    4053=head1 DESCRIPTION
     
    5467
    5568=item * C<new()>
     69
     70Basic constructor.
     71
     72    my $dsf = DateStore::File->new(
     73        uri         => 'http://example.org/foo',
     74        fileid      => '12buckelyourshoe',
     75        bytes       => 12345,
     76        md5sum      => 'fe6a2b6564c0d4cfb3bbf1db813824ba',
     77        type        => 'foo',
     78    );
     79
     80Accepts a mandatory hash and returns a L<DataStore::Product> object.
     81
     82=over 4
     83
     84=item * uri
     85
     86A valid I<HTTP> URI as a string.  I<No trailing slash is allowed.>
     87
     88=item * fileid
     89
     90The FIle ID as a string.
     91
     92=item * bytes
     93
     94The size of the file as an integer number of bytes.
     95
     96=item * md5sum
     97
     98The hex encoded md5 checksum of the file.
     99
     100=item * type
     101
     102The type of file as a string.
     103
     104=back
    56105
    57106=cut
     
    94143=over 4
    95144
     145=item * C<uri>
     146
     147Basic accessor.
     148
     149=item * C<fileid>
     150
     151Basic accessor.
     152
     153=item * C<bytes>
     154
     155Basic accessor.
     156
     157=item * C<md5sum>
     158
     159Basic accessor.
     160
     161=item * C<type>
     162
     163Basic accessor.
     164
    96165=item * C<request()>
     166
     167Retrieves and processes the File listing pointed to by the L<uri> of this
     168object.
     169
     170XXX writing the file into memory or to a filehandle will be implimented upon
     171request.
     172
     173    my $response = $dsf->request( filename => "/foo/bar" );
     174
     175Accepts a mandatory hash and returns a L<DataStore::Response> object.
     176
     177=over 4
     178
     179=item * filename
     180
     181The filename/path to save the file to disk as.
     182
     183=back
    97184
    98185=cut
     
    158245}
    159246
     247=back
     248
     249=head1 SEE ALSO
     250
     251L<DataStore::Response>
     252
     253=cut
     254
    1602551;
    161256
  • trunk/DataStore/lib/DataStore/FileSet.pm

    r6587 r6601  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: FileSet.pm,v 1.3 2006-03-15 03:18:25 jhoblitt Exp $
     3# $Id: FileSet.pm,v 1.4 2006-03-16 02:47:09 jhoblitt Exp $
    44
    55package DataStore::FileSet;
     
    3535    use DataStore::FileSet;
    3636
    37     my $dsfs = DateStore::FileSet->new(...);
     37    my $dsfs = DateStore::FileSet->new(
     38        uri         => 'http://example.org/',
     39        fileset     => '12buckelyourshoe',
     40        datetime    => '2042-01-01T00:00:00Z',
     41        type        => 'foo',
     42    );
     43
     44    my $uri         = $dsfs->uri;
     45    my $fileset     = $dsfs->fileset;
     46    my $datatime    = $dsfs->datetime;
     47    my $type        = $dsfs->type;
     48    my DataStore::Response $response = $dsfs->request;
    3849
    3950=head1 DESCRIPTION
     
    5364
    5465=item * C<new()>
     66
     67Basic constructor.
     68
     69    my $dsfs = DateStore::FileSet->new(
     70        uri         => 'http://example.org/',
     71        fileset     => '12buckelyourshoe',
     72        datetime    => '2042-01-01T00:00:00Z',
     73        type        => 'foo',
     74    );
     75
     76Accepts a mandatory hash and returns a L<DataStore::FileSet> object.
     77
     78=over 4
     79
     80=item * uri
     81
     82A valid I<HTTP> URI as a string.  I<A trailing slash is required.>
     83
     84=item * fileset
     85
     86The FileSet ID as a string.
     87
     88=item * datetime
     89
     90The time and date as a string.
     91
     92=item * type
     93
     94The I<type> of record as a string.
     95
     96=back
    5597
    5698=cut
     
    91133=over 4
    92134
     135=item * C<uri()>
     136
     137Basic accessor.
     138
     139=item * C<fileset()>
     140
     141Basic accessor.
     142
     143=item * C<datetime()>
     144
     145Basic accessor.
     146
     147=item * C<type()>
     148
     149Basic accessor.
     150
    93151=item * C<request()>
     152
     153Retrieves and processes the File listing pointed to by the L<uri> of this
     154object.
     155
     156Accepts no parameters and returns a L<DataStore::Response> object.
    94157
    95158=cut
     
    133196}
    134197
     198=back
     199
     200=head1 SEE ALSO
     201
     202L<DataStore::Response>
     203
     204=cut
     205
    1352061;
    136207
  • trunk/DataStore/lib/DataStore/Product.pm

    r6584 r6601  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: Product.pm,v 1.3 2006-03-14 23:24:05 jhoblitt Exp $
     3# $Id: Product.pm,v 1.4 2006-03-16 02:47:09 jhoblitt Exp $
    44
    55package DataStore::Product;
     
    4343    );
    4444
    45     my DataStore::Response $response = $dsp->fetch;
     45    my $uri     = $dsp->uri;
     46    my $fileset = $dsp_fileset;
     47    my DataStore::Response $response = $dsp->request;
    4648
    4749=head1 DESCRIPTION
     
    6466Basic constructor.
    6567
    66 Accepts no arguments and returns a L<DataStore::Product> object.
     68    my $dsp = DataStore::Product->new(
     69        uri             => 'http://example.com/productid/',
     70        last_fileset    => 'foobar',
     71    );
     72
     73Accepts a mandatory hash and returns a L<DataStore::Product> object.
     74
     75=over 4
     76
     77=item * uri
     78
     79A valid I<HTTP> URI as a string.  I<A trailing slash is required.>
     80
     81=item * last_fileset
     82
     83The last FileSet ID that was requested as a string.
     84
     85This key is optional.
     86
     87=back
    6788
    6889=cut
     
    105126=over 4
    106127
     128=item * C<uri()>
     129
     130Basic accessor.
     131
     132=item * C<last_fileset()>
     133
     134Basic accessor.
     135
    107136=item * C<request()>
     137
     138Retrieves and processes the FileSet listing pointed to by the L<uri> of this
     139object.
     140
     141Accepts no parameters and returns a L<DataStore::Response> object.
    108142
    109143=cut
     
    118152    # make request
    119153    my $ua = LWP::UserAgent->new;
    120     my $request = HTTP::Request->new(GET => $self->uri);
     154    my $request;
     155    if ($self->last_fileset) {
     156        $request = HTTP::Request->new(
     157            GET => $self->uri . "?" . $self->last_fileset,
     158        );
     159    } else {
     160        $request = HTTP::Request->new(GET => $self->uri);
     161    }
    121162    my $response = $ua->request($request);
    122163
     
    147188}
    148189
     190=back
     191
     192=head1 SEE ALSO
     193
     194L<DataStore::Response>
     195
     196=cut
     197
    1491981;
    150199
  • trunk/DataStore/lib/DataStore/Response.pm

    r6542 r6601  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: Response.pm,v 1.1 2006-03-08 02:11:46 jhoblitt Exp $
     3# $Id: Response.pm,v 1.2 2006-03-16 02:47:09 jhoblitt Exp $
    44
    55package DataStore::Response;
     
    3131    use DataStore::Response;
    3232
    33     my $dsr = DateStore::Response->new(...);
     33    my $dsr = DateStore::Response->new(
     34        is_success  => undef,
     35        code        => 500,
     36        status_line => 'foo',
     37        data        => 'bar',
     38        request     => DataStore::Product->new( uri => 'http://example.org/' ),
     39    );
     40
     41    my $success     = $dsr->is_success;
     42    my $code        = $dsr->code;
     43    my $status_line = $dsr->status_line;
     44    my $data        = $dsr->data;
     45    my DataStore::Response $response = $dsp->request;
    3446
    3547=head1 DESCRIPTION
     
    4961
    5062=item * C<new()>
     63
     64Basic constructor.
     65
     66    my $dsr = DateStore::Response->new(
     67        is_success  => undef,
     68        code        => 500,
     69        status_line => 'foo',
     70        data        => 'bar',
     71        request     => DataStore::Product->new( uri => 'http://example.org/' ),
     72    );
     73
     74Accepts a mandatory hash and returns a L<DataStore::Product> object.
     75
     76=over 4
     77
     78=item * uri
     79
     80A vvalid I<HTTP> URI as a string.
     81
     82=item * code
     83
     84An HTTP status code.
     85
     86=item * status_line
     87
     88An HTTP status line.
     89
     90=item * data
     91
     92Either a scalar value or an arrayref of scalar data.
     93
     94=item * request
     95
     96An object that I<isa> L<DataStore::Record>.
     97
     98=back
    5199
    52100=cut
     
    88136}
    89137
     138=back
     139
     140=head3 Object Methods
     141
     142=over 4
     143
     144=item * C<uri>
     145
     146Basic accessor.
     147
     148=item * C<code>
     149
     150Basic accessor.
     151
     152=item * C<status_line>
     153
     154Basic accessor.
     155
     156=item * C<data>
     157
     158Basic accessor.
     159
     160=item * C<request>
     161
     162Basic accessor.
     163
     164=cut
     165
    901661;
    91167
Note: See TracChangeset for help on using the changeset viewer.