Eric Wilhelm > dotReader-v0.11.2 > dtRdr::Annotation::Sync::Standard

Download:
dotReader-v0.11.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  1
View/Report Bugs
Source  

NAME ^

dtRdr::Annotation::Sync::Standard - standard server sync

SYNOPSIS ^

Constructor ^

new

  my $sync = dtRdr::Annotation::Sync::Standard->new($uri);

Methods ^

start

  $sync->start;

work

  $sync->work;

finish

  $sync->finish;

Callbacks ^

authenticate

Looks for username and password in the server object, otherwise hits the callback.

  ($user, $pass) = $self->authenticate($realm, $uri);

That's an oversimplification. The user agent hits this on every new request (possibly multiple times in one request if the server rejects the header.)

Also, maybe a bug in LWP: it only tries it twice per request. So, if you typo the password twice, we're dead.

Small Parts ^

add_request

A convenience method that prepends the server base to a ua.add_request() call.

  $self->add_request($method, $path);

queue

  $self->queue($token => sub {...});

dequeue

  my @subs = $self->dequeue($token);

next_request

Callback for collecty user-agent scheme.

Takes a completed request token and runs the registered add_request() subref.

  $self->next_request($token);

cookies

  my $cookies = $self->cookies;

Data Handling ^

process_config

  $self->process_config(%data);

process_manifest

Takes the ua response data (string/response) and sets up a course of action to complete the sync.

Currently assumes a yaml manifest.

  $self->process_manifest(%data);

The rules are in dtRdr::Annotation::SyncRules.

incoming

  $self->incoming($id, %answer);

Various ^

adjust_times

Adjust the object times by the server_drift and direction (+/- 1)

  $self->adjust_times('out', $obj);

  $self->adjust_times('in', $obj, $have);

book

See if we have access to an open book object for a given annotation (or book id?) (Used to notify the book about the changes.)

  $book = $self->book($anno);

AUTHOR ^

Eric Wilhelm <ewilhelm at cpan dot org>

http://scratchcomputing.com/

COPYRIGHT ^

Copyright (C) 2007 Eric L. Wilhelm and OSoft, All Rights Reserved.

NO WARRANTY ^

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

LICENSE ^

The dotReader(TM) is OSI Certified Open Source Software licensed under the GNU General Public License (GPL) Version 2, June 1991. Non-encrypted and encrypted packages are usable in connection with the dotReader(TM). The ability to create, edit, or otherwise modify content of such encrypted packages is self-contained within the packages, and NOT provided by the dotReader(TM), and is addressed in a separate commercial license.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

syntax highlighting: