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


dotReader documentation  | view source Contained in the dotReader distribution.

Index


NAME

Top

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

SYNOPSIS

Top

Constructor

Top

new

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

Methods

Top

start

  $sync->start;

work

  $sync->work;

finish

  $sync->finish;

Callbacks

Top

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

Top

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

Top

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

Top

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

Top

Eric Wilhelm <ewilhelm at cpan dot org>

http://scratchcomputing.com/

COPYRIGHT

Top

NO WARRANTY

Top

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

Top

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.


dotReader documentation  | view source Contained in the dotReader distribution.